Skip to content

Commit e7903d4

Browse files
committed
fix: Ensure inner project is always re-configured
Function `cpd_ExternalProject_AlwaysConfigure` copied from `ExternalProjectDependency.cmake` (commontk/Artichoke@613e3739a)
1 parent b18a3b7 commit e7903d4

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

CMakeLists.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,20 @@ if(CMakePythonDistributions_SUPERBUILD)
109109
)
110110
endfunction()
111111

112+
# Add an external project step named `forceconfigure` to `project_name` ensuring
113+
# the project will always be reconfigured.
114+
#
115+
# Copied from ExternalProjectDependency.cmake (commontk/Artichoke@613e3739a)
116+
function(cpd_ExternalProject_AlwaysConfigure proj)
117+
_ep_get_step_stampfile(${proj} "configure" stampfile)
118+
ExternalProject_Add_Step(${proj} forceconfigure
119+
COMMAND ${CMAKE_COMMAND} -E remove ${stampfile}
120+
COMMENT "Forcing configure step for '${proj}'"
121+
DEPENDEES build
122+
ALWAYS 1
123+
)
124+
endfunction()
125+
112126
# Note: To minimize confusion between variables defined by CMake and
113127
# variables used in this project. The following convention applies:
114128
# CMakeProject_xxx : Variables defined in this project
@@ -376,6 +390,8 @@ set(CMAKE_EXE_LINKER_FLAGS \"-lstdc++ -lgcc -lrt\" CACHE STRING \"Initial cache\
376390
)
377391
message(STATUS "SuperBuild - ${PROJECT_NAME}")
378392

393+
cpd_ExternalProject_AlwaysConfigure(${PROJECT_NAME})
394+
379395
# This adds an "install" target in the top-level directory. The
380396
# target will simply include the install rules associated with the
381397
# inner build

0 commit comments

Comments
 (0)