Skip to content

Commit 0229b2f

Browse files
committed
Get REQUIRED COMPONENTS back in find_package
1 parent 5a0a1c9 commit 0229b2f

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

test/CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,13 @@ project(test_findFFTW NONE)
44
# Add the parent directory (repo root) to the module path so CMake can find FindFFTW.cmake
55
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/..")
66

7-
# Call find_package with the assembled arguments
8-
find_package(FFTW ${FFTW_TEST_VERSION} REQUIRED ${FFTW_TEST_COMPONENTS})
7+
# Find FFTW. If FFTW_TEST_COMPONENTS is given (semicolon-separated list), those
8+
# components are required; otherwise we just require that FFTW itself is found.
9+
if(FFTW_TEST_COMPONENTS)
10+
find_package(FFTW ${FFTW_TEST_VERSION} REQUIRED COMPONENTS ${FFTW_TEST_COMPONENTS})
11+
else()
12+
find_package(FFTW ${FFTW_TEST_VERSION} REQUIRED)
13+
endif()
914

1015
# ---------------------------------------------------------------------------
1116
# Check that the basic variables are set

0 commit comments

Comments
 (0)