CMakeLists.txt 4.3 KB
Newer Older
Ken Martin's avatar
Ken Martin committed
1
PROJECT(CMake)
Bill Hoffman's avatar
Bill Hoffman committed
2
CMAKE_MINIMUM_REQUIRED(VERSION 2.0)
Ken Martin's avatar
Ken Martin committed
3
MARK_AS_ADVANCED(CMAKE_BACKWARDS_COMPATIBILITY)
Ken Martin's avatar
Ken Martin committed
4

5
# The CMake version number.
6
7
SET(CMake_VERSION_MAJOR 2)
SET(CMake_VERSION_MINOR 1)
8
SET(CMake_VERSION_PATCH 0)
9
10
SET(CMake_VERSION "${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
SET(CMake_VERSION_FULL "${CMake_VERSION}.${CMake_VERSION_PATCH}")
11

12
13
14
15
16
17
18
19
SET(CMAKE_DATA_DIR "/share/CMake" CACHE STRING 
  "Install location for data (relative to prefix).")
SET(CMAKE_DOC_DIR "/doc/CMake" CACHE STRING
  "Install location for documentation (relative to prefix).")
SET(CMAKE_MAN_DIR "/man" CACHE STRING
  "Install location for man pages (relative to prefix).")
MARK_AS_ADVANCED(CMAKE_DATA_DIR CMAKE_DOC_DIR CMAKE_MAN_DIR)

20
21
22
23
24
25
26
27
28
29
IF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 1.4)
  IF(CMAKE_GENERATOR MATCHES "Visual Studio 7")
    SET(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
  ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7")
  IF(CMAKE_GENERATOR MATCHES "Visual Studio 6")
    SET(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
  ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 6")
  INCLUDE (${CMAKE_ROOT}/Modules/CMakeBackwardCompatibilityCXX.cmake)
ENDIF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 1.4)

30
31
32
#silence duplicate symbol warnings on AIX
IF(CMAKE_SYSTEM MATCHES "AIX.*")
  IF(NOT CMAKE_COMPILER_IS_GNUCXX)
Andy Cedilnik's avatar
Andy Cedilnik committed
33
    SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -bhalt:5 ")
34
35
36
  ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
ENDIF(CMAKE_SYSTEM MATCHES "AIX.*")

37
38
IF(CMAKE_SYSTEM MATCHES "IRIX.*")
  IF(NOT CMAKE_COMPILER_IS_GNUCXX)
39
40
    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-woff84 -no_auto_include")
    SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-woff15")
41
42
43
  ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
ENDIF(CMAKE_SYSTEM MATCHES "IRIX.*")

44
45
IF(CMAKE_SYSTEM MATCHES "OSF1-V.*")
  IF(NOT CMAKE_COMPILER_IS_GNUCXX)
Andy Cedilnik's avatar
Andy Cedilnik committed
46
    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ")
47
48
  ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
ENDIF(CMAKE_SYSTEM MATCHES "OSF1-V.*")
Brad King's avatar
Brad King committed
49
50
51
52
53
54

#-----------------------------------------------------------------------------
# Create the kwsys library for CMake.
SET(KWSYS_NAMESPACE cmsys)
SET(KWSYS_USE_SystemTools 1)
SET(KWSYS_USE_Directory 1)
55
SET(KWSYS_USE_RegularExpression 1)
Andy Cedilnik's avatar
Andy Cedilnik committed
56
SET(KWSYS_USE_Base64 1)
57
SET(KWSYS_USE_Process 1)
Brad King's avatar
Brad King committed
58
59
60
SET(KWSYS_HEADER_ROOT ${CMake_BINARY_DIR}/Source)
SUBDIRS(Source/kwsys)

61
62
#-----------------------------------------------------------------------------
# Build Curl library for CTest.
63
64
65
SET(CMAKE_BUILD_WITH_CURL 1)
SUBDIRS(Source/CTest/Curl)

66
67
68
69
70
#-----------------------------------------------------------------------------
# Build expat library for CMake and CTest.
INCLUDE_DIRECTORIES(${CMake_BINARY_DIR}/Utilities)
SUBDIRS(Utilities/cmexpat)

71
72
73
74
IF (UNIX)
  INCLUDE (${CMake_SOURCE_DIR}/Modules/FindCurses.cmake OPTIONAL)
  IF (CURSES_LIBRARY)
    SUBDIRS(Source/CursesDialog/form)
75
76
  ELSE (CURSES_LIBRARY)
    MESSAGE("Curses libraries were not found. Curses GUI for CMake will not be build.")
77
78
79
  ENDIF (CURSES_LIBRARY)
ENDIF (UNIX)

Sebastien Barre's avatar
Sebastien Barre committed
80
SUBDIRS(Source Modules Templates Utilities)
Bill Hoffman's avatar
Bill Hoffman committed
81
ENABLE_TESTING()
Ken Martin's avatar
Ken Martin committed
82
83

# Include the standard Dart testing module
84
INCLUDE (${CMAKE_ROOT}/Modules/Dart.cmake)
Ken Martin's avatar
Ken Martin committed
85

Bill Hoffman's avatar
Bill Hoffman committed
86
# use the ansi CXX compile flag for building cmake
87

Ken Martin's avatar
Ken Martin committed
88
89
90
IF (CMAKE_ANSI_CXXFLAGS)
  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}")  
