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.master
parent
d0871210e7
commit
c493369594
|
@ -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)
|
||||
|
|
|
@ -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})
|
||||
|
|
Loading…
Reference in New Issue