-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
37 lines (32 loc) · 1.32 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
cmake_minimum_required(VERSION 2.8.3)
project(gflags_catkin)
find_package(catkin_simple REQUIRED)
catkin_simple()
include(ExternalProject)
file(MAKE_DIRECTORY ${CATKIN_DEVEL_PREFIX}/include)
ExternalProject_Add(
gflags_src
URL https://github.com/gflags/gflags/archive/v2.2.1.zip
URL_MD5 2d988ef0b50939fb50ada965dafce96b
UPDATE_COMMAND ""
CONFIGURE_COMMAND cd ../gflags_src &&
cmake .
-DCMAKE_INSTALL_PREFIX:PATH=${CATKIN_DEVEL_PREFIX}
-DBUILD_SHARED_LIBS:BOOL=true
-DGFLAGS_NAMESPACE:STRING=google
-DCMAKE_BUILD_TYPE:STRING=Release
-DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE}
BUILD_COMMAND cd ../gflags_src && make -j 8
INSTALL_COMMAND cd ../gflags_src && make install -j 8
)
install(DIRECTORY ${CATKIN_DEVEL_PREFIX}/include/gflags
DESTINATION ${CATKIN_GLOBAL_INCLUDE_DESTINATION}
FILES_MATCHING PATTERN "*.h")
install(DIRECTORY ${CATKIN_DEVEL_PREFIX}/lib/
DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
FILES_MATCHING PATTERN "libgflags*")
install(FILES ${CATKIN_DEVEL_PREFIX}/bin/gflags_completions.sh
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION})
cs_export(INCLUDE_DIRS ${CATKIN_DEVEL_PREFIX}/include
LIBRARIES gflags)