forked from rock-drivers/drivers-hokuyo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
46 lines (34 loc) · 1.4 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
PROJECT(hokuyo)
SET(PROJECT_VERSION 1.0)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
INCLUDE(FindPkgConfig)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
MACRO(CMAKE_USE_FULL_RPATH install_rpath)
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
SET(CMAKE_INSTALL_RPATH ${install_rpath})
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
ENDMACRO(CMAKE_USE_FULL_RPATH)
CMAKE_USE_FULL_RPATH("${CMAKE_INSTALL_PREFIX}/lib")
pkg_check_modules(BASE_TYPES REQUIRED "base-types")
INCLUDE_DIRECTORIES(${BASE_TYPES_INCLUDE_DIRS})
LINK_DIRECTORIES(${BASE_TYPES_LIBRARY_DIRS})
pkg_check_modules(IO REQUIRED "iodrivers_base")
INCLUDE_DIRECTORIES(${IO_INCLUDE_DIRS})
LINK_DIRECTORIES(${IO_LIBRARY_DIRS})
ADD_LIBRARY(hokuyo SHARED hokuyo.cc)
TARGET_LINK_LIBRARIES(hokuyo ${BASE_TYPES_LIBRARIES} ${IO_LIBRARIES})
ADD_EXECUTABLE(hokuyo_test hokuyo_test.cc)
TARGET_LINK_LIBRARIES(hokuyo_test hokuyo)
ADD_EXECUTABLE(urg_serial hokuyo_serial.cpp)
TARGET_LINK_LIBRARIES(urg_serial hokuyo)
ADD_EXECUTABLE(hokuyo_acq hokuyo_acq.cc)
TARGET_LINK_LIBRARIES(hokuyo_acq hokuyo)
INSTALL(TARGETS hokuyo hokuyo_acq
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib)
INSTALL(FILES hokuyo.hh DESTINATION include)
CONFIGURE_FILE(Doxyfile.in Doxyfile @ONLY)
ADD_CUSTOM_TARGET(doc doxygen Doxyfile)
CONFIGURE_FILE(hokuyo.pc.in hokuyo.pc @ONLY)
INSTALL(FILES ${CMAKE_BINARY_DIR}/hokuyo.pc DESTINATION lib/pkgconfig)