From bd6d6e983ea2333f97b142fdeb45033bbe2ce966 Mon Sep 17 00:00:00 2001 From: Kai Germaschewski Date: Sat, 26 Sep 2020 13:41:42 -0400 Subject: [PATCH] cmake/install: mv ThrustAddSubdir handling to after project() We want to add the option to install in this case, which requires the paths set by project() --- CMakeLists.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 11e6711dd..ac8d15058 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,10 +1,3 @@ -# Support adding Thrust to a parent project via add_subdirectory. -# See examples/cmake/add_subdir/CMakeLists.txt for details. -if (NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_LIST_DIR}") - include(cmake/ThrustAddSubdir.cmake) - return() -endif() - # 3.15 is the minimum. # 3.17 for nvc++/Feta # 3.18 for C++17 + CUDA @@ -18,6 +11,13 @@ endif() project(Thrust NONE) +# Support adding Thrust to a parent project via add_subdirectory. +# See examples/cmake/add_subdir/CMakeLists.txt for details. +if (NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_LIST_DIR}") + include(cmake/ThrustAddSubdir.cmake) + return() +endif() + include(cmake/AppendOptionIfAvailable.cmake) include(cmake/ThrustBuildCompilerTargets.cmake)