ENDIF (CMAKE_ANSI_CXXFLAGS)
91
92
93
94
95

IF (CMAKE_ANSI_CFLAGS)
  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_ANSI_CFLAGS}")  
ENDIF (CMAKE_ANSI_CFLAGS)

Ken Martin's avatar
Ken Martin committed
96
97
98
# add some testing dependencies
IF(BUILD_TESTING)
  IF (DART_ROOT)
99
    CONFIGURE_FILE(${CMake_SOURCE_DIR}/CMakeLogo.gif ${CMake_BINARY_DIR}/Testing/HTML/TestingResults/Icons/Logo.gif COPYONLY)
Ken Martin's avatar
Ken Martin committed
100
101
  ENDIF (DART_ROOT)
ENDIF(BUILD_TESTING)
Ken Martin's avatar
Ken Martin committed
102
103
MARK_AS_ADVANCED(DART_ROOT)
MARK_AS_ADVANCED(CURL_TESTING)
Ken Martin's avatar
Ken Martin committed
104

Ken Martin's avatar
Ken Martin committed
105
SET(EXECUTABLE_OUTPUT_PATH ${CMake_BINARY_DIR}/bin CACHE INTERNAL 
106
  "Where to put the executables for CMake"
Andy Cedilnik's avatar
Andy Cedilnik committed
107
  )
Ken Martin's avatar
Ken Martin committed
108
SET(LIBRARY_OUTPUT_PATH "" CACHE INTERNAL 
Ken Martin's avatar
Ken Martin committed
109
  "Where to put the libraries for CMake"
Andy Cedilnik's avatar
Andy Cedilnik committed
110
  )
Ken Martin's avatar
Ken Martin committed
111

Ken Martin's avatar
Ken Martin committed
112
INCLUDE_REGULAR_EXPRESSION("^(\\.\\./)?(cm|CMake|form|ctest).*")
Ken Martin's avatar
Ken Martin committed
113

Ken Martin's avatar
Ken Martin committed
114
CONFIGURE_FILE(${CMake_SOURCE_DIR}/Tests/.NoDartCoverage
Andy Cedilnik's avatar
Andy Cedilnik committed
115
  ${CMake_BINARY_DIR}/Tests/.NoDartCoverage)
Ken Martin's avatar
Ken Martin committed
116
CONFIGURE_FILE(${CMake_SOURCE_DIR}/Tests/.NoDartCoverage
Andy Cedilnik's avatar
Andy Cedilnik committed
117
  ${CMake_BINARY_DIR}/Modules/.NoDartCoverage)
118
119
120
121
122
123
124
125
126
127
128

SET(CMAKE_BUILD_MFC_DIALOG 0)
IF(WIN32)
  IF(NOT UNIX)
    IF(NOT BORLAND)
      IF(NOT MINGW )
        SET(CMAKE_BUILD_MFC_DIALOG 1)
      ENDIF(NOT MINGW )
    ENDIF(NOT BORLAND)
  ENDIF(NOT UNIX)
ENDIF(WIN32)