Skip to content

Commit

Permalink
Merge pull request #90 from mwoehlke-kitware/coretypes-interface-library
Browse files Browse the repository at this point in the history
Create header-only link target lcm-coretypes
  • Loading branch information
ashuang authored Jul 22, 2016
2 parents f3aae71 + 798e0a3 commit 2cb8e16
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions lcm-cmake/install.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ write_basic_package_version_file(

# Exported targets for build directory
export(TARGETS
lcm-coretypes
lcm
lcm-gen
FILE ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake
Expand Down
6 changes: 5 additions & 1 deletion lcm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ if(WIN32)
)
endif()

add_library(lcm-coretypes INTERFACE)
add_library(lcm ${lcm_sources})

target_compile_definitions(lcm PRIVATE
Expand All @@ -48,6 +49,9 @@ set_target_properties(lcm PROPERTIES
PUBLIC_HEADER "${lcm_install_headers}"
)

target_include_directories(lcm-coretypes INTERFACE
$<BUILD_INTERFACE:${lcm_SOURCE_DIR}>
)
target_include_directories(lcm INTERFACE
$<BUILD_INTERFACE:${lcm_SOURCE_DIR}>
)
Expand All @@ -58,7 +62,7 @@ target_link_libraries(lcm PRIVATE
${CMAKE_THREAD_LIBS_INIT}
)

install(TARGETS lcm
install(TARGETS lcm-coretypes lcm
EXPORT lcmTargets
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib${LIB_SUFFIX}
Expand Down

0 comments on commit 2cb8e16

Please sign in to comment.