Updated formatting of documentation plus a little reorganization.
[cmake.git] / CMakeLists.txt
blobdc96548fb0c079001f2b1d93d90bef8b98cab052
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.4.5 FATAL_ERROR)
2 PROJECT(CMake)
3 IF(COMMAND CMAKE_POLICY)
4   CMAKE_POLICY(SET CMP0003 NEW)
5 ENDIF(COMMAND CMAKE_POLICY)
7 MARK_AS_ADVANCED(CMAKE_BACKWARDS_COMPATIBILITY)
9 # Allow empty endif() and such with CMake 2.4.
10 SET(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS 1)
12 IF(NOT ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.4)
13   # Since the built CMake will install itself instead of the
14   # generating CMake, tell it that the install rules were generated
15   # by CMake 2.4.
16   INSTALL(CODE "SET(CMAKE_INSTALL_SELF_2_4 1)")
17 ENDIF()
19 #-----------------------------------------------------------------------
20 # a macro to deal with system libraries, implemented as a macro
21 # simply to improve readability of the main script
22 #-----------------------------------------------------------------------
23 MACRO(CMAKE_HANDLE_SYSTEM_LIBRARIES)
24   # Options have dependencies.
25   INCLUDE(CMakeDependentOption)
27   # Optionally use system xmlrpc.  We no longer build or use it by default.
28   OPTION(CTEST_USE_XMLRPC "Enable xmlrpc submission method in CTest." OFF)
29   MARK_AS_ADVANCED(CTEST_USE_XMLRPC)
31   # Allow the user to enable/disable all system utility library options
32   # by setting CMAKE_USE_SYSTEM_LIBRARIES on the command line.
33   IF(DEFINED CMAKE_USE_SYSTEM_LIBRARIES)
34     SET(CMAKE_USE_SYSTEM_LIBRARIES_USER 1)
35   ENDIF(DEFINED CMAKE_USE_SYSTEM_LIBRARIES)
36   IF(CMAKE_USE_SYSTEM_LIBRARIES)
37     SET(CMAKE_USE_SYSTEM_LIBRARIES ON)
38   ELSE(CMAKE_USE_SYSTEM_LIBRARIES)
39     SET(CMAKE_USE_SYSTEM_LIBRARIES OFF)
40   ENDIF(CMAKE_USE_SYSTEM_LIBRARIES)
41   IF(CMAKE_USE_SYSTEM_LIBRARIES_USER)
42     SET(CMAKE_USE_SYSTEM_CURL "${CMAKE_USE_SYSTEM_LIBRARIES}"
43       CACHE BOOL "Use system-installed curl" FORCE)
44     SET(CMAKE_USE_SYSTEM_EXPAT "${CMAKE_USE_SYSTEM_LIBRARIES}"
45       CACHE BOOL "Use system-installed expat" FORCE)
46     SET(CMAKE_USE_SYSTEM_ZLIB "${CMAKE_USE_SYSTEM_LIBRARIES}"
47       CACHE BOOL "Use system-installed zlib" FORCE)
48   ENDIF(CMAKE_USE_SYSTEM_LIBRARIES_USER)
50   # Optionally use system utility libraries.
51   CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_CURL "Use system-installed curl"
52     ${CMAKE_USE_SYSTEM_LIBRARIES} "NOT CTEST_USE_XMLRPC" ON)
53   CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_EXPAT "Use system-installed expat"
54     ${CMAKE_USE_SYSTEM_LIBRARIES} "NOT CTEST_USE_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)
63   # Mention to the user what system libraries are being used.
64   FOREACH(util CURL EXPAT XMLRPC ZLIB)
65     IF(CMAKE_USE_SYSTEM_${util})
66       MESSAGE(STATUS "Using system-installed ${util}")
67     ENDIF(CMAKE_USE_SYSTEM_${util})
68   ENDFOREACH(util)
70   # Inform utility library header wrappers whether to use system versions.
71   CONFIGURE_FILE(${CMake_SOURCE_DIR}/Utilities/cmThirdParty.h.in
72     ${CMake_BINARY_DIR}/Utilities/cmThirdParty.h
73     @ONLY)
75 ENDMACRO(CMAKE_HANDLE_SYSTEM_LIBRARIES)
80 SET(CMAKE_BUILD_ON_VISUAL_STUDIO 0)
81 IF(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW )
82   SET(CMAKE_BUILD_ON_VISUAL_STUDIO 1)
83 ENDIF(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW )
86 #-----------------------------------------------------------------------
87 # a macro to determine the generator and ctest executable to use
88 # for testing. Simply to improve readability of the main script.
89 #-----------------------------------------------------------------------
90 MACRO(CMAKE_SETUP_TESTING)
91   IF (NOT DART_ROOT)
92     SET(MAKEPROGRAM ${CMAKE_MAKE_PROGRAM})
93   ENDIF (NOT DART_ROOT)
94   
95   IF(BUILD_TESTING)
96     SET(CMAKE_TEST_GENERATOR "" CACHE STRING 
97       "Generator used when running tests")
98     SET(CMAKE_TEST_MAKEPROGRAM "" CACHE FILEPATH 
99       "Generator used when running tests")
100     IF(NOT CMAKE_TEST_GENERATOR)
101       SET(CMAKE_TEST_GENERATOR "${CMAKE_GENERATOR}")
102       SET(CMAKE_TEST_MAKEPROGRAM "${MAKEPROGRAM}")
103     ELSE(NOT CMAKE_TEST_GENERATOR)
104       SET(CMAKE_TEST_DIFFERENT_GENERATOR TRUE)
105     ENDIF(NOT CMAKE_TEST_GENERATOR)
106     
107     # Are we testing with the MSVC compiler?
108     SET(CMAKE_TEST_MSVC 0)
109     IF(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR)
110       SET(CMAKE_TEST_MSVC 1)
111     ELSE(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR)
112       IF("${CMAKE_TEST_GENERATOR}" MATCHES "NMake" OR
113           "${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio")
114         SET(CMAKE_TEST_MSVC 1)
115       ENDIF("${CMAKE_TEST_GENERATOR}" MATCHES "NMake" OR
116         "${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio")
117     ENDIF(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR)
118     
119     SET(CMAKE_TEST_SYSTEM_LIBRARIES 0)
120     FOREACH(util CURL EXPAT XMLRPC ZLIB)
121       IF(CMAKE_USE_SYSTEM_${util})
122         SET(CMAKE_TEST_SYSTEM_LIBRARIES 1)
123       ENDIF(CMAKE_USE_SYSTEM_${util})
124     ENDFOREACH(util)
125     
126     # This variable is set by cmake, however to
127     # test cmake we want to make sure that
128     # the ctest from this cmake is used for testing
129     # and not the ctest from the cmake building and testing
130     # cmake.
131     SET(CMAKE_CTEST_COMMAND "${EXECUTABLE_OUTPUT_PATH}/ctest")
132     SET(CMAKE_CMAKE_COMMAND "${EXECUTABLE_OUTPUT_PATH}/cmake")
133   ENDIF(BUILD_TESTING)
135   # configure some files for testing
136   CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/Templates/CTestScript.cmake.in"
137     "${CMAKE_CURRENT_BINARY_DIR}/CTestScript.cmake"
138     @ONLY)  
139   CONFIGURE_FILE(${CMake_SOURCE_DIR}/Tests/.NoDartCoverage
140     ${CMake_BINARY_DIR}/Tests/.NoDartCoverage)
141   CONFIGURE_FILE(${CMake_SOURCE_DIR}/Tests/.NoDartCoverage
142     ${CMake_BINARY_DIR}/Modules/.NoDartCoverage)
143   CONFIGURE_FILE(${CMake_SOURCE_DIR}/CTestCustom.cmake.in
144     ${CMake_BINARY_DIR}/CTestCustom.cmake @ONLY)
145   CONFIGURE_FILE(${CMake_SOURCE_DIR}/CTestCustom.ctest.in
146     ${CMake_BINARY_DIR}/CTestCustom.ctest @ONLY)
147   IF(BUILD_TESTING AND DART_ROOT)
148     CONFIGURE_FILE(${CMake_SOURCE_DIR}/CMakeLogo.gif 
149       ${CMake_BINARY_DIR}/Testing/HTML/TestingResults/Icons/Logo.gif COPYONLY)
150   ENDIF(BUILD_TESTING AND DART_ROOT)
151   MARK_AS_ADVANCED(DART_ROOT)
152   MARK_AS_ADVANCED(CURL_TESTING)
153 ENDMACRO(CMAKE_SETUP_TESTING)
157 #-----------------------------------------------------------------------
158 # a macro to build the utilities used by CMake
159 # Simply to improve readability of the main script.
160 #-----------------------------------------------------------------------
161 MACRO (CMAKE_BUILD_UTILITIES)
162   #---------------------------------------------------------------------
163   # Create the kwsys library for CMake.
164   SET(KWSYS_NAMESPACE cmsys)
165   SET(KWSYS_USE_SystemTools 1)
166   SET(KWSYS_USE_Directory 1)
167   SET(KWSYS_USE_RegularExpression 1)
168   SET(KWSYS_USE_Base64 1)
169   SET(KWSYS_USE_MD5 1)
170   SET(KWSYS_USE_Process 1)
171   SET(KWSYS_USE_CommandLineArguments 1)
172   SET(KWSYS_HEADER_ROOT ${CMake_BINARY_DIR}/Source)
173   SUBDIRS(Source/kwsys)
174   
175   #---------------------------------------------------------------------
176   # Setup third-party libraries.
177   # Everything in the tree should be able to include files from the
178   # Utilities directory.
179   INCLUDE_DIRECTORIES(
180     ${CMake_BINARY_DIR}/Utilities
181     ${CMake_SOURCE_DIR}/Utilities
182     )
183   
184   # check for the use of system libraries versus builtin ones
185   # (a macro defined in this file)
186   CMAKE_HANDLE_SYSTEM_LIBRARIES()
187   
188   #---------------------------------------------------------------------
189   # Build zlib library for Curl, CMake, and CTest.
190   SET(CMAKE_ZLIB_HEADER "cm_zlib.h")
191   IF(CMAKE_USE_SYSTEM_ZLIB)
192     FIND_PACKAGE(ZLIB)
193     IF(NOT ZLIB_FOUND)
194       MESSAGE(FATAL_ERROR 
195         "CMAKE_USE_SYSTEM_ZLIB is ON but a zlib is not found!")
196     ENDIF(NOT ZLIB_FOUND)
197     SET(CMAKE_ZLIB_INCLUDES ${ZLIB_INCLUDE_DIR})
198     SET(CMAKE_ZLIB_LIBRARIES ${ZLIB_LIBRARIES})
199   ELSE(CMAKE_USE_SYSTEM_ZLIB)
200     SET(CMAKE_ZLIB_INCLUDES)
201     SET(CMAKE_ZLIB_LIBRARIES cmzlib)
202     SUBDIRS(Utilities/cmzlib)
203   ENDIF(CMAKE_USE_SYSTEM_ZLIB)
204   
205   #---------------------------------------------------------------------
206   # Build Curl library for CTest.
207   IF(CMAKE_USE_SYSTEM_CURL)
208     FIND_PACKAGE(CURL)
209     IF(NOT CURL_FOUND)
210       MESSAGE(FATAL_ERROR 
211         "CMAKE_USE_SYSTEM_CURL is ON but a curl is not found!")
212     ENDIF(NOT CURL_FOUND)
213     SET(CMAKE_CURL_INCLUDES ${CURL_INCLUDE_DIRS})
214     SET(CMAKE_CURL_LIBRARIES ${CURL_LIBRARIES})
215   ELSE(CMAKE_USE_SYSTEM_CURL)
216     SET(CURL_SPECIAL_ZLIB_H ${CMAKE_ZLIB_HEADER})
217     SET(CURL_SPECIAL_LIBZ_INCLUDES ${CMAKE_ZLIB_INCLUDES})
218     SET(CURL_SPECIAL_LIBZ ${CMAKE_ZLIB_LIBRARIES})
219     OPTION(CMAKE_BUILD_CURL_SHARED "Should curl be built shared" FALSE)
220     IF(NOT CMAKE_BUILD_CURL_SHARED)
221       ADD_DEFINITIONS(-DCURL_STATICLIB)
222     ENDIF(NOT CMAKE_BUILD_CURL_SHARED)
223     SET(CMAKE_CURL_INCLUDES)
224     SET(CMAKE_CURL_LIBRARIES cmcurl)
225     SUBDIRS(Utilities/cmcurl)
226   ENDIF(CMAKE_USE_SYSTEM_CURL)
228   #---------------------------------------------------------------------
229   # Build Tar library for CTest.
230   SET(CMTAR_ZLIB_HEADER ${CMAKE_ZLIB_HEADER})
231   SET(CMTAR_ZLIB_LIBRARIES ${CMAKE_ZLIB_LIBRARIES})
232   SET(CMTAR_ZLIB_INCLUDE_DIRS ${CMAKE_ZLIB_INCLUDES})
233   SET(CMAKE_TAR_INCLUDES ${CMAKE_CURRENT_BINARY_DIR}/Utilities/cmtar)
234   SET(CMAKE_TAR_LIBRARIES cmtar)
235   SUBDIRS(Utilities/cmtar)
236   
237   #---------------------------------------------------------------------
238   # Build Compress library for CTest.
239   SET(CMAKE_COMPRESS_INCLUDES 
240     "${CMAKE_CURRENT_BINARY_DIR}/Utilities/cmcompress")
241   SET(CMAKE_COMPRESS_LIBRARIES "cmcompress")
242   SUBDIRS(Utilities/cmcompress)
243   
244   #---------------------------------------------------------------------
245   # Build expat library for CMake and CTest.
246   IF(CMAKE_USE_SYSTEM_EXPAT)
247     FIND_PACKAGE(EXPAT)
248     IF(NOT EXPAT_FOUND)
249       MESSAGE(FATAL_ERROR
250         "CMAKE_USE_SYSTEM_EXPAT is ON but a expat is not found!")
251     ENDIF(NOT EXPAT_FOUND)
252     SET(CMAKE_EXPAT_INCLUDES ${EXPAT_INCLUDE_DIRS})
253     SET(CMAKE_EXPAT_LIBRARIES ${EXPAT_LIBRARIES})
254   ELSE(CMAKE_USE_SYSTEM_EXPAT)
255     SET(CMAKE_EXPAT_INCLUDES)
256     SET(CMAKE_EXPAT_LIBRARIES cmexpat)
257     SUBDIRS(Utilities/cmexpat)
258   ENDIF(CMAKE_USE_SYSTEM_EXPAT)
259   
260   #---------------------------------------------------------------------
261   # Build XMLRPC library for CMake and CTest.
262   IF(CTEST_USE_XMLRPC)
263     FIND_PACKAGE(XMLRPC QUIET REQUIRED libwww-client)
264     IF(NOT XMLRPC_FOUND)
265       MESSAGE(FATAL_ERROR
266         "CTEST_USE_XMLRPC is ON but xmlrpc is not found!")
267     ENDIF(NOT XMLRPC_FOUND)
268     SET(CMAKE_XMLRPC_INCLUDES ${XMLRPC_INCLUDE_DIRS})
269     SET(CMAKE_XMLRPC_LIBRARIES ${XMLRPC_LIBRARIES})
270   ENDIF(CTEST_USE_XMLRPC)
271   
272   #---------------------------------------------------------------------
273   # Use curses?
274   IF (UNIX)
275     # there is a bug in the Syllable libraries which makes linking ccmake fail, Alex
276     IF(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable)
277       SET(CURSES_NEED_NCURSES TRUE)
278       FIND_PACKAGE(Curses QUIET)
279       IF (CURSES_LIBRARY)
280         OPTION(BUILD_CursesDialog "Build the CMake Curses Dialog ccmake" ON)
281       ELSE (CURSES_LIBRARY)
282         MESSAGE("Curses libraries were not found. Curses GUI for CMake will not be built.")
283         SET(BUILD_CursesDialog 0)
284       ENDIF (CURSES_LIBRARY)
285     ELSE(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable)
286       SET(BUILD_CursesDialog 0)
287     ENDIF(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable)
288   ELSE (UNIX)
289     SET(BUILD_CursesDialog 0)
290   ENDIF (UNIX)
291   IF(BUILD_CursesDialog)
292     SUBDIRS(Source/CursesDialog/form)
293   ENDIF(BUILD_CursesDialog)
294 ENDMACRO (CMAKE_BUILD_UTILITIES)
298 #-----------------------------------------------------------------------
299 # The main section of the CMakeLists file
301 #-----------------------------------------------------------------------
302 # The CMake version number.
303 SET(CMake_VERSION_MAJOR 2)
304 SET(CMake_VERSION_MINOR 7)
305 SET(CMake_VERSION_PATCH 0)
307 # We use odd minor numbers for development versions.
308 # Use a date for the development patch level.
309 IF("${CMake_VERSION_MINOR}" MATCHES "[13579]$")
310   INCLUDE(${CMake_SOURCE_DIR}/Source/kwsys/kwsysDateStamp.cmake)
311   SET(CMake_VERSION_PATCH
312     "${KWSYS_DATE_STAMP_YEAR}${KWSYS_DATE_STAMP_MONTH}${KWSYS_DATE_STAMP_DAY}"
313     )
314 ENDIF("${CMake_VERSION_MINOR}" MATCHES "[13579]$")
316 SET(CMake_VERSION "${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
317 SET(CMake_VERSION_FULL "${CMake_VERSION}.${CMake_VERSION_PATCH}")
319 # Include the standard Dart testing module
320 ENABLE_TESTING()
321 INCLUDE (${CMAKE_ROOT}/Modules/Dart.cmake)
323 # where to write the resulting executables and libraries
324 SET(BUILD_SHARED_LIBS OFF)
325 SET(EXECUTABLE_OUTPUT_PATH ${CMake_BINARY_DIR}/bin CACHE INTERNAL 
326   "Where to put the executables for CMake")
327 SET(LIBRARY_OUTPUT_PATH "" CACHE INTERNAL 
328   "Where to put the libraries for CMake")
329 INCLUDE_REGULAR_EXPRESSION("^.*$")
331 # The CMake executables usually do not need any rpath to run in the build or
332 # install tree.
333 SET(CMAKE_SKIP_RPATH ON CACHE INTERNAL "CMake does not need RPATHs.")
335 SET(CMAKE_DATA_DIR "/share/cmake-${CMake_VERSION}" CACHE STRING
336   "Install location for data (relative to prefix).")
337 SET(CMAKE_DOC_DIR "/doc/cmake-${CMake_VERSION}" CACHE STRING
338   "Install location for documentation (relative to prefix).")
339 SET(CMAKE_MAN_DIR "/man" CACHE STRING
340   "Install location for man pages (relative to prefix).")
341 MARK_AS_ADVANCED(CMAKE_DATA_DIR CMAKE_DOC_DIR CMAKE_MAN_DIR)
342 STRING(REGEX REPLACE "^/" "" CMake_DATA_DEST "${CMAKE_DATA_DIR}")
344 # include special compile flags for some compilers
345 INCLUDE(CompileFlags.cmake)
347 # no clue why we are testing for this here
348 INCLUDE(CheckSymbolExists)
349 CHECK_SYMBOL_EXISTS(unsetenv "stdlib.h" HAVE_UNSETENV)
350 CHECK_SYMBOL_EXISTS(environ "stdlib.h" HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE)
352 # build the utilities (a macro defined in this file) 
353 CMAKE_BUILD_UTILITIES()
355 # On NetBSD ncurses is required, since curses doesn't have the wsyncup()
356 # function. ncurses is installed via pkgsrc, so the library is in /usr/pkg/lib,
357 # which isn't in the default linker search path. So without RPATH ccmake 
358 # doesn't run and the build doesn't succeed since ccmake is executed for
359 # generating the documentation.
360 IF(BUILD_CursesDialog)
361   GET_FILENAME_COMPONENT(_CURSES_DIR "${CURSES_LIBRARY}" PATH)
362   SET(CURSES_NEED_RPATH FALSE)
363   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")
364     SET(CURSES_NEED_RPATH TRUE)
365   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")
366 ENDIF(BUILD_CursesDialog)
368 IF(BUILD_QtDialog)
369   IF(APPLE)
370     SET(CMAKE_BUNDLE_NAME
371       "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}-${CMake_VERSION_PATCH}")
372     SET(CMAKE_BUNDLE_LOCATION "${CMAKE_INSTALL_PREFIX}")
373     # make sure CMAKE_INSTALL_PREFIX ends in /
374     STRING(LENGTH "${CMAKE_INSTALL_PREFIX}" LEN)
375     MATH(EXPR LEN "${LEN} -1" )
376     STRING(SUBSTRING "${CMAKE_INSTALL_PREFIX}" ${LEN} 1 ENDCH)
377     IF(NOT "${ENDCH}" STREQUAL "/")
378       SET(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/")
379     ENDIF(NOT "${ENDCH}" STREQUAL "/")
380     SET(CMAKE_INSTALL_PREFIX 
381       "${CMAKE_INSTALL_PREFIX}${CMAKE_BUNDLE_NAME}.app/Contents")
382   ENDIF(APPLE)
383   
384   SET(QT_NEED_RPATH FALSE)
385   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")
386     SET(QT_NEED_RPATH TRUE)
387   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")
388 ENDIF(BUILD_QtDialog)
391 # The same might be true on other systems for other libraries.
392 # Then only enable RPATH if we have are building at least with cmake 2.4, 
393 # since this one has much better RPATH features than cmake 2.2.
394 # The executables are then built with the RPATH for the libraries outside
395 # the build tree, which is both the build and the install RPATH.
396 IF (UNIX)
397   IF(   CMAKE_USE_SYSTEM_CURL   OR  CMAKE_USE_SYSTEM_ZLIB
398         OR  CMAKE_USE_SYSTEM_EXPAT  OR  CTEST_USE_XMLRPC  OR  CURSES_NEED_RPATH  OR  QT_NEED_RPATH)
399     SET(CMAKE_SKIP_RPATH OFF CACHE INTERNAL "CMake built with RPATH.")
400     SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
401     SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
402   ENDIF(CMAKE_USE_SYSTEM_CURL   OR  CMAKE_USE_SYSTEM_ZLIB
403         OR  CMAKE_USE_SYSTEM_EXPAT  OR  CTEST_USE_XMLRPC  OR  CURSES_NEED_RPATH  OR  QT_NEED_RPATH)
404 ENDIF (UNIX)
407 # add the uninstall support
408 CONFIGURE_FILE(
409   "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
410   "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
411   @ONLY)
412 ADD_CUSTOM_TARGET(uninstall
413   "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
415 INCLUDE (CMakeCPack.cmake)
417 # setup some Testing support (a macro defined in this file)
418 CMAKE_SETUP_TESTING()
419 CONFIGURE_FILE(
420   "${CMAKE_CURRENT_SOURCE_DIR}/DartLocal.conf.in"
421   "${CMAKE_CURRENT_BINARY_DIR}/DartLocal.conf"
422   COPYONLY)
424 OPTION(CMAKE_STRICT   
425   "Perform strict testing to record property and variable access. Can be used to report any undefined properties or variables" OFF)
426 MARK_AS_ADVANCED(CMAKE_STRICT)
429 # build the remaining subdirectories
430 SUBDIRS(Source)
431 SUBDIRS(Utilities)
432 SUBDIRS(Tests)
434 # add a test
435 ADD_TEST(SystemInformationNew "${CMAKE_CMAKE_COMMAND}" 
436   --system-information  -G "${CMAKE_TEST_GENERATOR}" )
438 # Install script directories.
439 INSTALL(
440   DIRECTORY Modules Templates
441   DESTINATION "${CMake_DATA_DEST}"
442   FILE_PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
443   DIRECTORY_PERMISSIONS OWNER_READ OWNER_EXECUTE OWNER_WRITE
444                         GROUP_READ GROUP_EXECUTE
445                         WORLD_READ WORLD_EXECUTE
446   PATTERN "*.sh.in" PERMISSIONS OWNER_READ OWNER_EXECUTE OWNER_WRITE
447                                 GROUP_READ GROUP_EXECUTE
448                                 WORLD_READ WORLD_EXECUTE
449   PATTERN "CVS" EXCLUDE
450   )
452 #-----------------------------------------------------------------------
453 # End of the main section of the CMakeLists file
454 #-----------------------------------------------------------------------