[CMake] BUG?: ExternalProject_add with CMAKE_COMMAND and Re-run cmake

Xavier Lacoste xl64100 at gmail.com
Tue Mar 12 10:44:23 EDT 2019


Hello,

I use External_project and set up a cmake subproject that uses au specific CMAKE_COMMAND (a wrapper that does export environment variables)
This wrapper is correctly called on first configure but not if CMake decides to rerun CMake at build step.

[ 45%] Performing build step for 'lap_project'
cd /appli_RD/LACOSTE/OMEGA/cmakesuperbuild/build-gnu-debug/lap/build-debug && /appli_RD/LACOSTE/OMEGA/cmakesuperbuild/build-gnu-debug/make_wrapper_lap.sh
gmake[3]: entrant dans le répertoire « /appli_RD/LACOSTE/OMEGA/cmakesuperbuild/build-gnu-debug/lap/build-debug »
/appli_MTS/SIP/devtools/cmake/3.8.2/x86_64/Linux/SUSE11.3/bin/cmake -H/appli_RD/LACOSTE/OMEGA/cmakesuperbuild/lap -B/appli_RD/LACOSTE/OMEGA/cmakesuperbuild/build-gnu-debug/lap/build-debug --check-build-system CMakeFiles/Makefile.cmake 0
Re-run cmake file: Makefile older than: /appli_RD/LACOSTE/OMEGA/cmakesuperbuild/lap/test/CMakeLists.txt

My only workaround is to rm the project subdirectory and rerun make (in that case the wrapper is used):
[ 50%] Performing configure step for 'lap_project'
cd /appli_RD/LACOSTE/OMEGA/cmakesuperbuild/build-gnu-debug/lap/build-debug && /appli_RD/LACOSTE/OMEGA/cmakesuperbuild/build-gnu-debug/cmake_wrapper_lap.sh

I tried passing -DCMAKE_COMMAND=mywrapper.sh but it only raise a warning saying that this variable was not used by the project.

IMHO it’s a but in ExternalProject_add(). Correct ?

Any advice or help is welcome.

Regards,

XL.


More information about the CMake mailing list