|
|
@@ -1,5 +1,9 @@
|
|
|
set(CVSROOT ":pserver:[email protected]:/cvsroot/CMake")
|
|
|
-# used for -j builds
|
|
|
+get_filename_component(SCRIPT_PATH "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
|
|
+
|
|
|
+if(NOT DEFINED INSTALLER_SUFFIX)
|
|
|
+ set(INSTALLER_SUFFIX "*.sh")
|
|
|
+endif(NOT DEFINED INSTALLER_SUFFIX)
|
|
|
if(NOT DEFINED PROCESSORS)
|
|
|
set(PROCESSORS 1)
|
|
|
endif(NOT DEFINED PROCESSORS)
|
|
|
@@ -23,7 +27,6 @@ macro(remote_command comment command)
|
|
|
else(${ARGC} GREATER 2)
|
|
|
execute_process(COMMAND ssh ${HOST} ${command} RESULT_VARIABLE result)
|
|
|
endif(${ARGC} GREATER 2)
|
|
|
- message("${result}")
|
|
|
if(${result} GREATER 0)
|
|
|
message(FATAL_ERROR "Error running command: ${command}, return value = ${result}")
|
|
|
endif(${result} GREATER 0)
|
|
|
@@ -33,18 +36,30 @@ endmacro(remote_command)
|
|
|
remote_command(
|
|
|
"remove and create working directory ~/CMakeReleaseDirectory"
|
|
|
"rm -rf ~/CMakeReleaseDirectory && mkdir ~/CMakeReleaseDirectory")
|
|
|
+# create user make rule file
|
|
|
+if(DEFINED USER_MAKE_RULE_FILE_CONTENTS)
|
|
|
+ remote_command("Create ${USER_MAKE_RULE_FILE}"
|
|
|
+ "echo ${USER_MAKE_RULE_FILE_CONTENTS} > ${USER_MAKE_RULE_FILE}" )
|
|
|
+endif(DEFINED USER_MAKE_RULE_FILE_CONTENTS)
|
|
|
+
|
|
|
+# create the build directory
|
|
|
+remote_command(
|
|
|
+ "Create a directory to build in"
|
|
|
+ "rm -rf ~/CMakeReleaseDirectory/${CMAKE_VERSION}-build && mkdir ~/CMakeReleaseDirectory/${CMAKE_VERSION}-build")
|
|
|
+# set the initial cache
|
|
|
+if(DEFINED INITIAL_CACHE)
|
|
|
+ remote_command("Create ${USER_MAKE_RULE_FILE}"
|
|
|
+ "echo \"${INITIAL_CACHE}\" > ~/CMakeReleaseDirectory/${CMAKE_VERSION}-build/CMakeCache.txt" )
|
|
|
+endif(DEFINED INITIAL_CACHE)
|
|
|
+
|
|
|
# login to cvs
|
|
|
remote_command(
|
|
|
"Login into cvs."
|
|
|
- "cvs -d ${CVSROOT} login" cmake_login)
|
|
|
+ "cvs -d ${CVSROOT} login" "${SCRIPT_PATH}/cmake_login")
|
|
|
# checkout the source
|
|
|
remote_command(
|
|
|
"Checkout the source for ${CMAKE_VERSION}"
|
|
|
"cd ~/CMakeReleaseDirectory && cvs -q -z3 -d ${CVSROOT} export -r ${CMAKE_VERSION} -d ${CMAKE_VERSION} CMake")
|
|
|
-# create the build directory
|
|
|
-remote_command(
|
|
|
- "Create a directory to build in"
|
|
|
- "rm -rf ~/CMakeReleaseDirectory/${CMAKE_VERSION}-build && mkdir ~/CMakeReleaseDirectory/${CMAKE_VERSION}-build")
|
|
|
# now bootstrap cmake
|
|
|
remote_command(
|
|
|
"Run cmake bootstrap --parallel=${PROCESSORS}"
|
|
|
@@ -61,6 +76,7 @@ remote_command(
|
|
|
remote_command(
|
|
|
"Run cmake tests"
|
|
|
"cd ~/CMakeReleaseDirectory/${CMAKE_VERSION}-build && ${MAKE} test")
|
|
|
+
|
|
|
# package cmake with self-extracting shell script
|
|
|
remote_command(
|
|
|
"Package cmake"
|
|
|
@@ -69,10 +85,9 @@ remote_command(
|
|
|
remote_command(
|
|
|
"Package cmake"
|
|
|
"cd ~/CMakeReleaseDirectory/${CMAKE_VERSION}-build && ./bin/cpack -G TGZ")
|
|
|
-
|
|
|
message("copy the .gz file back from the machine")
|
|
|
execute_process(COMMAND scp ${HOST}:CMakeReleaseDirectory/${CMAKE_VERSION}-build/*.gz .
|
|
|
RESULT_VARIABLE result)
|
|
|
-message("copy the .sh file back from the machine")
|
|
|
-execute_process(COMMAND scp ${HOST}:CMakeReleaseDirectory/${CMAKE_VERSION}-build/*.sh .
|
|
|
+message("copy the ${INSTALLER_SUFFIX} file back from the machine")
|
|
|
+execute_process(COMMAND scp ${HOST}:CMakeReleaseDirectory/${CMAKE_VERSION}-build/${INSTALLER_SUFFIX} .
|
|
|
RESULT_VARIABLE result)
|