Skip to content

Commit

Permalink
Install a config version file
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisThrasher committed Aug 22, 2023
1 parent 81d6b38 commit 0fbf42c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ if(BUILD_TESTING)
add_subdirectory(tests)
endif()

include(CMakePackageConfigHelpers)

install(
DIRECTORY include/
DESTINATION include/rsl
Expand All @@ -52,8 +54,9 @@ install(
NAMESPACE rsl::
DESTINATION share/rsl/cmake
)
write_basic_package_version_file(rsl-config-version.cmake COMPATIBILITY SameMajorVersion)
install(
FILES cmake/rsl-config.cmake
FILES cmake/rsl-config.cmake ${PROJECT_BINARY_DIR}/rsl-config-version.cmake
DESTINATION share/rsl/cmake
)

Expand Down
2 changes: 1 addition & 1 deletion tests/install/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.22)
project(rsl-install-test)

if(PROJECT_IS_TOP_LEVEL)
find_package(rsl REQUIRED)
find_package(rsl 0.2.1 EXACT REQUIRED)
endif()

add_executable(test-rsl-install install.cpp)
Expand Down

0 comments on commit 0fbf42c

Please sign in to comment.