Skip to content

Commit

Permalink
Updated CMake Variables for easy integration in other CMake Projects.
Browse files Browse the repository at this point in the history
Signed-off-by: Naresh Nayak <[email protected]>
  • Loading branch information
nayakned authored and SebastianSchildt committed Dec 26, 2024
1 parent eacf6ec commit ed25721
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
11 changes: 4 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,11 @@ include(CMakePackageConfigHelpers)
configure_package_config_file(
${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/Open1722Config.cmake"
INSTALL_DESTINATION "lib/cmake/Open1722"
NO_SET_AND_CHECK_MACRO
NO_CHECK_REQUIRED_COMPONENTS_MACRO)
INSTALL_DESTINATION "lib/cmake/Open1722")

write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/Open1722ConfigVersion.cmake
VERSION "${Open1722_VERSION_MAJOR}.${Open1722_VERSION_MINOR}"
VERSION "${open1722_VERSION_MAJOR}.${open1722_VERSION_MINOR}"
COMPATIBILITY AnyNewerVersion)

install(FILES
Expand All @@ -84,9 +82,8 @@ export(EXPORT Open1722Targets FILE ${CMAKE_CURRENT_BINARY_DIR}/Open1722Targets.c

include(InstallRequiredSystemLibraries)
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
set(CPACK_PACKAGE_VERSION_MAJOR "${Open1722_VERSION_MAJOR}")
set(CPACK_PACKAGE_VERSION_MINOR "${Open1722_VERSION_MINOR}")
# set(CPACK_PACKAGE_DIRECTORY "${PROJECT_BINARY_DIR}/release")
set(CPACK_PACKAGE_VERSION_MAJOR "${open1722_VERSION_MAJOR}")
set(CPACK_PACKAGE_VERSION_MINOR "${open1722_VERSION_MINOR}")
set(CPACK_GENERATOR "TGZ" "DEB")
set(CPACK_SOURCE_GENERATOR "TGZ" "DEB")

Expand Down
3 changes: 3 additions & 0 deletions Config.cmake.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
@PACKAGE_INIT@

include("${CMAKE_CURRENT_LIST_DIR}/Open1722Targets.cmake")
set(open1722_INCLUDE_DIR "@CMAKE_INSTALL_PREFIX@/include")
set(open1722_LIBRARIES "@CMAKE_INSTALL_PREFIX@/lib/libopen1722.so"
"@CMAKE_INSTALL_PREFIX@/lib/libopen1722custom.so")

0 comments on commit ed25721

Please sign in to comment.