Skip to content

Commit b2078e2

Browse files
committed
initialize CPM and fetch icm only when they are needed
1 parent 792e134 commit b2078e2

1 file changed

Lines changed: 30 additions & 25 deletions

File tree

‎CMakeLists.txt‎

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,12 @@ endif()
106106
# * Dependencies -------------------------------------------------------------
107107

108108
# Initialize CPM
109-
rapids_cpm_init(OVERRIDE ${CMAKE_CURRENT_SOURCE_DIR}/cmake/versions.json)
109+
if(STDEXEC_BUILD_TESTS
110+
OR STDEXEC_ENABLE_ASIO
111+
OR STDEXEC_ENABLE_TASKFLOW
112+
OR STDEXEC_ENABLE_CUDA)
113+
rapids_cpm_init(OVERRIDE ${CMAKE_CURRENT_SOURCE_DIR}/cmake/versions.json)
114+
endif()
110115

111116
if(STDEXEC_BUILD_TESTS)
112117
# Add Catch2
@@ -126,31 +131,31 @@ if(STDEXEC_BUILD_TESTS)
126131
OPTIONS
127132
"CMAKE_CXX_STANDARD 20"
128133
"CATCH_CONFIG_NO_POSIX_SIGNALS ON")
129-
endif()
130134

131-
# Add ICM
132-
set(icm_VERSION 1.5.0)
133-
# Always download it, don't attempt to do `find_package(ICM)` first
134-
set(CPM_DOWNLOAD_icm TRUE)
135-
rapids_cpm_find(
136-
icm
137-
${icm_VERSION}
138-
CPM_ARGS
139-
GITHUB_REPOSITORY
140-
iboB/icm
141-
GIT_TAG
142-
v${icm_VERSION}
143-
VERSION
144-
${icm_VERSION}
145-
PATCH_COMMAND
146-
git
147-
restore
148-
--
149-
.
150-
&&
151-
git
152-
apply
153-
${CMAKE_CURRENT_LIST_DIR}/cmake/cpm/patches/icm/regex-build-error.diff)
135+
# Add ICM
136+
set(icm_VERSION 1.5.0)
137+
# Always download it, don't attempt to do `find_package(ICM)` first
138+
set(CPM_DOWNLOAD_icm TRUE)
139+
rapids_cpm_find(
140+
icm
141+
${icm_VERSION}
142+
CPM_ARGS
143+
GITHUB_REPOSITORY
144+
iboB/icm
145+
GIT_TAG
146+
v${icm_VERSION}
147+
VERSION
148+
${icm_VERSION}
149+
PATCH_COMMAND
150+
git
151+
restore
152+
--
153+
.
154+
&&
155+
git
156+
apply
157+
${CMAKE_CURRENT_LIST_DIR}/cmake/cpm/patches/icm/regex-build-error.diff)
158+
endif()
154159

155160
# Ensure that we link with the threading library
156161
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)

0 commit comments

Comments
 (0)