From c493369594fc51f304f6f3ce170e4cefc514372e Mon Sep 17 00:00:00 2001 From: Matthias Loebach Date: Tue, 6 Nov 2018 07:06:28 +0100 Subject: [PATCH] Only include correct source files in cmake (#1085) This fixes #1050. Tested standalone compilation and with the debian fakeroot tool. I had to build with a custom Protobuf3 instance though, so another build-check on a regular setup would be appreciated. Before this change all *.cc files would be included. If subprojects were run individually with the Debian package generator. This resulted in an inclusion of temporarily checked out *.cc from the abseil include. This change fixes the import behaviour and enables the creation of a valid package. --- cartographer_ros/CMakeLists.txt | 8 ++++---- cartographer_rviz/CMakeLists.txt | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cartographer_ros/CMakeLists.txt b/cartographer_ros/CMakeLists.txt index da73fc9..43aa861 100644 --- a/cartographer_ros/CMakeLists.txt +++ b/cartographer_ros/CMakeLists.txt @@ -83,9 +83,9 @@ catkin_package( LIBRARIES ${PROJECT_NAME} ) -file(GLOB_RECURSE ALL_SRCS "*.cc" "*.h") -file(GLOB_RECURSE ALL_TESTS "*_test.cc") -file(GLOB_RECURSE ALL_EXECUTABLES "*_main.cc") +file(GLOB_RECURSE ALL_SRCS "cartographer_ros/*.cc" "cartographer_ros/*.h") +file(GLOB_RECURSE ALL_TESTS "cartographer_ros/*_test.cc") +file(GLOB_RECURSE ALL_EXECUTABLES "cartographer_ros/*_main.cc") file(GLOB_RECURSE ALL_GRPC_FILES "cartographer_ros/cartographer_grpc/*") list(REMOVE_ITEM ALL_SRCS ${ALL_TESTS}) list(REMOVE_ITEM ALL_SRCS ${ALL_EXECUTABLES}) @@ -172,7 +172,7 @@ install(TARGETS ${PROJECT_NAME} ) # Install source headers. -file(GLOB_RECURSE HDRS "*.h") +file(GLOB_RECURSE HDRS "cartographer_ros/*.h") foreach(HDR ${HDRS}) file(RELATIVE_PATH REL_FIL ${PROJECT_SOURCE_DIR} ${HDR}) get_filename_component(INSTALL_DIR ${REL_FIL} DIRECTORY) diff --git a/cartographer_rviz/CMakeLists.txt b/cartographer_rviz/CMakeLists.txt index 3a31222..84c73c9 100644 --- a/cartographer_rviz/CMakeLists.txt +++ b/cartographer_rviz/CMakeLists.txt @@ -42,7 +42,7 @@ catkin_package( INCLUDE_DIRS "." ) -file(GLOB_RECURSE ALL_SRCS "*.cc" "*.h") +file(GLOB_RECURSE ALL_SRCS "cartographer_rviz/*.cc" "cartographer_rviz/*.h") set(CMAKE_AUTOMOC ON) add_library(${PROJECT_NAME} ${ALL_SRCS}) target_link_libraries(${PROJECT_NAME} PUBLIC ${QT_LIBRARIES})