From b2e3e6ac04ef2dabcdd6e0336e27a18b1b50bfc3 Mon Sep 17 00:00:00 2001
From: Stephane ALBERT <stephane.albert@c-s.fr>
Date: Mon, 15 Apr 2019 17:01:39 +0200
Subject: [PATCH] ENH: CI: Added CTEST_BUILD_NAME macro in CI.

---
 CI/main_superbuild.cmake    |  6 +++++-
 CI/prepare_superbuild.cmake | 11 +++++++----
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/CI/main_superbuild.cmake b/CI/main_superbuild.cmake
index b6e1c925c5..421dc23f2a 100644
--- a/CI/main_superbuild.cmake
+++ b/CI/main_superbuild.cmake
@@ -18,6 +18,8 @@
 # limitations under the License.
 #
 
+include( "${CMAKE_CURRENT_LIST_DIR}/macros.cmake" )
+
 # This script is a prototype for the future CI, it may evolve rapidly in a near future
 set (ENV{LANG} "C") # Only ascii output
 get_filename_component(OTB_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR} DIRECTORY)
@@ -98,9 +100,11 @@ endif()
 set ( CTEST_BUILD_CONFIGURATION "Release" )
 set ( CTEST_CMAKE_GENERATOR "Unix Makefiles" )
 set ( CTEST_BUILD_FLAGS "-j8" )
-set ( CTEST_BUILD_NAME "Superbuild_Build_Otb" )
 set ( CTEST_SITE "${IMAGE_NAME}" )
 
+# Find the build name and CI profile
+set_dash_build_name()
+
 # Directory variable
 set ( CTEST_SOURCE_DIRECTORY "${OTB_SOURCE_DIR}" )
 set ( CTEST_BINARY_DIRECTORY "${OTB_SOURCE_DIR}/build/" )
diff --git a/CI/prepare_superbuild.cmake b/CI/prepare_superbuild.cmake
index 95f4ed3035..780270cae5 100644
--- a/CI/prepare_superbuild.cmake
+++ b/CI/prepare_superbuild.cmake
@@ -19,6 +19,8 @@
 #
 # This script is for the superbuild build on the CI platform
 
+include( "${CMAKE_CURRENT_LIST_DIR}/macros.cmake" )
+
 set (ENV{LANG} "C") # Only ascii output
 get_filename_component(OTB_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR} DIRECTORY)
 get_filename_component(CI_PROJ_DIR ${OTB_SOURCE_DIR} DIRECTORY)
@@ -39,7 +41,10 @@ set ( PROJECT_SOURCE_DIR "${SUPERBUILD_SOURCE_DIR}" )
 set ( CTEST_SOURCE_DIRECTORY "${SUPERBUILD_SOURCE_DIR}" )
 set ( CTEST_BINARY_DIRECTORY "${OTB_SOURCE_DIR}/build/" )
 set ( CTEST_SITE "${IMAGE_NAME}" )
-set ( CTEST_BUILD_NAME "Superbuild_Build_Depends" ) # FIXME
+
+
+# Find the build name and CI profile
+set_dash_build_name()
 
 # We need a directory independent from user
 # in CI the architecture is /builds/user/otb
@@ -53,9 +58,7 @@ set (CTEST_INSTALL_DIRECTORY "${CI_ROOT_DIR}/xdk/")
 # This is needed because when using return() function ctest is trying
 # to run the CTEST_COMMAND. And we need it to not produce an error
 set (CTEST_COMMAND "echo \"Exit\"") # HACK FIX ME
-set (CMAKE_COMMAND "cmake")
-
-########################################################################
+set (CMAKE_COMMAND "cmake")########################################################################
 ########################################################################
 # Build process
 ########################################################################
-- 
GitLab