Skip to content

Commit 97023e8

Browse files
authored
fix: do not generate module files with DOWNLOAD_ONLY (#654)
Co-authored-by: Avus <[email protected]>
1 parent 0f23108 commit 97023e8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cmake/CPM.cmake

+3-1
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,9 @@ function(CPMAddPackage)
867867
endif()
868868
endif()
869869

870-
cpm_create_module_file(${CPM_ARGS_NAME} "CPMAddPackage(\"${ARGN}\")")
870+
if(NOT "${DOWNLOAD_ONLY}")
871+
cpm_create_module_file(${CPM_ARGS_NAME} "CPMAddPackage(\"${ARGN}\")")
872+
endif()
871873

872874
if(CPM_PACKAGE_LOCK_ENABLED)
873875
if((CPM_ARGS_VERSION AND NOT CPM_ARGS_SOURCE_DIR) OR CPM_INCLUDE_ALL_IN_PACKAGE_LOCK)

0 commit comments

Comments
 (0)