I'm running cmake tests on a experimental multi-config fastbuild generator, for test 106 TargetName:
it has a custom command COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/hello_world ${CMAKE_CURRENT_BINARY_DIR} and in test it compare two files: --test-command ${CMAKE_CMAKE_COMMAND} -E compare_files ${CMake_SOURCE_DIR}/Tests/TargetName/scripts/hello_world ${CMake_BINARY_DIR}/Tests/TargetName/scripts/hello_world) to avoid different config build overwrite output to each other,(fastbuild is strict and do not allow duplicate output) I tried to modify copy command as COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/hello_world ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/ now build successfully and files copied into different dir, but when I changed test script as : --test-command ${CMAKE_CMAKE_COMMAND} -E compare_files ${CMake_SOURCE_DIR}/Tests/TargetName/scripts/hello_world ${CMake_BINARY_DIR}/Tests/TargetName/scripts/${CMAKE_CFG_INTDIR}/hello_world) the test script will run as: /home/comicfans/working/CMake/fastbuild/bin/Release/ctest "--build-and-test" "/home/comicfans/working/CMake/Tests/TargetName" "/home/comicfans/working/CMake/fastbuild/Tests/TargetName" "--build-two-config" "--build-generator" "Fastbuild" "--build-project" "TargetName" "--build-options" "-DCMAKE_MAKE_PROGRAM:FILEPATH=/home/comicfans/working/fastbuild/tmp/x64Linux-Debug/Tools/FBuild/FBuildApp/fbuild" "--test-command" "/home/comicfans/working/CMake/fastbuild/bin/cmake" "-E" "compare_files" "/home/comicfans/working/CMake/Tests/TargetName/scripts/hello_world" "/home/comicfans/working/CMake/fastbuild/Tests/TargetName/scripts/FASTBUILD_DOLLAR_TAGConfigNameFASTBUILD_DOLLAR_TAG/hello_world" FASTBUILD_DOLLAR_TAGConfigNameFASTBUILD_DOLLAR_TAG is the place holder string of generator's GetCMakeCFGIntDir returned. so seems this variable didn't expand with build config, I wonder if this is problem of generator code(forgot to expand it in some places) , or CMAKE_CFG_INTDIR variable just didn't expanded during ctest ? and how can I makes this test script fits multi-config generator? -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers