STYLE: Nightly Version update
[cmake.git] / CMakeLists.txt
blob08c1b0dd8ec0ab5175bf00918b8afc75e54fc74a
1 PROJECT(CMake)
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)
62 SUBDIRS(Source/kwsys)
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"
81   )
82 SET(CMAKE_XMLRPC_LIBRARIES "cmXMLRPC")
84 IF (UNIX)
85   INCLUDE (${CMake_SOURCE_DIR}/Modules/FindCurses.cmake OPTIONAL)
86   IF (CURSES_LIBRARY)
87     SUBDIRS(Source/CursesDialog/form)
88   ELSE (CURSES_LIBRARY)
89     MESSAGE("Curses libraries were not found. Curses GUI for CMake will not be build.")
90   ENDIF (CURSES_LIBRARY)
91 ENDIF (UNIX)
93 SUBDIRS(Source Modules Templates Utilities)
94 ENABLE_TESTING()
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
111 IF(BUILD_TESTING)
112   IF (DART_ROOT)
113     CONFIGURE_FILE(${CMake_SOURCE_DIR}/CMakeLogo.gif ${CMake_BINARY_DIR}/Testing/HTML/TestingResults/Icons/Logo.gif COPYONLY)
114   ENDIF (DART_ROOT)
115 ENDIF(BUILD_TESTING)
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"
121   )
122 SET(LIBRARY_OUTPUT_PATH "" CACHE INTERNAL 
123   "Where to put the libraries for CMake"
124   )
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)
137 IF(WIN32)
138   IF(NOT UNIX)
139     IF(NOT BORLAND)
140       IF(NOT MINGW )
141         SET(CMAKE_BUILD_ON_VISUAL_STUDIO 1)
142       ENDIF(NOT MINGW )
143     ENDIF(NOT BORLAND)
144   ENDIF(NOT UNIX)
145 ENDIF(WIN32)
147 CONFIGURE_FILE(
148   "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
149   "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
150   IMMEDIATE @ONLY)
152 ADD_CUSTOM_TARGET(uninstall
153   "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")