Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test find_package(DDC) bug #753

Merged
merged 2 commits into from
Jan 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading