[cmake-commits] hoffman committed CMakeLists.txt 1.112 1.113

cmake-commits at cmake.org cmake-commits at cmake.org
Fri Feb 2 14:40:26 EST 2007


Update of /cvsroot/CMake/CMake
In directory public:/mounts/ram/cvs-serv6154

Modified Files:
	CMakeLists.txt 
Log Message:
ENH: add support for cygwin source and binary packaging


Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/CMakeLists.txt,v
retrieving revision 1.112
retrieving revision 1.113
diff -u -d -r1.112 -r1.113
--- CMakeLists.txt	4 Jan 2007 15:18:09 -0000	1.112
+++ CMakeLists.txt	2 Feb 2007 19:40:24 -0000	1.113
@@ -388,9 +388,44 @@
     SET(CPACK_SOURCE_STRIP_FILES "")
     SET(CPACK_PACKAGE_EXECUTABLES "ccmake" "CMake")
   ENDIF(WIN32 AND NOT UNIX)
+# cygwin specific packaging stuff
+  IF(CYGWIN)
+    SET(CPACK_PACKAGE_NAME cmake)
+    # setup the name of the package for cygwin cmake-2.4.3
+    SET(CPACK_PACKAGE_FILE_NAME
+      "${CPACK_PACKAGE_NAME}-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}")
+    # the source has the same name as the binary
+    SET(CPACK_SOURCE_PACKAGE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME})
+    # Create a cygwin version number in case there are changes for cygwin
+    # that are not reflected upstream in CMake
+    SET(CPACK_CYGWIN_PATCH_NUMBER 1)
+    # if we are on cygwin and have cpack, then force the 
+    # doc, data and man dirs to conform to cygwin style directories
+    SET(CMAKE_DOC_DIR "/share/doc/${CPACK_PACKAGE_FILE_NAME}")
+    SET(CMAKE_DATA_DIR "/share/${CPACK_PACKAGE_FILE_NAME}")
+    SET(CMAKE_MAN_DIR "/share/man")
+    # let the user know we just forced these values
+    MESSAGE(STATUS "Setup for Cygwin packaging")
+    MESSAGE(STATUS "Override cache CMAKE_DOC_DIR = ${CMAKE_DOC_DIR}")
+    MESSAGE(STATUS "Override cache CMAKE_DATA_DIR = ${CMAKE_DATA_DIR}")
+    MESSAGE(STATUS "Override cache CMAKE_MAN_DIR = ${CMAKE_MAN_DIR}")
+    # These files are required by the cmCPackCygwinSourceGenerator and the files
+    # put into the release tar files.
+    SET(CPACK_CYGWIN_BUILD_SCRIPT 
+      "${CMake_BINARY_DIR}/@CPACK_PACKAGE_FILE_NAME at -@CPACK_CYGWIN_PATCH_NUMBER at .sh")
+    SET(CPACK_CYGWIN_PATCH_FILE 
+      "${CMake_BINARY_DIR}/@CPACK_PACKAGE_FILE_NAME at -@CPACK_CYGWIN_PATCH_NUMBER at .patch")
+    # include the sub directory for cygwin releases
+    SUBDIRS(Utilities/Release/Cygwin)
+    # when packaging source make sure the .build directory is not included
+    SET(CPACK_SOURCE_IGNORE_FILES
+      "/CVS/" "/\\\\.build/" "/\\\\.svn/" "\\\\.swp$" "\\\\.#" "/#" "~$")
+  ENDIF(CYGWIN)
+  # include CPack model once all variables are set
   INCLUDE(CPack)
 ENDIF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
 
+# configure the CTestScript.cmake file into the binary directory
 CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/Templates/CTestScript.cmake.in"
   "${CMAKE_CURRENT_BINARY_DIR}/CTestScript.cmake"
   @ONLY IMMEDIATE)



More information about the Cmake-commits mailing list