this code is not working currently(not deactivating the download step), if provided non empty string, it does treat it as the download command
set(FRESH_DOWNLOAD off CACHE BOOL "download a fresh copy of all dependencies")
include(ExternalProject)
if (NOT FRESH_DOWNLOAD)
# Define the variable to disable DOWNLOAD step
set(civ_DOWNLOAD DOWNLOAD_COMMAND "")
else()
# Define an empty variable.
# This actually can be omitted since absent variable is treated as empty.
set(civ_DOWNLOAD)
endif()
ExternalProject_Add(civ
SOURCE_DIR ${PROJECT_SOURCE_DIR}/test
BUILD_COMMAND ${MAKE_EXE}
BINARY_DIR "./bin"
INSTALL_COMMAND ""
GIT_REPOSITORY "https://github.com/test/test"
GIT_TAG "v1.0"
${civ_DOWNLOAD} # IMPORTANT: Do not use double quotes here.
CMAKE_ARGS
"-DTuberosumTools_DIR=${TUBEROSUMTOOLS_DIR}"
)
Passing empty strings is tough. For simplicity, I would recommend using a command of something like true (for Unix) or a similar command on Windows. It has a similar effect, but you don’t have to fight argument quoting rules.
Thanks, that is my currently solution, except i need the code to be crossplatform, so instead of "true" i am trying to use something like "cd .", but i am really new to cmake, and not sure how to write it cause that way is not executed exactly like that, my guess is that cmake adds arguments. I am also new to bash and windows cmd so, no idea what alternative could use.
EDIT: i am using dir right now, not the best aproach though.