2 CMAKE_MINIMUM_REQUIRED(VERSION 2.4 FATAL_ERROR)
3 IF(COMMAND CMAKE_POLICY)
4 CMAKE_POLICY(SET CMP0003 NEW)
5 ENDIF(COMMAND CMAKE_POLICY)
7 MARK_AS_ADVANCED(CMAKE_BACKWARDS_COMPATIBILITY)
11 #-----------------------------------------------------------------------
12 # a macro to deal with system libraries, implemented as a macro
13 # simply to improve readability of the main script
14 #-----------------------------------------------------------------------
15 MACRO(CMAKE_HANDLE_SYSTEM_LIBRARIES)
16 # Third party libraries must be something that can be found.
17 IF(EXISTS ${CMAKE_ROOT}/Modules/FindXMLRPC.cmake)
18 SET(CMAKE_ALLOW_SYSTEM_LIBRARIES 1)
19 ELSE(EXISTS ${CMAKE_ROOT}/Modules/FindXMLRPC.cmake)
20 SET(CMAKE_ALLOW_SYSTEM_LIBRARIES 0)
21 ENDIF(EXISTS ${CMAKE_ROOT}/Modules/FindXMLRPC.cmake)
23 IF(CMAKE_ALLOW_SYSTEM_LIBRARIES)
24 # Options have dependencies.
25 INCLUDE(CMakeDependentOption)
27 # Allow the user to enable/disable all system utility library options
28 # by setting CMAKE_USE_SYSTEM_LIBRARIES on the command line.
29 IF(DEFINED CMAKE_USE_SYSTEM_LIBRARIES)
30 SET(CMAKE_USE_SYSTEM_LIBRARIES_USER 1)
31 ENDIF(DEFINED CMAKE_USE_SYSTEM_LIBRARIES)
32 IF(CMAKE_USE_SYSTEM_LIBRARIES)
33 SET(CMAKE_USE_SYSTEM_LIBRARIES ON)
34 ELSE(CMAKE_USE_SYSTEM_LIBRARIES)
35 SET(CMAKE_USE_SYSTEM_LIBRARIES OFF)
36 ENDIF(CMAKE_USE_SYSTEM_LIBRARIES)
37 IF(CMAKE_USE_SYSTEM_LIBRARIES_USER)
38 SET(CMAKE_USE_SYSTEM_CURL "${CMAKE_USE_SYSTEM_LIBRARIES}"
39 CACHE BOOL "Use system-installed curl" FORCE)
40 SET(CMAKE_USE_SYSTEM_EXPAT "${CMAKE_USE_SYSTEM_LIBRARIES}"
41 CACHE BOOL "Use system-installed expat" FORCE)
42 SET(CMAKE_USE_SYSTEM_XMLRPC "${CMAKE_USE_SYSTEM_LIBRARIES}"
43 CACHE BOOL "Use system-installed xmlrpc" FORCE)
44 SET(CMAKE_USE_SYSTEM_ZLIB "${CMAKE_USE_SYSTEM_LIBRARIES}"
45 CACHE BOOL "Use system-installed zlib" FORCE)
46 ENDIF(CMAKE_USE_SYSTEM_LIBRARIES_USER)
48 # Optionally use system utility libraries.
49 OPTION(CMAKE_USE_SYSTEM_CURL "Use system-installed curl"
50 ${CMAKE_USE_SYSTEM_LIBRARIES})
51 OPTION(CMAKE_USE_SYSTEM_XMLRPC "Use system-installed xmlrpc"
52 ${CMAKE_USE_SYSTEM_LIBRARIES})
53 CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_EXPAT "Use system-installed expat"
54 ${CMAKE_USE_SYSTEM_LIBRARIES} "NOT CMAKE_USE_SYSTEM_XMLRPC" ON)
55 CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_ZLIB "Use system-installed zlib"
56 ${CMAKE_USE_SYSTEM_LIBRARIES} "NOT CMAKE_USE_SYSTEM_CURL" ON)
58 # There is currently no option for system tar because the upstream
59 # libtar does not have our modifications to allow reentrant
60 # object-oriented use of the library.
61 # OPTION(CMAKE_USE_SYSTEM_TAR "Use system-installed tar" OFF)
62 ELSE(CMAKE_ALLOW_SYSTEM_LIBRARIES)
63 SET(CMAKE_USE_SYSTEM_CURL 0)
64 SET(CMAKE_USE_SYSTEM_EXPAT 0)
65 SET(CMAKE_USE_SYSTEM_XMLRPC 0)
66 SET(CMAKE_USE_SYSTEM_ZLIB 0)
67 ENDIF(CMAKE_ALLOW_SYSTEM_LIBRARIES)
70 # Mention to the user what system libraries are being used.
71 FOREACH(util CURL EXPAT XMLRPC ZLIB)
72 IF(CMAKE_USE_SYSTEM_${util})
73 MESSAGE(STATUS "Using system-installed ${util}")
74 ENDIF(CMAKE_USE_SYSTEM_${util})
77 # Inform utility library header wrappers whether to use system versions.
78 CONFIGURE_FILE(${CMake_SOURCE_DIR}/Utilities/cmThirdParty.h.in
79 ${CMake_BINARY_DIR}/Utilities/cmThirdParty.h
82 ENDMACRO(CMAKE_HANDLE_SYSTEM_LIBRARIES)
86 #-----------------------------------------------------------------------
87 # a macro to check for MFC and setup to build the MFC Dialog
88 # simply to improve readability of the main script
89 #-----------------------------------------------------------------------
90 MACRO(CMAKE_TEST_FOR_MFC)
91 SET(CMAKE_BUILD_ON_VISUAL_STUDIO 0)
92 IF(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW )
93 SET(CMAKE_BUILD_ON_VISUAL_STUDIO 1)
94 ENDIF(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW )
96 IF(CMAKE_BUILD_ON_VISUAL_STUDIO)
97 IF("CMake_HAVE_MFC" MATCHES "^CMake_HAVE_MFC$")
98 SET(CHECK_INCLUDE_FILE_VAR "afxwin.h")
99 CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CheckIncludeFile.cxx.in
100 ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx)
101 MESSAGE(STATUS "Looking for MFC")
102 TRY_COMPILE(CMake_HAVE_MFC
104 ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx
106 -DCMAKE_MFC_FLAG:STRING=2
107 -DCOMPILE_DEFINITIONS:STRING=-D_AFXDLL
108 OUTPUT_VARIABLE OUTPUT)
110 MESSAGE(STATUS "Looking for MFC - found")
111 SET(CMake_HAVE_MFC 1 CACHE INTERNAL "Have MFC?")
112 FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
113 "Determining if MFC exists passed with the following output:\n"
116 MESSAGE(STATUS "Looking for MFC - not found")
117 SET(CMake_HAVE_MFC 0 CACHE INTERNAL "Have MFC?")
118 FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
119 "Determining if MFC exists failed with the following output:\n"
121 ENDIF(CMake_HAVE_MFC)
122 ENDIF("CMake_HAVE_MFC" MATCHES "^CMake_HAVE_MFC$")
125 OPTION(BUILD_MFCDialog "Whether to build the CMakeSetup MFC dialog." ON)
127 SET(BUILD_MFCDialog 0)
128 ENDIF(CMake_HAVE_MFC)
129 ELSE(CMAKE_BUILD_ON_VISUAL_STUDIO)
130 SET(BUILD_MFCDialog 0)
131 ENDIF(CMAKE_BUILD_ON_VISUAL_STUDIO)
132 ENDMACRO(CMAKE_TEST_FOR_MFC)
136 #-----------------------------------------------------------------------
137 # a macro to determine the generator and ctest executable to use
138 # for testing. Simply to improve readability of the main script.
139 #-----------------------------------------------------------------------
140 MACRO(CMAKE_SETUP_TESTING)
142 SET(MAKEPROGRAM ${CMAKE_MAKE_PROGRAM})
143 ENDIF (NOT DART_ROOT)
146 SET(CMAKE_TEST_GENERATOR "" CACHE STRING
147 "Generator used when running tests")
148 SET(CMAKE_TEST_MAKEPROGRAM "" CACHE FILEPATH
149 "Generator used when running tests")
150 IF(NOT CMAKE_TEST_GENERATOR)
151 SET(CMAKE_TEST_GENERATOR "${CMAKE_GENERATOR}")
152 SET(CMAKE_TEST_MAKEPROGRAM "${MAKEPROGRAM}")
153 ELSE(NOT CMAKE_TEST_GENERATOR)
154 SET(CMAKE_TEST_DIFFERENT_GENERATOR TRUE)
155 ENDIF(NOT CMAKE_TEST_GENERATOR)
157 # Are we testing with the MSVC compiler?
158 SET(CMAKE_TEST_MSVC 0)
159 IF(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR)
160 SET(CMAKE_TEST_MSVC 1)
161 ELSE(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR)
162 IF("${CMAKE_TEST_GENERATOR}" MATCHES "NMake" OR
163 "${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio")
164 SET(CMAKE_TEST_MSVC 1)
165 ENDIF("${CMAKE_TEST_GENERATOR}" MATCHES "NMake" OR
166 "${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio")
167 ENDIF(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR)
169 SET(CMAKE_TEST_SYSTEM_LIBRARIES 0)
170 FOREACH(util CURL EXPAT XMLRPC ZLIB)
171 IF(CMAKE_USE_SYSTEM_${util})
172 SET(CMAKE_TEST_SYSTEM_LIBRARIES 1)
173 ENDIF(CMAKE_USE_SYSTEM_${util})
176 # This variable is set by cmake, however to
177 # test cmake we want to make sure that
178 # the ctest from this cmake is used for testing
179 # and not the ctest from the cmake building and testing
181 SET(CMAKE_CTEST_COMMAND "${EXECUTABLE_OUTPUT_PATH}/ctest")
182 SET(CMAKE_CMAKE_COMMAND "${EXECUTABLE_OUTPUT_PATH}/cmake")
185 # configure some files for testing
186 CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/Templates/CTestScript.cmake.in"
187 "${CMAKE_CURRENT_BINARY_DIR}/CTestScript.cmake"
189 CONFIGURE_FILE(${CMake_SOURCE_DIR}/Tests/.NoDartCoverage
190 ${CMake_BINARY_DIR}/Tests/.NoDartCoverage)
191 CONFIGURE_FILE(${CMake_SOURCE_DIR}/Tests/.NoDartCoverage
192 ${CMake_BINARY_DIR}/Modules/.NoDartCoverage)
193 CONFIGURE_FILE(${CMake_SOURCE_DIR}/CTestCustom.cmake.in
194 ${CMake_BINARY_DIR}/CTestCustom.cmake @ONLY)
195 CONFIGURE_FILE(${CMake_SOURCE_DIR}/CTestCustom.ctest.in
196 ${CMake_BINARY_DIR}/CTestCustom.ctest @ONLY)
197 IF(BUILD_TESTING AND DART_ROOT)
198 CONFIGURE_FILE(${CMake_SOURCE_DIR}/CMakeLogo.gif
199 ${CMake_BINARY_DIR}/Testing/HTML/TestingResults/Icons/Logo.gif COPYONLY)
200 ENDIF(BUILD_TESTING AND DART_ROOT)
201 MARK_AS_ADVANCED(DART_ROOT)
202 MARK_AS_ADVANCED(CURL_TESTING)
203 ENDMACRO(CMAKE_SETUP_TESTING)
207 #-----------------------------------------------------------------------
208 # a macro to build the utilities used by CMake
209 # Simply to improve readability of the main script.
210 #-----------------------------------------------------------------------
211 MACRO (CMAKE_BUILD_UTILITIES)
212 #---------------------------------------------------------------------
213 # Create the kwsys library for CMake.
214 SET(KWSYS_NAMESPACE cmsys)
215 SET(KWSYS_USE_SystemTools 1)
216 SET(KWSYS_USE_Directory 1)
217 SET(KWSYS_USE_RegularExpression 1)
218 SET(KWSYS_USE_Base64 1)
220 SET(KWSYS_USE_Process 1)
221 SET(KWSYS_USE_CommandLineArguments 1)
222 SET(KWSYS_HEADER_ROOT ${CMake_BINARY_DIR}/Source)
223 SUBDIRS(Source/kwsys)
225 #---------------------------------------------------------------------
226 # Setup third-party libraries.
227 # Everything in the tree should be able to include files from the
228 # Utilities directory.
230 ${CMake_BINARY_DIR}/Utilities
231 ${CMake_SOURCE_DIR}/Utilities
234 # check for the use of system libraries versus builtin ones
235 # (a macro defined in this file)
236 CMAKE_HANDLE_SYSTEM_LIBRARIES()
238 #---------------------------------------------------------------------
239 # Build zlib library for Curl, CMake, and CTest.
240 SET(CMAKE_ZLIB_HEADER "cm_zlib.h")
241 IF(CMAKE_USE_SYSTEM_ZLIB)
245 "CMAKE_USE_SYSTEM_ZLIB is ON but a zlib is not found!")
246 ENDIF(NOT ZLIB_FOUND)
247 SET(CMAKE_ZLIB_INCLUDES ${ZLIB_INCLUDE_DIR})
248 SET(CMAKE_ZLIB_LIBRARIES ${ZLIB_LIBRARIES})
249 ELSE(CMAKE_USE_SYSTEM_ZLIB)
250 SET(CMAKE_ZLIB_INCLUDES)
251 SET(CMAKE_ZLIB_LIBRARIES cmzlib)
252 SUBDIRS(Utilities/cmzlib)
253 ENDIF(CMAKE_USE_SYSTEM_ZLIB)
255 #---------------------------------------------------------------------
256 # Build Curl library for CTest.
257 IF(CMAKE_USE_SYSTEM_CURL)
261 "CMAKE_USE_SYSTEM_CURL is ON but a curl is not found!")
262 ENDIF(NOT CURL_FOUND)
263 SET(CMAKE_CURL_INCLUDES ${CURL_INCLUDE_DIRS})
264 SET(CMAKE_CURL_LIBRARIES ${CURL_LIBRARIES})
265 ELSE(CMAKE_USE_SYSTEM_CURL)
266 SET(CURL_SPECIAL_ZLIB_H ${CMAKE_ZLIB_HEADER})
267 SET(CURL_SPECIAL_LIBZ_INCLUDES ${CMAKE_ZLIB_INCLUDES})
268 SET(CURL_SPECIAL_LIBZ ${CMAKE_ZLIB_LIBRARIES})
269 ADD_DEFINITIONS(-DCURL_STATICLIB)
270 SET(CMAKE_CURL_INCLUDES)
271 SET(CMAKE_CURL_LIBRARIES cmcurl)
272 IF(CMAKE_USE_NEW_CURL)
273 # for cmake never build examples
274 SET(CURL_SKIP_EXAMPLES TRUE)
275 ADD_SUBDIRECTORY(Utilities/cmcurl-7.19.0)
276 ELSE(CMAKE_USE_NEW_CURL)
277 SUBDIRS(Utilities/cmcurl)
278 ENDIF(CMAKE_USE_NEW_CURL)
279 ENDIF(CMAKE_USE_SYSTEM_CURL)
281 #---------------------------------------------------------------------
282 # Build Tar library for CTest.
283 SET(CMTAR_ZLIB_HEADER ${CMAKE_ZLIB_HEADER})
284 SET(CMTAR_ZLIB_LIBRARIES ${CMAKE_ZLIB_LIBRARIES})
285 SET(CMTAR_ZLIB_INCLUDE_DIRS ${CMAKE_ZLIB_INCLUDES})
286 SET(CMAKE_TAR_INCLUDES ${CMAKE_CURRENT_BINARY_DIR}/Utilities/cmtar)
287 SET(CMAKE_TAR_LIBRARIES cmtar)
288 SUBDIRS(Utilities/cmtar)
290 #---------------------------------------------------------------------
291 # Build Compress library for CTest.
292 SET(CMAKE_COMPRESS_INCLUDES
293 "${CMAKE_CURRENT_BINARY_DIR}/Utilities/cmcompress")
294 SET(CMAKE_COMPRESS_LIBRARIES "cmcompress")
295 SUBDIRS(Utilities/cmcompress)
297 #---------------------------------------------------------------------
298 # Build expat library for CMake and CTest.
299 IF(CMAKE_USE_SYSTEM_EXPAT)
303 "CMAKE_USE_SYSTEM_EXPAT is ON but a expat is not found!")
304 ENDIF(NOT EXPAT_FOUND)
305 SET(CMAKE_EXPAT_INCLUDES ${EXPAT_INCLUDE_DIRS})
306 SET(CMAKE_EXPAT_LIBRARIES ${EXPAT_LIBRARIES})
307 ELSE(CMAKE_USE_SYSTEM_EXPAT)
308 SET(CMAKE_EXPAT_INCLUDES)
309 SET(CMAKE_EXPAT_LIBRARIES cmexpat)
310 SUBDIRS(Utilities/cmexpat)
311 ENDIF(CMAKE_USE_SYSTEM_EXPAT)
313 #---------------------------------------------------------------------
314 # Build XMLRPC library for CMake and CTest.
315 IF(CMAKE_USE_SYSTEM_XMLRPC)
316 FIND_PACKAGE(XMLRPC QUIET REQUIRED libwww-client)
319 "CMAKE_USE_SYSTEM_XMLRPC is ON but a xmlrpc is not found!")
320 ENDIF(NOT XMLRPC_FOUND)
321 SET(CMAKE_XMLRPC_INCLUDES ${XMLRPC_INCLUDE_DIRS})
322 SET(CMAKE_XMLRPC_LIBRARIES ${XMLRPC_LIBRARIES})
323 ELSE(CMAKE_USE_SYSTEM_XMLRPC)
324 SET(CMAKE_XMLRPC_INCLUDES)
325 SET(CMAKE_XMLRPC_LIBRARIES cmXMLRPC)
326 SUBDIRS(Utilities/cmxmlrpc)
327 ENDIF(CMAKE_USE_SYSTEM_XMLRPC)
329 #---------------------------------------------------------------------
332 # there is a bug in the Syllable libraries which makes linking ccmake fail, Alex
333 IF(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable)
334 SET(CURSES_NEED_NCURSES TRUE)
335 FIND_PACKAGE(Curses QUIET)
337 OPTION(BUILD_CursesDialog "Build the CMake Curses Dialog ccmake" ON)
338 ELSE (CURSES_LIBRARY)
339 MESSAGE("Curses libraries were not found. Curses GUI for CMake will not be built.")
340 SET(BUILD_CursesDialog 0)
341 ENDIF (CURSES_LIBRARY)
342 ELSE(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable)
343 SET(BUILD_CursesDialog 0)
344 ENDIF(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable)
346 SET(BUILD_CursesDialog 0)
348 IF(BUILD_CursesDialog)
349 SUBDIRS(Source/CursesDialog/form)
350 ENDIF(BUILD_CursesDialog)
351 ENDMACRO (CMAKE_BUILD_UTILITIES)
355 #-----------------------------------------------------------------------
356 # The main section of the CMakeLists file
358 #-----------------------------------------------------------------------
359 # The CMake version number.
360 SET(CMake_VERSION_MAJOR 2)
361 SET(CMake_VERSION_MINOR 7)
362 SET(CMake_VERSION_PATCH 0)
364 # We use odd minor numbers for development versions.
365 # Use a date for the development patch level.
366 IF("${CMake_VERSION_MINOR}" MATCHES "[13579]$")
367 INCLUDE(${CMake_SOURCE_DIR}/Source/kwsys/kwsysDateStamp.cmake)
368 SET(CMake_VERSION_PATCH
369 "${KWSYS_DATE_STAMP_YEAR}${KWSYS_DATE_STAMP_MONTH}${KWSYS_DATE_STAMP_DAY}"
371 ENDIF("${CMake_VERSION_MINOR}" MATCHES "[13579]$")
373 SET(CMake_VERSION "${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
374 SET(CMake_VERSION_FULL "${CMake_VERSION}.${CMake_VERSION_PATCH}")
376 # Include the standard Dart testing module
378 INCLUDE (${CMAKE_ROOT}/Modules/Dart.cmake)
380 # where to write the resulting executables and libraries
381 SET(BUILD_SHARED_LIBS OFF)
382 SET(EXECUTABLE_OUTPUT_PATH ${CMake_BINARY_DIR}/bin CACHE INTERNAL
383 "Where to put the executables for CMake")
384 SET(LIBRARY_OUTPUT_PATH "" CACHE INTERNAL
385 "Where to put the libraries for CMake")
386 INCLUDE_REGULAR_EXPRESSION("^.*$")
388 # The CMake executables usually do not need any rpath to run in the build or
390 SET(CMAKE_SKIP_RPATH ON CACHE INTERNAL "CMake does not need RPATHs.")
392 SET(CMAKE_DATA_DIR "/share/cmake-${CMake_VERSION}" CACHE STRING
393 "Install location for data (relative to prefix).")
394 SET(CMAKE_DOC_DIR "/doc/cmake-${CMake_VERSION}" CACHE STRING
395 "Install location for documentation (relative to prefix).")
396 SET(CMAKE_MAN_DIR "/man" CACHE STRING
397 "Install location for man pages (relative to prefix).")
398 MARK_AS_ADVANCED(CMAKE_DATA_DIR CMAKE_DOC_DIR CMAKE_MAN_DIR)
400 # include special compile flags for some compilers
401 INCLUDE(CompileFlags.cmake)
403 # no clue why we are testing for this here
404 INCLUDE(CheckSymbolExists)
405 CHECK_SYMBOL_EXISTS(unsetenv "stdlib.h" HAVE_UNSETENV)
406 CHECK_SYMBOL_EXISTS(environ "stdlib.h" HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE)
408 # build the utilities (a macro defined in this file)
409 CMAKE_BUILD_UTILITIES()
411 # On NetBSD ncurses is required, since curses doesn't have the wsyncup()
412 # function. ncurses is installed via pkgsrc, so the library is in /usr/pkg/lib,
413 # which isn't in the default linker search path. So without RPATH ccmake
414 # doesn't run and the build doesn't succeed since ccmake is executed for
415 # generating the documentation.
416 IF(BUILD_CursesDialog)
417 GET_FILENAME_COMPONENT(_CURSES_DIR "${CURSES_LIBRARY}" PATH)
418 SET(CURSES_NEED_RPATH FALSE)
419 IF(NOT "${_CURSES_DIR}" STREQUAL "/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/lib64" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib64")
420 SET(CURSES_NEED_RPATH TRUE)
421 ENDIF(NOT "${_CURSES_DIR}" STREQUAL "/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/lib64" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib64")
422 ENDIF(BUILD_CursesDialog)
426 SET(CMAKE_BUNDLE_NAME
427 "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}-${CMake_VERSION_PATCH}")
428 SET(CMAKE_BUNDLE_LOCATION "${CMAKE_INSTALL_PREFIX}")
429 # make sure CMAKE_INSTALL_PREFIX ends in /
430 STRING(LENGTH "${CMAKE_INSTALL_PREFIX}" LEN)
431 MATH(EXPR LEN "${LEN} -1" )
432 STRING(SUBSTRING "${CMAKE_INSTALL_PREFIX}" ${LEN} 1 ENDCH)
433 IF(NOT "${ENDCH}" STREQUAL "/")
434 SET(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/")
435 ENDIF(NOT "${ENDCH}" STREQUAL "/")
436 SET(CMAKE_INSTALL_PREFIX
437 "${CMAKE_INSTALL_PREFIX}${CMAKE_BUNDLE_NAME}.app/Contents")
440 SET(QT_NEED_RPATH FALSE)
441 IF(NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib64" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib64")
442 SET(QT_NEED_RPATH TRUE)
443 ENDIF(NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib64" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib64")
444 ENDIF(BUILD_QtDialog)
447 # The same might be true on other systems for other libraries if
448 # CMAKE_USE_SYSTEM_XMLRPC or other variables like this are enabled.
449 # Then only enable RPATH if we have are building at least with cmake 2.4,
450 # since this one has much better RPATH features than cmake 2.2.
451 # The executables are then built with the RPATH for the libraries outside
452 # the build tree, which is both the build and the install RPATH.
454 IF( CMAKE_USE_SYSTEM_CURL OR CMAKE_USE_SYSTEM_ZLIB
455 OR CMAKE_USE_SYSTEM_EXPAT OR CMAKE_USE_SYSTEM_XMLRPC OR CURSES_NEED_RPATH OR QT_NEED_RPATH)
456 SET(CMAKE_SKIP_RPATH OFF CACHE INTERNAL "CMake built with RPATH.")
457 SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
458 SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
459 ENDIF(CMAKE_USE_SYSTEM_CURL OR CMAKE_USE_SYSTEM_ZLIB
460 OR CMAKE_USE_SYSTEM_EXPAT OR CMAKE_USE_SYSTEM_XMLRPC OR CURSES_NEED_RPATH OR QT_NEED_RPATH)
464 # should we build the MFC dialog? (a macro defined in this file)
467 # add the uninstall support
469 "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
470 "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
472 ADD_CUSTOM_TARGET(uninstall
473 "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
475 INCLUDE (CMakeCPack.cmake)
477 # setup some Testing support (a macro defined in this file)
478 CMAKE_SETUP_TESTING()
480 "${CMAKE_CURRENT_SOURCE_DIR}/DartLocal.conf.in"
481 "${CMAKE_CURRENT_BINARY_DIR}/DartLocal.conf"
485 "Perform strict testing to record property and variable access. Can be used to report any undefined properties or variables" OFF)
486 MARK_AS_ADVANCED(CMAKE_STRICT)
489 # build the remaining subdirectories
497 ADD_TEST(SystemInformationNew "${CMAKE_CMAKE_COMMAND}"
498 --system-information -G "${CMAKE_TEST_GENERATOR}" )
500 #-----------------------------------------------------------------------
501 # End of the main section of the CMakeLists file
502 #-----------------------------------------------------------------------