浏览代码

Merge branch 'superbuild-force-build'

* superbuild-force-build:
  Fixed outdated builds on VS2012
Jean-Christophe Fillion-Robin 10 年之前
父节点
当前提交
9e5af26f1f
共有 1 个文件被更改,包括 12 次插入2 次删除
  1. 12 2
      SuperBuild.cmake

+ 12 - 2
SuperBuild.cmake

@@ -55,9 +55,19 @@ ExternalProject_Add(${proj}
 
 
 # This custom external project step forces the build and later
 # This custom external project step forces the build and later
 # steps to run whenever a top level build is done...
 # steps to run whenever a top level build is done...
+#
+# BUILD_ALWAYS flag is available in CMake 3.1 that allows force build
+# of external projects without this workaround. Remove this workaround
+# and use the CMake flag instead, when CTK's required minimum CMake
+# version will be at least 3.1.
+#
+if(CMAKE_CONFIGURATION_TYPES)
+  set(BUILD_STAMP_FILE "${CMAKE_CURRENT_BINARY_DIR}/${proj}-prefix/src/${proj}-stamp/${CMAKE_CFG_INTDIR}/${proj}-build")
+else()
+  set(BUILD_STAMP_FILE "${CMAKE_CURRENT_BINARY_DIR}/${proj}-prefix/src/${proj}-stamp/${proj}-build")
+endif()
 ExternalProject_Add_Step(${proj} forcebuild
 ExternalProject_Add_Step(${proj} forcebuild
-  COMMAND ${CMAKE_COMMAND} -E remove
-    ${CMAKE_CURRENT_BINARY_DIR}/${proj}-prefix/src/${proj}-stamp/${proj}-build
+  COMMAND ${CMAKE_COMMAND} -E remove ${BUILD_STAMP_FILE}
   COMMENT "Forcing build step for '${proj}'"
   COMMENT "Forcing build step for '${proj}'"
   DEPENDEES build
   DEPENDEES build
   ALWAYS 1
   ALWAYS 1