Skip to content

Commit

Permalink
Fix DDCConfig.cmake.in (#753)
Browse files Browse the repository at this point in the history
* Fix DDCConfig.cmake.in
  • Loading branch information
tpadioleau authored Jan 12, 2025
1 parent 0e6a56c commit 6819e3f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
10 changes: 6 additions & 4 deletions cmake/DDCConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,17 @@ endif()

include(${CMAKE_CURRENT_LIST_DIR}/DDCTargets.cmake)

# We always define public alias targets when impl targets are available.
foreach(target core fft pdi splines)
if(TARGET DDC::impl::ddc_${target})
if((NOT TARGET DDC::${target}) AND (TARGET DDC::impl::ddc_${target}))
add_library(DDC::${target} ALIAS DDC::impl::ddc_${target})
endif()
endforeach()

foreach(target_component fft pdi splines)
if(TARGET DDC::impl::ddc_${target_component})
set(DDC_${target_component}_FOUND TRUE)
# Components are found if the public targets exist
foreach(component ${DDC_FIND_COMPONENTS})
if(TARGET DDC::${component})
set(DDC_${component}_FOUND TRUE)
endif()
endforeach()

Expand Down
5 changes: 4 additions & 1 deletion install_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
cmake_minimum_required(VERSION 3.22)
project(test-installed-ddc LANGUAGES CXX)

find_package(DDC 0.4 REQUIRED COMPONENTS fft pdi splines)
# Test whether `find_package(DDC)` can be called multiple times
find_package(DDC 0.4 REQUIRED)
find_package(DDC 0.4 REQUIRED COMPONENTS fft)
find_package(DDC 0.4 REQUIRED COMPONENTS pdi splines)

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

0 comments on commit 6819e3f

Please sign in to comment.