ENH: change the search path order (if several Tcl/Tk are installed, the "current...
[cmake.git] / Source / CMakeLists.txt
blob2720c9aad5d9838868b49135a15de314875ba411
1 CMAKE_MINIMUM_REQUIRED(VERSION 1.3)
3 SET(SRCS
4 cmake.cxx
5 cmakewizard.cxx
6 cmMakeDepend.cxx
7 cmMakefile.cxx
8 cmMakefileGenerator.cxx
9 cmRegularExpression.cxx
10 cmSourceFile.cxx
11 cmSystemTools.cxx
12 cmDirectory.cxx
13 cmCommands.cxx
14 cmTarget.cxx
15 cmCustomCommand.cxx
16 cmCacheManager.cxx
17 cmSourceGroup.cxx
18 cmListFileCache.cxx
19 cmake.h
20 cmakewizard.h
21 cmMakeDepend.h
22 cmMakefile.h
23 cmMakefileGenerator.h
24 cmRegularExpression.h
25 cmSourceFile.h
26 cmSystemTools.h
27 cmDirectory.h
28 cmCommands.h
29 cmTarget.h
30 cmCustomCommand.h
31 cmCacheManager.h
32 cmSourceGroup.h
33 cmListFileCache.h
36 # configure the .h file
37 CONFIGURE_FILE(
38 ${CMake_SOURCE_DIR}/Source/cmConfigure.cmake.h.in 
39 ${CMake_BINARY_DIR}/Source/cmConfigure.h )
41 # add the include path to find the .h 
42 INCLUDE_DIRECTORIES(${CMake_BINARY_DIR}/Source)
43 INCLUDE_DIRECTORIES(${CMake_SOURCE_DIR}/Source)
45 # let cmake know it is supposed to use it
46 ADD_DEFINITIONS(-DCMAKE_BUILD_WITH_CMAKE)
48 IF (WIN32)
49   SET(SRCS ${SRCS}
50                     cmDSWWriter.cxx 
51                     cmDSPWriter.cxx 
52                     cmMSProjectGenerator.cxx
53                     cmBorlandMakefileGenerator.cxx
54                     cmNMakeMakefileGenerator.cxx
55                     cmMSDotNETGenerator.cxx
56                     cmDSWWriter.h 
57                     cmDSPWriter.h 
58                     cmMSProjectGenerator.h
59                     cmBorlandMakefileGenerator.h
60                     cmNMakeMakefileGenerator.h
61                     cmMSDotNETGenerator.h
62                     )
63   IF(NOT UNIX)
64     IF(  NOT BORLAND )
65       LINK_LIBRARIES( rpcrt4.lib )
66       SUBDIRS(MFCDialog)
67     ENDIF( NOT BORLAND )
68   ENDIF(NOT UNIX)
69 ENDIF (WIN32)
71 SET(SRCS ${SRCS} cmUnixMakefileGenerator.cxx cmUnixMakefileGenerator.h)
74 # create a library used by the command line and the GUI
75 ADD_LIBRARY(CMakeLib ${SRCS})
76 # always link in the library
77 LINK_LIBRARIES(CMakeLib)
78 # the library is found here
79 LINK_DIRECTORIES(${CMake_BINARY_DIR}/Source)
81 ADD_EXECUTABLE(cmake cmakemain.cxx)
82 ADD_EXECUTABLE(DumpDocumentation cmDumpDocumentation)
83 ADD_EXECUTABLE(ctest ctest.cxx cmSystemTools.cxx cmRegularExpression.cxx)
85 IF (UNIX)
86   INCLUDE (${CMake_SOURCE_DIR}/Modules/FindCurses.cmake OPTIONAL)
87   IF (CURSES_LIBRARY)
88     SUBDIRS(CursesDialog/form)
89     INCLUDE(${CMake_SOURCE_DIR}/Source/CursesDialog/CMakeLists.txt)
90   ENDIF (CURSES_LIBRARY)
91 ENDIF (UNIX)
93 IF (NOT DART_ROOT)
94 SET(MAKEPROGRAM ${CMAKE_MAKE_PROGRAM})
95 ENDIF (NOT DART_ROOT)
97 CONFIGURE_FILE(
98   ${CMake_SOURCE_DIR}/Source/cmaketest.h.in 
99   ${CMake_BINARY_DIR}/Source/cmaketest.h ESCAPE_QUOTES)
101 ADD_EXECUTABLE(cmaketest cmaketest.cxx cmSystemTools.cxx)
104 IF(BUILD_TESTING)
105     ADD_TEST(DumpDocumentation ${CMake_BINARY_DIR}/Source/DumpDocumentation
106       ${CMake_BINARY_DIR}/CMakeDoc.html)
108     ADD_TEST(simple ${CMake_BINARY_DIR}/Source/cmaketest 
109       ${CMake_SOURCE_DIR}/Tests/Simple 
110       ${CMake_BINARY_DIR}/Tests/Simple 
111       simple)
113     ADD_TEST(conly ${CMake_BINARY_DIR}/Source/cmaketest 
114       ${CMake_SOURCE_DIR}/Tests/COnly 
115       ${CMake_BINARY_DIR}/Tests/COnly 
116       conly)
118     ADD_TEST(complex ${CMake_BINARY_DIR}/Source/cmaketest 
119       ${CMake_SOURCE_DIR}/Tests/Complex 
120       ${CMake_BINARY_DIR}/Tests/Complex 
121       complex 
122       ${CMake_BINARY_DIR}/Tests/Complex/bin)
124     ADD_TEST(Example ${CMake_BINARY_DIR}/Source/cmaketest 
125       ${CMake_SOURCE_DIR}/Example
126       ${CMake_BINARY_DIR}/Example
127       helloDemo
128       ${CMake_BINARY_DIR}/Example/Demo
129       HELLO)
131     ADD_TEST(testing ${CMake_BINARY_DIR}/Source/cmaketest 
132       ${CMake_SOURCE_DIR}/Tests/Testing 
133       ${CMake_BINARY_DIR}/Tests/Testing
134       testing
135       ${CMake_BINARY_DIR}/Tests/Testing/bin)
137     ADD_TEST(wrapping ${CMake_BINARY_DIR}/Source/cmaketest 
138       ${CMake_SOURCE_DIR}/Tests/Wrapping 
139       ${CMake_BINARY_DIR}/Tests/Wrapping
140       wrapping
141       ${CMake_BINARY_DIR}/Tests/Wrapping/bin)
143     ADD_TEST(testdriver1 ${CMake_BINARY_DIR}/Source/cmaketest 
144       ${CMake_SOURCE_DIR}/Tests/TestDriver 
145       ${CMake_BINARY_DIR}/Tests/TestDriver
146       TestDriverTest
147       ${CMake_BINARY_DIR}/Tests/Wrapping/bin
148       TestDriverTest test1)
150     ADD_TEST(testdriver2 ${CMake_BINARY_DIR}/Source/cmaketest 
151       ${CMake_SOURCE_DIR}/Tests/TestDriver 
152       ${CMake_BINARY_DIR}/Tests/TestDriver
153       TestDriverTest
154       ${CMake_BINARY_DIR}/Tests/Wrapping/bin
155       TestDriverTest test2)
157     ADD_TEST(testdriver3 ${CMake_BINARY_DIR}/Source/cmaketest 
158       ${CMake_SOURCE_DIR}/Tests/TestDriver 
159       ${CMake_BINARY_DIR}/Tests/TestDriver
160       TestDriverTest
161       ${CMake_BINARY_DIR}/Tests/Wrapping/bin
162       TestDriverTest subdir/test3)
164     ADD_TEST(dependency_w_libout ${CMake_BINARY_DIR}/Source/cmaketest 
165       ${CMake_SOURCE_DIR}/Tests/Dependency 
166       ${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut
167       exec
168       ${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut/Exec
169       Dependency CMAKE_ARGS -DLIBRARY_OUTPUT_PATH:PATH=${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut/Lib)
171     ADD_TEST(dependency_wo_lib_out ${CMake_BINARY_DIR}/Source/cmaketest 
172       ${CMake_SOURCE_DIR}/Tests/Dependency 
173       ${CMake_BINARY_DIR}/Tests/Dependency/WOLibOut
174       exec
175       ${CMake_BINARY_DIR}/Tests/Dependency/WOLibOut/Exec
176       Dependency)
178     ADD_TEST(dependency2 ${CMake_BINARY_DIR}/Source/cmaketest 
179       ${CMake_SOURCE_DIR}/Tests/Dependency 
180       ${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut
181       exec2
182       ${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut/Exec2
183       Dependency CMAKE_ARGS -DLIBRARY_OUTPUT_PATH:PATH=${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut/Lib)
185     ADD_TEST(dependency3 ${CMake_BINARY_DIR}/Source/cmaketest 
186       ${CMake_SOURCE_DIR}/Tests/Dependency 
187       ${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut
188       exec3
189       ${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut/Exec3
190       Dependency CMAKE_ARGS -DLIBRARY_OUTPUT_PATH:PATH=${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut/Lib)
192     ADD_TEST(dependency4 ${CMake_BINARY_DIR}/Source/cmaketest 
193       ${CMake_SOURCE_DIR}/Tests/Dependency 
194       ${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut
195       exec4
196       ${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut/Exec4
197       Dependency CMAKE_ARGS -DLIBRARY_OUTPUT_PATH:PATH=${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut/Lib)
199     ADD_TEST(linkline ${CMake_BINARY_DIR}/Source/cmaketest 
200       ${CMake_SOURCE_DIR}/Tests/LinkLine
201       ${CMake_BINARY_DIR}/Tests/LinkLine
202       Exec
203       ${CMake_BINARY_DIR}/Tests/LinkLine
204       LinkLine)
206   ENDIF (DART_ROOT)
207 ENDIF(BUILD_TESTING)
210 INCLUDE (${CMAKE_BINARY_DIR}/Source/LocalUserOptions.cmake OPTIONAL)
211 INCLUDE (${CMAKE_SOURCE_DIR}/Source/LocalUserOptions.cmake OPTIONAL)
213 INSTALL_TARGETS(/bin cmake)
214 INSTALL_TARGETS(/bin ctest)
215 INSTALL_TARGETS(/bin cmaketest)