Browse Source

COMP: At superbuild level, the build of CTK is always triggered.

There are now two targets:
  1) CTK-build:

     "make" or "make CTK-build"  will update all external projects and re-build CTK

  2) CTK-build-only

     "make CTK-build-only" will only attempt to re-build CTK without updating the external projects
Jean-Christophe Fillion-Robin 15 years ago
parent
commit
a55f330e6c
1 changed files with 21 additions and 15 deletions
  1. 21 15
      SuperBuild.cmake

+ 21 - 15
SuperBuild.cmake

@@ -216,29 +216,35 @@ ExternalProject_Add(${proj}
   DEPENDS
     "CTK-Utilities"
   )
-
-
+  
 #-----------------------------------------------------------------------------
 # CTK
 #
 #MESSAGE(STATUS SUPERBUILD_EXCLUDE_CTKBUILD_TARGET:${SUPERBUILD_EXCLUDE_CTKBUILD_TARGET})
 IF(NOT DEFINED SUPERBUILD_EXCLUDE_CTKBUILD_TARGET OR NOT SUPERBUILD_EXCLUDE_CTKBUILD_TARGET)
-  SET(proj CTK-build)
-  ExternalProject_Add(${proj}
-    DOWNLOAD_COMMAND ""
-    CMAKE_GENERATOR ${gen}
-    SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}
-    BINARY_DIR CTK-build
-    INSTALL_COMMAND ""
-    DEPENDS
-      "CTK-Configure"
-    )
+#   SET(proj CTK-build)
+#   ExternalProject_Add(${proj}
+#     DOWNLOAD_COMMAND ""
+#     CMAKE_GENERATOR ${gen}
+#     SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}
+#     BINARY_DIR CTK-build
+#     INSTALL_COMMAND ""
+#     DEPENDS
+#       "CTK-Configure"
+#     )
+  ADD_CUSTOM_TARGET(CTK-build ALL
+    COMMAND ${CMAKE_COMMAND} -G "${gen}" --build ${CMAKE_CURRENT_BINARY_DIR}/CTK-build
+    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CTK-build
+    COMMENT "Now building CTK ..."
+  )
+  ADD_DEPENDENCIES(CTK-build CTK-Configure)
 ENDIF()
 
 #-----------------------------------------------------------------------------
-# Custom target allowing to drive the build of CTK project itself
+# Custom target allowing to drive the build of CTK project itself without superbuild
 #
-ADD_CUSTOM_TARGET(CTK
-  COMMAND ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR}/CTK-build
+ADD_CUSTOM_TARGET(CTK-build-only
+  COMMAND ${CMAKE_COMMAND} -G "${gen}" --build ${CMAKE_CURRENT_BINARY_DIR}/CTK-build
   WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CTK-build
+  COMMENT "Now building CTK ..."
   )