Skip to content

Commit

Permalink
cmake: cpack: Fix package definitions
Browse files Browse the repository at this point in the history
Signed-off-by: Siddharth Chandrasekaran <[email protected]>
  • Loading branch information
sidcha committed Mar 22, 2024
1 parent cac0963 commit 562565a
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 9 deletions.
20 changes: 16 additions & 4 deletions cmake/CreatePackages.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,18 @@ set(SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_HOST_SYSTEM_PROCESSOR})
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PACKAGE_NAME}.src")
set(CPACK_SOURCE_GENERATOR "TGZ")
set(CPACK_SOURCE_IGNORE_FILES
/.git/
/.github/
/build*
.git/
.github/
.vscode/
.venv/
.pytest_cache
build/
tags
__pycache__/
/_config.yml
/python/dist/
/python/libosdp.egg-info/
/python/vendor/
)

# Binaries
Expand All @@ -38,7 +46,11 @@ set(CPACK_PACKAGE_FILE_NAME "${PACKAGE_NAME}-${SYSTEM_NAME}")
include(CPackComponent)
cpack_add_component(distributables
DISPLAY_NAME ${PROJECT_NAME}
DESCRIPTION "Distributables (Libaray, Binaries, Headers, etc.,)"
DESCRIPTION "Distributables (shared/static libararies, binaries, etc.,)"
)
cpack_add_component(distributables
DISPLAY_NAME ${PROJECT_NAME}
DESCRIPTION "Development headers"
)
cpack_add_component(config_files
DISPLAY_NAME ${PROJECT_NAME}
Expand Down
17 changes: 12 additions & 5 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ list(APPEND LIB_OSDP_UTILS_SRC
list(APPEND LIB_OSDP_HEADERS
${PROJECT_SOURCE_DIR}/include/osdp.h
${PROJECT_SOURCE_DIR}/include/osdp.hpp
${CMAKE_CURRENT_BINARY_DIR}/osdp_export.h
${PROJECT_BINARY_DIR}/include/osdp_export.h
)

# These variables are used in other parts of this projects for rebuilding
Expand Down Expand Up @@ -222,11 +222,16 @@ endif()

install(
TARGETS ${LIB_OSDP_SHARED}
COMPONENT distributables
EXPORT LibOSDPTargets
LIBRARY DESTINATION ${LIBOSDP_LIBRARY_DIR}
ARCHIVE DESTINATION ${LIBOSDP_LIBRARY_DIR}
PUBLIC_HEADER DESTINATION include/libosdp
LIBRARY
COMPONENT distributables
DESTINATION ${LIBOSDP_LIBRARY_DIR}
ARCHIVE
COMPONENT distributables
DESTINATION ${LIBOSDP_LIBRARY_DIR}
PUBLIC_HEADER
COMPONENT headers
DESTINATION include/libosdp
)

endif() # CONFIG_BUILD_SHARED
Expand Down Expand Up @@ -261,6 +266,7 @@ install(EXPORT LibOSDPTargets
FILE LibOSDPTargets.cmake
NAMESPACE libosdp::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libosdp
COMPONENT config_files
)
configure_package_config_file(
${PROJECT_SOURCE_DIR}/cmake/LibOSDPConfig.cmake.in
Expand All @@ -277,4 +283,5 @@ install(FILES
"${CMAKE_BINARY_DIR}/LibOSDPConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/LibOSDPConfigVersion.cmake"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libosdp
COMPONENT config_files
)

0 comments on commit 562565a

Please sign in to comment.