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_SOURCE_DIR}/Utilities
231 ${CMake_BINARY_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 SUBDIRS(Utilities/cmcurl)
273 ENDIF(CMAKE_USE_SYSTEM_CURL)
275 #---------------------------------------------------------------------
276 # Build Tar library for CTest.
277 SET(CMTAR_ZLIB_HEADER ${CMAKE_ZLIB_HEADER})
278 SET(CMTAR_ZLIB_LIBRARIES ${CMAKE_ZLIB_LIBRARIES})
279 SET(CMTAR_ZLIB_INCLUDE_DIRS ${CMAKE_ZLIB_INCLUDES})
280 SET(CMAKE_TAR_INCLUDES ${CMAKE_CURRENT_BINARY_DIR}/Utilities/cmtar)
281 SET(CMAKE_TAR_LIBRARIES cmtar)
282 SUBDIRS(Utilities/cmtar)
284 #---------------------------------------------------------------------
285 # Build Compress library for CTest.
286 SET(CMAKE_COMPRESS_INCLUDES
287 "${CMAKE_CURRENT_BINARY_DIR}/Utilities/cmcompress")
288 SET(CMAKE_COMPRESS_LIBRARIES "cmcompress")
289 SUBDIRS(Utilities/cmcompress)
291 #---------------------------------------------------------------------
292 # Build expat library for CMake and CTest.
293 IF(CMAKE_USE_SYSTEM_EXPAT)
297 "CMAKE_USE_SYSTEM_EXPAT is ON but a expat is not found!")
298 ENDIF(NOT EXPAT_FOUND)
299 SET(CMAKE_EXPAT_INCLUDES ${EXPAT_INCLUDE_DIRS})
300 SET(CMAKE_EXPAT_LIBRARIES ${EXPAT_LIBRARIES})
301 ELSE(CMAKE_USE_SYSTEM_EXPAT)
302 SET(CMAKE_EXPAT_INCLUDES)
303 SET(CMAKE_EXPAT_LIBRARIES cmexpat)
304 SUBDIRS(Utilities/cmexpat)
305 ENDIF(CMAKE_USE_SYSTEM_EXPAT)
307 #---------------------------------------------------------------------
308 # Build XMLRPC library for CMake and CTest.
309 IF(CMAKE_USE_SYSTEM_XMLRPC)
310 FIND_PACKAGE(XMLRPC QUIET REQUIRED libwww-client)
313 "CMAKE_USE_SYSTEM_XMLRPC is ON but a xmlrpc is not found!")
314 ENDIF(NOT XMLRPC_FOUND)
315 SET(CMAKE_XMLRPC_INCLUDES ${XMLRPC_INCLUDE_DIRS})
316 SET(CMAKE_XMLRPC_LIBRARIES ${XMLRPC_LIBRARIES})
317 ELSE(CMAKE_USE_SYSTEM_XMLRPC)
318 SET(CMAKE_XMLRPC_INCLUDES)
319 SET(CMAKE_XMLRPC_LIBRARIES cmXMLRPC)
320 SUBDIRS(Utilities/cmxmlrpc)
321 ENDIF(CMAKE_USE_SYSTEM_XMLRPC)
323 #---------------------------------------------------------------------
326 # there is a bug in the Syllable libraries which makes linking ccmake fail, Alex
327 IF(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable)
328 SET(CURSES_NEED_NCURSES TRUE)
329 FIND_PACKAGE(Curses QUIET)
331 OPTION(BUILD_CursesDialog "Build the CMake Curses Dialog ccmake" ON)
332 ELSE (CURSES_LIBRARY)
333 MESSAGE("Curses libraries were not found. Curses GUI for CMake will not be built.")
334 SET(BUILD_CursesDialog 0)
335 ENDIF (CURSES_LIBRARY)
336 ELSE(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable)
337 SET(BUILD_CursesDialog 0)
338 ENDIF(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable)
340 SET(BUILD_CursesDialog 0)
342 IF(BUILD_CursesDialog)
343 SUBDIRS(Source/CursesDialog/form)
344 ENDIF(BUILD_CursesDialog)
345 ENDMACRO (CMAKE_BUILD_UTILITIES)
349 #-----------------------------------------------------------------------
350 # The main section of the CMakeLists file
352 #-----------------------------------------------------------------------
353 # The CMake version number.
354 SET(CMake_VERSION_MAJOR 2)
355 SET(CMake_VERSION_MINOR 7)
356 SET(CMake_VERSION_PATCH 0)
358 # CVS versions are odd, if this is an odd minor version
359 # then set the CMake_VERSION_DATE variable
360 IF("${CMake_VERSION_MINOR}" MATCHES "[13579]$")
361 INCLUDE(${CMake_SOURCE_DIR}/Source/kwsys/kwsysDateStamp.cmake)
362 SET(CMake_VERSION_DATE
363 "${KWSYS_DATE_STAMP_YEAR}${KWSYS_DATE_STAMP_MONTH}${KWSYS_DATE_STAMP_DAY}"
365 ENDIF("${CMake_VERSION_MINOR}" MATCHES "[13579]$")
367 SET(CMake_VERSION "${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
368 SET(CMake_VERSION_FULL "${CMake_VERSION}.${CMake_VERSION_PATCH}")
370 # Include the standard Dart testing module
372 INCLUDE (${CMAKE_ROOT}/Modules/Dart.cmake)
374 # where to write the resulting executables and libraries
375 SET(BUILD_SHARED_LIBS OFF)
376 SET(EXECUTABLE_OUTPUT_PATH ${CMake_BINARY_DIR}/bin CACHE INTERNAL
377 "Where to put the executables for CMake")
378 SET(LIBRARY_OUTPUT_PATH "" CACHE INTERNAL
379 "Where to put the libraries for CMake")
380 INCLUDE_REGULAR_EXPRESSION("^.*$")
382 # The CMake executables usually do not need any rpath to run in the build or
384 SET(CMAKE_SKIP_RPATH ON CACHE INTERNAL "CMake does not need RPATHs.")
386 SET(CMAKE_DATA_DIR "/share/cmake-${CMake_VERSION}" CACHE STRING
387 "Install location for data (relative to prefix).")
388 SET(CMAKE_DOC_DIR "/doc/cmake-${CMake_VERSION}" CACHE STRING
389 "Install location for documentation (relative to prefix).")
390 SET(CMAKE_MAN_DIR "/man" CACHE STRING
391 "Install location for man pages (relative to prefix).")
392 MARK_AS_ADVANCED(CMAKE_DATA_DIR CMAKE_DOC_DIR CMAKE_MAN_DIR)
394 # include special compile flags for some compilers
395 INCLUDE(CompileFlags.cmake)
397 # no clue why we are testing for this here
398 INCLUDE(CheckSymbolExists)
399 CHECK_SYMBOL_EXISTS(unsetenv "stdlib.h" HAVE_UNSETENV)
400 CHECK_SYMBOL_EXISTS(environ "stdlib.h" HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE)
402 # build the utilities (a macro defined in this file)
403 CMAKE_BUILD_UTILITIES()
405 # On NetBSD ncurses is required, since curses doesn't have the wsyncup()
406 # function. ncurses is installed via pkgsrc, so the library is in /usr/pkg/lib,
407 # which isn't in the default linker search path. So without RPATH ccmake
408 # doesn't run and the build doesn't succeed since ccmake is executed for
409 # generating the documentation.
410 IF(BUILD_CursesDialog)
411 GET_FILENAME_COMPONENT(_CURSES_DIR "${CURSES_LIBRARY}" PATH)
412 SET(CURSES_NEED_RPATH FALSE)
413 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")
414 SET(CURSES_NEED_RPATH TRUE)
415 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")
416 ENDIF(BUILD_CursesDialog)
420 SET(CMAKE_BUNDLE_NAME
421 "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}-${CMake_VERSION_PATCH}")
422 IF(CMake_VERSION_DATE)
423 SET(CMAKE_BUNDLE_NAME
424 "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}-${CMake_VERSION_DATE}")
425 ENDIF(CMake_VERSION_DATE)
426 SET(CMAKE_BUNDLE_LOCATION "${CMAKE_INSTALL_PREFIX}")
427 # make sure CMAKE_INSTALL_PREFIX ends in /
428 STRING(LENGTH "${CMAKE_INSTALL_PREFIX}" LEN)
429 MATH(EXPR LEN "${LEN} -1" )
430 STRING(SUBSTRING "${CMAKE_INSTALL_PREFIX}" ${LEN} 1 ENDCH)
431 IF(NOT "${ENDCH}" STREQUAL "/")
432 SET(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/")
433 ENDIF(NOT "${ENDCH}" STREQUAL "/")
434 SET(CMAKE_INSTALL_PREFIX
435 "${CMAKE_INSTALL_PREFIX}${CMAKE_BUNDLE_NAME}.app/Contents")
438 SET(QT_NEED_RPATH FALSE)
439 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")
440 SET(QT_NEED_RPATH TRUE)
441 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")
442 ENDIF(BUILD_QtDialog)
445 # The same might be true on other systems for other libraries if
446 # CMAKE_USE_SYSTEM_XMLRPC or other variables like this are enabled.
447 # Then only enable RPATH if we have are building at least with cmake 2.4,
448 # since this one has much better RPATH features than cmake 2.2.
449 # The executables are then built with the RPATH for the libraries outside
450 # the build tree, which is both the build and the install RPATH.
452 IF( CMAKE_USE_SYSTEM_CURL OR CMAKE_USE_SYSTEM_ZLIB
453 OR CMAKE_USE_SYSTEM_EXPAT OR CMAKE_USE_SYSTEM_XMLRPC OR CURSES_NEED_RPATH OR QT_NEED_RPATH)
454 SET(CMAKE_SKIP_RPATH OFF CACHE INTERNAL "CMake built with RPATH.")
455 SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
456 SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
457 ENDIF(CMAKE_USE_SYSTEM_CURL OR CMAKE_USE_SYSTEM_ZLIB
458 OR CMAKE_USE_SYSTEM_EXPAT OR CMAKE_USE_SYSTEM_XMLRPC OR CURSES_NEED_RPATH OR QT_NEED_RPATH)
462 # should we build the MFC dialog? (a macro defined in this file)
465 # add the uninstall support
467 "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
468 "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
470 ADD_CUSTOM_TARGET(uninstall
471 "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
473 INCLUDE (CMakeCPack.cmake)
475 # setup some Testing support (a macro defined in this file)
476 CMAKE_SETUP_TESTING()
478 "${CMAKE_CURRENT_SOURCE_DIR}/DartLocal.conf.in"
479 "${CMAKE_CURRENT_BINARY_DIR}/DartLocal.conf"
483 "Perform strict testing to record property and variable access. Can be used to report any undefined properties or variables" OFF)
484 MARK_AS_ADVANCED(CMAKE_STRICT)
487 # build the remaining subdirectories
495 ADD_TEST(SystemInformationNew "${CMAKE_CMAKE_COMMAND}"
496 --system-information -G "${CMAKE_TEST_GENERATOR}" )
498 #-----------------------------------------------------------------------
499 # End of the main section of the CMakeLists file
500 #-----------------------------------------------------------------------