2 CMAKE_MINIMUM_REQUIRED(VERSION 2.0)
3 MARK_AS_ADVANCED(CMAKE_BACKWARDS_COMPATIBILITY)
5 # The CMake version number.
6 SET(CMake_VERSION_MAJOR 2)
7 SET(CMake_VERSION_MINOR 1)
8 SET(CMake_VERSION_PATCH 0)
9 SET(CMake_VERSION "${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
10 SET(CMake_VERSION_FULL "${CMake_VERSION}.${CMake_VERSION_PATCH}")
12 SET(BUILD_SHARED_LIBS OFF)
14 SET(CMAKE_DATA_DIR "/share/CMake" CACHE STRING
15 "Install location for data (relative to prefix).")
16 SET(CMAKE_DOC_DIR "/doc/CMake" CACHE STRING
17 "Install location for documentation (relative to prefix).")
18 SET(CMAKE_MAN_DIR "/man" CACHE STRING
19 "Install location for man pages (relative to prefix).")
20 MARK_AS_ADVANCED(CMAKE_DATA_DIR CMAKE_DOC_DIR CMAKE_MAN_DIR)
22 IF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 1.4)
23 IF(CMAKE_GENERATOR MATCHES "Visual Studio 7")
24 SET(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
25 ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7")
26 IF(CMAKE_GENERATOR MATCHES "Visual Studio 6")
27 SET(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
28 ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 6")
29 INCLUDE (${CMAKE_ROOT}/Modules/CMakeBackwardCompatibilityCXX.cmake)
30 ENDIF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 1.4)
32 #silence duplicate symbol warnings on AIX
33 IF(CMAKE_SYSTEM MATCHES "AIX.*")
34 IF(NOT CMAKE_COMPILER_IS_GNUCXX)
35 SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -bhalt:5 ")
36 ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
37 ENDIF(CMAKE_SYSTEM MATCHES "AIX.*")
39 IF(CMAKE_SYSTEM MATCHES "IRIX.*")
40 IF(NOT CMAKE_COMPILER_IS_GNUCXX)
41 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-woff84 -no_auto_include")
42 SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-woff15")
43 ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
44 ENDIF(CMAKE_SYSTEM MATCHES "IRIX.*")
46 IF(CMAKE_SYSTEM MATCHES "OSF1-V.*")
47 IF(NOT CMAKE_COMPILER_IS_GNUCXX)
48 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ")
49 ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
50 ENDIF(CMAKE_SYSTEM MATCHES "OSF1-V.*")
52 #-----------------------------------------------------------------------------
53 # Create the kwsys library for CMake.
54 SET(KWSYS_NAMESPACE cmsys)
55 SET(KWSYS_USE_SystemTools 1)
56 SET(KWSYS_USE_Directory 1)
57 SET(KWSYS_USE_RegularExpression 1)
58 SET(KWSYS_USE_Base64 1)
59 SET(KWSYS_USE_Process 1)
60 SET(KWSYS_USE_CommandLineArguments 1)
61 SET(KWSYS_HEADER_ROOT ${CMake_BINARY_DIR}/Source)
64 #-----------------------------------------------------------------------------
65 # Build zlib library for Curl, CMake, and CTest.
66 SUBDIRS(Utilities/cmzlib)
67 SET(CMAKE_ZLIB_INCLUDES
68 "${CMAKE_CURRENT_BINARY_DIR}/Utilities"
70 SET(CMAKE_ZLIB_LIBRARIES "cmzlib")
71 SET(CURL_SPECIAL_LIBZ ${CMAKE_ZLIB_LIBRARIES})
72 SET(CURL_SPECIAL_LIBZ_INCLUDES ${CMAKE_ZLIB_INCLUDES})
73 SET(CURL_SPECIAL_ZLIB_H "cmzlib/zlib.h")
75 #-----------------------------------------------------------------------------
76 # Build Curl library for CTest.
77 SUBDIRS(Source/CTest/Curl)
78 SET(CMAKE_CURL_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/Source/CTest/Curl")
79 SET(CMAKE_CURL_LIBRARIES "Curl")
81 #-----------------------------------------------------------------------------
82 # Build expat library for CMake and CTest.
83 SUBDIRS(Utilities/cmexpat)
84 SET(CMAKE_EXPAT_INCLUDES
85 "${CMAKE_CURRENT_BINARY_DIR}/Utilities"
86 "${CMAKE_CURRENT_BINARY_DIR}/Utilities/cmexpat"
88 SET(CMAKE_EXPAT_LIBRARIES "cmexpat")
90 SUBDIRS(Utilities/cmxmlrpc)
91 SET(CMAKE_XMLRPC_INCLUDES
92 "${CMAKE_CURRENT_SOURCE_DIR}/Utilities/cmxmlrpc"
93 "${CMAKE_CURRENT_BINARY_DIR}/Utilities/cmxmlrpc"
95 SET(CMAKE_XMLRPC_LIBRARIES "cmXMLRPC")
98 INCLUDE (${CMake_SOURCE_DIR}/Modules/FindCurses.cmake OPTIONAL)
100 SUBDIRS(Source/CursesDialog/form)
101 ELSE (CURSES_LIBRARY)
102 MESSAGE("Curses libraries were not found. Curses GUI for CMake will not be build.")
103 ENDIF (CURSES_LIBRARY)
106 SUBDIRS(Source Modules Templates Utilities)
109 # Include the standard Dart testing module
110 #SET(DART_ROOT "" CACHE INTERNAL "" FORCE)
111 INCLUDE (${CMAKE_ROOT}/Modules/Dart.cmake)
113 # use the ansi CXX compile flag for building cmake
115 IF (CMAKE_ANSI_CXXFLAGS)
116 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}")
117 ENDIF (CMAKE_ANSI_CXXFLAGS)
119 IF (CMAKE_ANSI_CFLAGS)
120 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_ANSI_CFLAGS}")
121 ENDIF (CMAKE_ANSI_CFLAGS)
123 # add some testing dependencies
126 CONFIGURE_FILE(${CMake_SOURCE_DIR}/CMakeLogo.gif ${CMake_BINARY_DIR}/Testing/HTML/TestingResults/Icons/Logo.gif COPYONLY)
129 MARK_AS_ADVANCED(DART_ROOT)
130 MARK_AS_ADVANCED(CURL_TESTING)
132 SET(EXECUTABLE_OUTPUT_PATH ${CMake_BINARY_DIR}/bin CACHE INTERNAL
133 "Where to put the executables for CMake"
135 SET(LIBRARY_OUTPUT_PATH "" CACHE INTERNAL
136 "Where to put the libraries for CMake"
139 INCLUDE_REGULAR_EXPRESSION("^(\\.\\./)?(cm|CMake|form|ctest).*")
141 CONFIGURE_FILE(${CMake_SOURCE_DIR}/Tests/.NoDartCoverage
142 ${CMake_BINARY_DIR}/Tests/.NoDartCoverage)
143 CONFIGURE_FILE(${CMake_SOURCE_DIR}/Tests/.NoDartCoverage
144 ${CMake_BINARY_DIR}/Modules/.NoDartCoverage)
146 CONFIGURE_FILE(${CMake_SOURCE_DIR}/CTestCustom.ctest.in
147 ${CMake_BINARY_DIR}/CTestCustom.ctest @ONLY)
149 SET(CMAKE_BUILD_ON_VISUAL_STUDIO 0)
154 SET(CMAKE_BUILD_ON_VISUAL_STUDIO 1)
161 "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
162 "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
165 ADD_CUSTOM_TARGET(uninstall
166 "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")