diff --git a/lib/pls/CMakeLists.txt b/lib/pls/CMakeLists.txt index 83d7e1a..078f698 100644 --- a/lib/pls/CMakeLists.txt +++ b/lib/pls/CMakeLists.txt @@ -32,18 +32,30 @@ target_link_libraries(pls # Rules for istalling the library on a system # ...binaries -install(TARGETS pls +INSTALL(TARGETS pls + EXPORT pls-targets LIBRARY - DESTINATION lib + DESTINATION lib/pls ARCHIVE - DESTINATION lib + DESTINATION lib/pls ) # ...all headers in `include` -INSTALL ( - DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ +INSTALL( + DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/pls DESTINATION include FILES_MATCHING PATTERN "*.h*" ) +# ...allow our project to be a cmake dependency +install( + EXPORT pls-targets + FILE plsTargets.cmake + NAMESPACE pls:: + DESTINATION lib/pls +) +INSTALl( + FILES pls-config.cmake + DESTINATION lib/pls +) # Enable warnings/tidy code checking from our compiler target_compile_options(pls PRIVATE diff --git a/lib/pls/pls-config.cmake b/lib/pls/pls-config.cmake new file mode 100644 index 0000000..25d3a1f --- /dev/null +++ b/lib/pls/pls-config.cmake @@ -0,0 +1,2 @@ +get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) +include(${SELF_DIR}/plsTargets.cmake)