-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
51 lines (40 loc) · 1.41 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
cmake_minimum_required(VERSION 2.8.3)
project(ldlidar_stl)
set(VAL 1)
if(${VAL} EQUAL 1)
set(CMAKE_BUILD_TYPE "Release")
set(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -std=c++11 -Wall")
#set(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -std=c++11 -O3 -Wall")
message(STATUS "Mode: Release")
message(STATUS "optional:-std=c++11")
else()
set(CMAKE_BUILD_TYPE "Debug")
set(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -std=c++11 -Wall -Wextra -Wpedantic -g2 -ggdb")
#set(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -std=c++11 -O2 -Wall -Wextra -Wpedantic -g2 -ggdb")
message(STATUS "Mode: Debug")
message(STATUS "optional:-std=c++11")
endif()
###########
## Build ##
###########
## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/include/ldlidar_driver/include
)
## Get current directory files
#aux_source_directory(./src file_name)
#if(file_name MATCHES "slbf.cpp")
# add_definitions(-D"USE_SLBF")
# message("-- #define USE_SLBF")
#endif()
file(GLOB LDLIDAR_DRIVER_SRC ${CMAKE_CURRENT_SOURCE_DIR}/include/ldlidar_driver/*.cpp)
add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/src/linux_demo/demo.cpp ${LDLIDAR_DRIVER_SRC})
target_link_libraries(${PROJECT_NAME} pthread)
## Declare a C++ library
# add_library(${PROJECT_NAME}
# src/${PROJECT_NAME}/ldlidar.cpp
# )
#############
## Testing ##
#############