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 Curl library for CTest.
66 SUBDIRS(Source/CTest/Curl)
67 SET(CMAKE_CURL_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/Source/CTest/Curl")
68 SET(CMAKE_CURL_LIBRARIES "Curl")
70 #-----------------------------------------------------------------------------
71 # Build expat library for CMake and CTest.
72 INCLUDE_DIRECTORIES(${CMake_BINARY_DIR}/Utilities)
73 SUBDIRS(Utilities/cmexpat Utilities/cmzlib)
74 SET(CMAKE_EXPAT_INCLUDES "${CMAKE_CURRENT_BINARY_DIR}/Utilities/cmexpat")
75 SET(CMAKE_EXPAT_LIBRARIES "cmexpat")
77 SUBDIRS(Utilities/cmxmlrpc)
78 SET(CMAKE_XMLRPC_INCLUDES
79 "${CMAKE_CURRENT_SOURCE_DIR}/Utilities/cmxmlrpc"
80 "${CMAKE_CURRENT_BINARY_DIR}/Utilities/cmxmlrpc"
82 SET(CMAKE_XMLRPC_LIBRARIES "cmXMLRPC")
85 INCLUDE (${CMake_SOURCE_DIR}/Modules/FindCurses.cmake OPTIONAL)
87 SUBDIRS(Source/CursesDialog/form)
89 MESSAGE("Curses libraries were not found. Curses GUI for CMake will not be build.")
90 ENDIF (CURSES_LIBRARY)
93 SUBDIRS(Source Modules Templates Utilities)
96 # Include the standard Dart testing module
97 #SET(DART_ROOT "" CACHE INTERNAL "" FORCE)
98 INCLUDE (${CMAKE_ROOT}/Modules/Dart.cmake)
100 # use the ansi CXX compile flag for building cmake
102 IF (CMAKE_ANSI_CXXFLAGS)
103 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}")
104 ENDIF (CMAKE_ANSI_CXXFLAGS)
106 IF (CMAKE_ANSI_CFLAGS)
107 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_ANSI_CFLAGS}")
108 ENDIF (CMAKE_ANSI_CFLAGS)
110 # add some testing dependencies
113 CONFIGURE_FILE(${CMake_SOURCE_DIR}/CMakeLogo.gif ${CMake_BINARY_DIR}/Testing/HTML/TestingResults/Icons/Logo.gif COPYONLY)
116 MARK_AS_ADVANCED(DART_ROOT)
117 MARK_AS_ADVANCED(CURL_TESTING)
119 SET(EXECUTABLE_OUTPUT_PATH ${CMake_BINARY_DIR}/bin CACHE INTERNAL
120 "Where to put the executables for CMake"
122 SET(LIBRARY_OUTPUT_PATH "" CACHE INTERNAL
123 "Where to put the libraries for CMake"
126 INCLUDE_REGULAR_EXPRESSION("^(\\.\\./)?(cm|CMake|form|ctest).*")
128 CONFIGURE_FILE(${CMake_SOURCE_DIR}/Tests/.NoDartCoverage
129 ${CMake_BINARY_DIR}/Tests/.NoDartCoverage)
130 CONFIGURE_FILE(${CMake_SOURCE_DIR}/Tests/.NoDartCoverage
131 ${CMake_BINARY_DIR}/Modules/.NoDartCoverage)
133 CONFIGURE_FILE(${CMake_SOURCE_DIR}/CTestCustom.ctest.in
134 ${CMake_BINARY_DIR}/CTestCustom.ctest @ONLY)
136 SET(CMAKE_BUILD_ON_VISUAL_STUDIO 0)
141 SET(CMAKE_BUILD_ON_VISUAL_STUDIO 1)
148 "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
149 "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
152 ADD_CUSTOM_TARGET(uninstall
153 "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")