Skip to content

Commit

Permalink
Add missing DDCConfigVersion (#673)
Browse files Browse the repository at this point in the history
* Add missing DDCConfigVersion with SameMinorVersion compatibility

* Review from cedricchevalier19
  • Loading branch information
tpadioleau authored Nov 8, 2024
1 parent 811dfc1 commit b627993
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
16 changes: 15 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -290,4 +290,18 @@ configure_package_config_file(
INSTALL_DESTINATION lib/cmake/DDC
)

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/DDCConfig.cmake DESTINATION lib/cmake/DDC)
# We use SameMinorVersion until major version 1
if(PROJECT_VERSION VERSION_GREATER_EQUAL 1)
message(FATAL_ERROR "DDC must switch COMPATIBILITY mode to SameMajorVersion")
endif()
write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/DDCConfigVersion.cmake
COMPATIBILITY SameMinorVersion
)

install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/DDCConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/DDCConfigVersion.cmake
DESTINATION lib/cmake/DDC
)
2 changes: 1 addition & 1 deletion install_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
cmake_minimum_required(VERSION 3.22)
project(test-installed-ddc LANGUAGES CXX)

find_package(DDC REQUIRED COMPONENTS fft pdi splines)
find_package(DDC 0.1 REQUIRED COMPONENTS fft pdi splines)

message("DDC options:")
message("DDC_BUILD_DOUBLE_PRECISION=${DDC_BUILD_DOUBLE_PRECISION}")
Expand Down

0 comments on commit b627993

Please sign in to comment.