Mercurial > projects > qtd
annotate CMakeLists.txt @ 273:2161595da42b
Unittest flags.
author | SokoL_SD |
---|---|
date | Mon, 28 Sep 2009 05:20:16 +0000 |
parents | 6cd923119ab1 |
children | f5606687c578 |
rev | line source |
---|---|
132 | 1 cmake_minimum_required(VERSION 2.6) |
2 PROJECT(qtd CXX C) | |
235
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
3 |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
4 ########################################################## |
264
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
5 ## Build generator. |
235
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
6 ########################################################## |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
7 if(NOT SECOND_RUN) |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
8 |
242 | 9 option(ALLOW_IN_SOURCE_BUILDS "Allow in-source builds" "OFF") |
10 if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR AND NOT ALLOW_IN_SOURCE_BUILDS) | |
239 | 11 message(FATAL_ERROR "In-source builds are not allowed. |
241 | 12 Please create a directory and run cmake from there, passing the path |
239 | 13 to this source directory as the last argument. |
241 | 14 This process created the file `CMakeCache.txt` and the directory `CMakeFiles'. |
239 | 15 Please delete them. |
241 | 16 |
242 | 17 Or you can restart cmake with `-DALLOW_IN_SOURCE_BUILDS=1`, but it is not |
254 | 18 recommended. |
239 | 19 ") |
242 | 20 endif(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR AND NOT ALLOW_IN_SOURCE_BUILDS) |
239 | 21 |
132 | 22 FIND_PACKAGE(Qt4 REQUIRED) |
227 | 23 set (QT_USE_QTMAIN false) |
24 set (QT_USE_QTGUI false) | |
132 | 25 |
26 ##-------------------------------------------- | |
27 ## Settings. | |
28 ##-------------------------------------------- | |
29 | |
30 ## Options. | |
136
798e54c1f66e
CMake: disable building examples by default. You can use -DBUILD_EXAMPLES switch for enable that.
SokoL_SD
parents:
135
diff
changeset
|
31 option(BUILD_EXAMPLES "Build examples" "OFF") |
798e54c1f66e
CMake: disable building examples by default. You can use -DBUILD_EXAMPLES switch for enable that.
SokoL_SD
parents:
135
diff
changeset
|
32 option(BUILD_SHARED_LIBRARIES "Build shared library (very experemental and only for ldc)" "OFF") |
132 | 33 option(BUILD_TOOLS "Build tools" "ON") |
34 #option(GENERATE_DI_FILES "Generate *.di files with DC -H command" "OFF") | |
136
798e54c1f66e
CMake: disable building examples by default. You can use -DBUILD_EXAMPLES switch for enable that.
SokoL_SD
parents:
135
diff
changeset
|
35 set(GENERATE_DI_FILES OFF) ## Very experemental option. Temporary disabled. |
132 | 36 |
273 | 37 |
235
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
38 set(all_packages Core Gui OpenGL Xml Svg Network WebKit CACHE INTERNAL "") |
132 | 39 |
40 ## Init D toolkit. | |
41 set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) | |
42 FIND_PACKAGE(D REQUIRED) | |
43 | |
44 if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT OR "${CMAKE_INSTALL_PREFIX}" STREQUAL "") | |
45 set(CMAKE_INSTALL_PREFIX | |
241 | 46 ${DC_PATH} CACHE PATH "QtD install prefix" |
132 | 47 ) |
48 endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT OR "${CMAKE_INSTALL_PREFIX}" STREQUAL "") | |
49 | |
50 # Check D compiler version | |
51 if(D_VERSION EQUAL "1") | |
52 if (D_FRONTEND LESS "041") | |
53 message(STATUS "Minimum required version of D compiler is 1.041 (or compiler based on this version)") | |
54 endif(D_FRONTEND LESS "041") | |
235
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
55 set(D_TARGET d1-tango CACHE INTERNAL "") |
132 | 56 elseif(D_VERSION EQUAL "2") |
235
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
57 set(D_TARGET d2-phobos CACHE INTERNAL "") |
132 | 58 endif(D_VERSION EQUAL "1") |
59 | |
60 # Debug and release flags. | |
61 if (NOT CMAKE_BUILD_TYPE) | |
62 set(CMAKE_BUILD_TYPE Release) | |
63 endif (NOT CMAKE_BUILD_TYPE) | |
64 if(${CMAKE_BUILD_TYPE} MATCHES [dD][eE][bB][uU][gG]) | |
65 set(CMAKE_BUILD_TYPE Debug) | |
66 #set( SUFFIXLIB "${SUFFIXLIB}-debug" ) | |
67 #set( SUFFIXBIN "${SUFFIXBIN}-debug" ) | |
68 add_definitions(-DDEBUG) | |
69 elseif (NOT ${CMAKE_BUILD_TYPE} MATCHES [rR][eE][lL][eE][aA][sS]) | |
264
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
70 message(STATUS "Only debug and release configurations are supproted. The configuration is changed to 'Release'") |
132 | 71 set(CMAKE_BUILD_TYPE Release) |
72 endif (${CMAKE_BUILD_TYPE} MATCHES [dD][eE][bB][uU][gG]) | |
73 if (${CMAKE_BUILD_TYPE} MATCHES [rR][eE][lL][eE][aA][sS]) | |
74 #add_definitions(-UNO_DEBUG) | |
75 endif(${CMAKE_BUILD_TYPE} MATCHES [rR][eE][lL][eE][aA][sS] ) | |
76 | |
237 | 77 # System specific settings. |
132 | 78 if(CMAKE_HOST_WIN32) |
79 set(implib implib) | |
80 find_program(IMPLIB ${implib}) | |
81 if (NOT IMPLIB) | |
244 | 82 message(FATAL_ERROR "implib is not found. You can donwload it from http://ftp.digitalmars.com/bup.zip") |
132 | 83 endif (NOT IMPLIB) |
84 if(D_IS_MARS) | |
85 set(GEN_OPT ${GEN_OPT} --cpp_shared) | |
86 add_definitions(-DCPP_SHARED) | |
87 endif(D_IS_MARS) | |
235
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
88 endif(CMAKE_HOST_WIN32) |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
89 |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
90 set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} ./) |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
91 set(GEN_OPT ${GEN_OPT} --d-target=${D_TARGET}) |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
92 |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
93 set(packages CACHE INTERNAL "") |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
94 foreach(package_big ${all_packages}) |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
95 string(TOLOWER ${package_big} package) |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
96 string(TOUPPER ${package_big} package_upper) |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
97 option(BUILD_QT_${package_upper} "Build Qt${package_big}" "ON") |
243 | 98 if(BUILD_QT_${package_upper}) |
265 | 99 set(packages ${packages} ${package_big}) |
243 | 100 endif(BUILD_QT_${package_upper}) |
235
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
101 endforeach(package_big ${all_packages}) |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
102 |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
103 add_subdirectory(generator) |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
104 |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
105 add_custom_target(main ALL) |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
106 add_dependencies(main dgen) |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
107 |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
108 if(${CMAKE_GENERATOR} STREQUAL "NMake Makefiles") |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
109 set(make_util nmake) |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
110 elseif(${CMAKE_GENERATOR} STREQUAL "MinGW Makefiles" OR |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
111 ${CMAKE_GENERATOR} STREQUAL "Unix Makefiles") |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
112 set(make_util $(MAKE)) |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
113 else(${CMAKE_GENERATOR} STREQUAL "NMake Makefiles") |
264
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
114 message(FATAL_ERROR "${CMAKE_GENERATOR} is not supported") |
235
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
115 endif(${CMAKE_GENERATOR} STREQUAL "NMake Makefiles") |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
116 |
239 | 117 if(${CMAKE_BINARY_DIR} STREQUAL ${CMAKE_SOURCE_DIR}) |
118 set(cd_path ${CMAKE_SOURCE_DIR}) | |
119 else(${CMAKE_BINARY_DIR} STREQUAL ${CMAKE_SOURCE_DIR}) | |
120 set(cd_path ${CMAKE_BINARY_DIR}/build) | |
121 endif(${CMAKE_BINARY_DIR} STREQUAL ${CMAKE_SOURCE_DIR}) | |
122 | |
235
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
123 make_native_path(cd_path) |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
124 add_custom_command(TARGET main POST_BUILD |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
125 COMMAND ${CMAKE_COMMAND} ARGS -E make_directory ${CMAKE_BINARY_DIR}/build |
237 | 126 COMMAND cd ARGS ${cd_path} && ${CMAKE_COMMAND} -G${CMAKE_GENERATOR} -DSECOND_RUN=1 ${CMAKE_SOURCE_DIR} && ${make_util} |
235
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
127 COMMENT "" |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
128 ) |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
129 |
264
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
130 ## "Make install" command. |
235
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
131 set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${CMAKE_BINARY_DIR}/build) |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
132 add_custom_target(install |
240 | 133 COMMAND cd ${CMAKE_BINARY_DIR}/build && ${make_util} install |
235
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
134 COMMENT "" |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
135 ) |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
136 add_dependencies(install preinstall) |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
137 |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
138 ##-------------------------------------------- |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
139 ## CPack. |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
140 ##-------------------------------------------- |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
141 set(CPACK_PACKAGE_VERSION_PATCH 1) |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
142 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "QtD is a D binding to the Qt application and UI framework. |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
143 This package installs binding and static library for qt port on D programming language. |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
144 ") |
241 | 145 SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/changelog.txt") |
235
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
146 SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/license.txt") |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
147 set(CPACK_PACKAGE_VENDOR "QtD team") |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
148 set(CPACK_PACKAGE_CONTACT "e@mail.ru" ) |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
149 SET(CPACK_PACKAGE_VERSION "0.1") |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
150 set(CPACK_PACKAGE_INSTALL_DIRECTORY "qtd ${CPACK_PACKAGE_VERSION}") |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
151 set(CPACK_PACKAGE_FILE_NAME "qtd-${CPACK_PACKAGE_VERSION}") |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
152 set(CPACK_SOURCE_PACKAGE_FILE_NAME "qtd-${CPACK_PACKAGE_VERSION}") |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
153 if(CMAKE_HOST_WIN32) |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
154 set(CPACK_GENERATOR "ZIP") |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
155 elseif(CMAKE_HOST_UNIX) |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
156 set(CPACK_GENERATOR "TBZ2;DEB;RPM") |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
157 endif(CMAKE_HOST_WIN32) |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
158 include(CPack) |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
159 |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
160 ########################################################## |
264
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
161 ## Build QtD. |
235
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
162 ########################################################## |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
163 else(NOT SECOND_RUN) |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
164 |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
165 PROJECT(qtd CXX C) |
240 | 166 if(NOT ${CMAKE_BINARY_DIR} STREQUAL ${CMAKE_SOURCE_DIR}) |
167 load_cache(${CMAKE_BINARY_DIR}/.. INCLUDE_INTERNALS all_packages QTD_VERSION_STR QTD_VERSION) | |
241 | 168 endif(NOT ${CMAKE_BINARY_DIR} STREQUAL ${CMAKE_SOURCE_DIR}) |
235
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
169 set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
170 FIND_PACKAGE(D REQUIRED) |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
171 FIND_PACKAGE(Qt4 REQUIRED) |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
172 |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
173 set(QTD_VERSION_STR ${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH}) |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
174 math(EXPR QTD_VERSION "(${QT_VERSION_MAJOR} << 16) + (${QT_VERSION_MINOR} << 8) + ${QT_VERSION_PATCH}") |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
175 |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
176 include_directories(${QT_INCLUDES} ${CMAKE_SOURCE_DIR}/include ${CMAKE_CURRENT_BINARY_DIR}/include) |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
177 |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
178 # System specifc settings. |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
179 if(CMAKE_HOST_WIN32) |
132 | 180 string(REGEX REPLACE ".dll([A-Za-z\\.0-9]+)" "\\1" CMAKE_IMPORT_LIBRARY_SUFFIX "${CMAKE_IMPORT_LIBRARY_SUFFIX}") |
181 endif(CMAKE_HOST_WIN32) | |
182 | |
229 | 183 if(CMAKE_HOST_WIN32 AND D_IS_MARS) |
235
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
184 set(CPP_SHARED 1 CACHE INTERNAL "") |
229 | 185 endif(CMAKE_HOST_WIN32 AND D_IS_MARS) |
186 | |
235
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
187 if(D_IS_MARS) |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
188 set(D_FLAGS -version=cpp_shared) |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
189 add_definitions(-DCPP_SHARED) |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
190 endif(D_IS_MARS) |
132 | 191 |
273 | 192 if(UNITTEST) |
193 add_d_versions(QtdUnittest) | |
194 endif(UNITTEST) | |
195 | |
132 | 196 ## Bootstrap settings for QtD. |
235
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
197 set(DRCC ${CMAKE_BINARY_DIR}/tools/drcc/drcc CACHE INTERNAL "") |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
198 set(DUIC ${CMAKE_BINARY_DIR}/tools/duic/duic CACHE INTERNAL "") |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
199 set(QTD_IMPORT_PATH ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/qt/d${D_VERSION} CACHE INTERNAL "") |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
200 set(QTD_LIBRARIES_PATH ${CMAKE_BINARY_DIR}/lib CACHE INTERNAL "") |
132 | 201 |
202 ##-------------------------------------------- | |
182
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
203 ## Macros and functions. |
132 | 204 ##-------------------------------------------- |
205 | |
235
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
206 macro(load_generated_classes ) |
237 | 207 include(${CMAKE_BINARY_DIR}/cpp/qt_${package}/qt_${package}.txt) |
235
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
208 endmacro(load_generated_classes ) |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
209 |
182
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
210 macro(qtd_add_resource output) |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
211 set (params NAME OPTIONS) |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
212 qtd_parse_params (RESOURCES params ${ARGN}) |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
213 if(NAME_tmp) |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
214 set(OPTIONS_tmp ${OPTIONS_tmp} -name ${NAME_tmp}) |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
215 endif(NAME_tmp) |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
216 qtd_command ("${output}" "${DRCC}" "${OPTIONS_tmp}" "qrc_" |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
217 "Generate" ${RESOURCES_tmp}) |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
218 endmacro(qtd_add_resource output) |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
219 |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
220 macro(qtd_wrap_ui output) |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
221 set (params OPTIONS) |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
222 qtd_parse_params (UI params ${ARGN}) |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
223 qtd_command ("${output}" "${DUIC}" "${OPTIONS_tmp}" "uic_" |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
224 "Generate" ${UI_tmp}) |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
225 endmacro(qtd_wrap_ui output) |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
226 |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
227 macro(qtd_command output command options prefix comment) |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
228 foreach(file "${ARGN}") |
241 | 229 ## Test an exist of the input file. |
182
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
230 get_filename_component(file_path ${file} PATH) |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
231 get_filename_component(file_name ${file} NAME_WE) |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
232 get_filename_component(file_ext ${file} EXT) |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
233 |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
234 set(out ${CMAKE_CURRENT_BINARY_DIR}/${file_path}${prefix}${file_name}.d) |
132 | 235 add_custom_command(OUTPUT "${out}" |
182
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
236 COMMAND "${command}" |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
237 ARGS ${options} ${file} -o ${out} |
132 | 238 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} |
182
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
239 DEPENDS ${file} |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
240 COMMENT "${comment} ${file}" |
132 | 241 ) |
242 set(${output} ${${output}} ${out}) | |
182
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
243 endforeach(file "${ARGN}") |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
244 endmacro(qtd_command output command options files prefix comment) |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
245 |
264
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
246 ## Parses the parameters list. |
182
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
247 macro(qtd_parse_params default params) |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
248 set(type_tmp ${default}) |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
249 set(params_tmp ${default} ${${params}}) |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
250 foreach(param_tmp ${params_tmp}) |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
251 set(${param_tmp}_tmp ) |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
252 endforeach(param_tmp ${params_tmp}) |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
253 foreach(arg_tmp ${ARGN}) |
241 | 254 set(found_type_tmp) |
255 if(NOT found_type_tmp) | |
182
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
256 foreach(param_tmp ${params_tmp}) |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
257 if(arg_tmp STREQUAL param_tmp) |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
258 set(type_tmp ${param_tmp}) |
241 | 259 set(found_type_tmp 1) |
182
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
260 break(param_tmp ${params_tmp}) |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
261 endif(arg_tmp STREQUAL param_tmp) |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
262 endforeach(param_tmp ${params_tmp}) |
241 | 263 endif(NOT found_type_tmp) |
264 if(NOT found_type_tmp) | |
182
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
265 set(${type_tmp}_tmp ${${type_tmp}_tmp} ${arg_tmp}) |
241 | 266 endif(NOT found_type_tmp) |
182
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
267 endforeach(arg_tmp ${ARGN}) |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
268 endmacro(qtd_parse_params default) |
132 | 269 |
264
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
270 ## Adds a new example. |
132 | 271 ## name -- example name. |
272 ## Options: | |
264
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
273 ## PACKAGES -- list of packages for link to example (for example, QtCore QtGui QtOpenGL). |
132 | 274 ## Default value is "QtCore QtGui". |
275 ## params -- sources d files. | |
276 ## Usage: | |
277 ## build_example(ExampleName PACKAGES QtCore QtGui QtXml main.d another_d_file.d) | |
278 macro(build_example name) | |
182
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
279 set (params UIC RESOURCES PACKAGES) |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
280 qtd_parse_params (SOURCES params ${ARGN}) |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
281 |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
282 if(NOT PACKAGES_tmp) |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
283 set(PACKAGES_tmp QtCore QtGui) |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
284 endif(NOT PACKAGES_tmp) |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
285 |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
286 if(RESOURCES_tmp) |
132 | 287 if(NOT BUILD_TOOLS) |
264
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
288 message(STATUS "Example '${name}' requires drcc. Example will not be built") |
132 | 289 return(build_example name) |
290 endif(NOT BUILD_TOOLS) | |
182
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
291 qtd_add_resource(res_sources ${RESOURCES_tmp} NAME ${name} ) |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
292 endif(RESOURCES_tmp) |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
293 |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
294 if(UIC_tmp) |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
295 if(NOT BUILD_TOOLS) |
264
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
296 message(STATUS "Example '${name}' requires drcc. Example will not be built") |
182
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
297 return(build_example name) |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
298 endif(NOT BUILD_TOOLS) |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
299 qtd_wrap_ui(uic_sources ${UIC_tmp}) |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
300 endif(UIC_tmp) |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
301 |
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
302 foreach(package ${PACKAGES_tmp}) |
132 | 303 string(REGEX REPLACE "Qt([A-Za-z0-9])" "\\1" req "${package}") |
304 set(is_founded) | |
305 foreach(package_big ${packages_big}) | |
306 string(TOLOWER ${package_big} package) | |
307 if(${req} STREQUAL ${package_big}) | |
308 set(is_founded 1) | |
309 break(package_big ${packages_big}) | |
310 endif(${req} STREQUAL ${package_big}) | |
311 endforeach(package_big ${packages_big}) | |
312 if(NOT is_founded) | |
264
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
313 message(STATUS "Example '${name}' requires the package '${req}', but it is not active. Example will not be built") |
132 | 314 return(build_example name) |
315 else(NOT is_founded) | |
316 set(qtd_libs ${${package}_lib_param} ${qtd_libs}) | |
317 endif(NOT is_founded) | |
182
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
318 endforeach(package ${PACKAGES_tmp}) |
203
d3383b16f1d7
Add a 'NO_DEPS_SOURCES' option to the 'add_d_target' macro. And use it for resources and forms in QtD examples.
SokoL_SD
parents:
195
diff
changeset
|
319 add_d_program(${name} ${SOURCES_tmp} NO_DEPS_SOURCES ${res_sources} ${uic_sources} |
182
973564c7e388
CMake: add an UIC option in the build_example macro.
SokoL_SD
parents:
177
diff
changeset
|
320 DEPENDS ${res_sources} INCLUDES ${QTD_IMPORT_PATH} ${CMAKE_CURRENT_BINARY_DIR} |
132 | 321 LIB_PATHS ${QTD_LIBRARIES_PATH} ${CMAKE_SOURCE_DIR}/lib LIBS ${qtd_libs}) |
264
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
322 ## TODO: Uncomment. |
235
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
323 #if(STRIP AND ${CMAKE_BUILD_TYPE} EQUAL "Release" AND CMAKE_HOST_UNIX) ## |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
324 # add_custom_command(TARGET example_${name} POST_BUILD COMMAND "${STRIP}" ARGS "${output}") |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
325 #endif(STRIP AND ${CMAKE_BUILD_TYPE} EQUAL "Release" AND CMAKE_HOST_UNIX) |
237 | 326 add_dependencies(examples ${name}) |
327 add_dependencies(${name} allpackages tools) | |
132 | 328 endmacro(build_example sources) |
329 | |
330 ##-------------------------------------------- | |
264
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
331 ## Build and install the QtD libraries. |
132 | 332 ##-------------------------------------------- |
333 | |
334 file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/lib) | |
335 add_custom_target(allpackages) | |
336 link_directories(${CMAKE_BINARY_DIR}/CMakeFiles) | |
337 | |
338 foreach(package_big ${all_packages}) | |
339 string(TOLOWER ${package_big} package) | |
264
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
340 string(TOUPPER ${package} package_upper) |
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
341 ## Load settings for the package. |
132 | 342 set(required) |
343 set(d_objs) | |
344 set(cpp_objs) | |
345 set(d_sources) | |
346 set(cpp_sources) | |
347 set(lib_name) | |
348 set(link_cpp) | |
349 set(link_d) | |
350 set(cpp_files) | |
227 | 351 set(cpp_generated_files) |
132 | 352 set(d_files) |
353 set(classes) | |
354 set(d_generated_files) | |
355 set(d_version_files) | |
356 set(link_example) | |
357 include (${CMAKE_SOURCE_DIR}/build/${package}.txt) | |
358 | |
359 set(all_req_found 1) | |
360 if(BUILD_QT_${package_upper}) | |
361 foreach(req ${required}) | |
362 set(req_found) | |
363 foreach(pack ${packages_big}) | |
364 if(${pack} STREQUAL ${req}) | |
365 set(req_found 1) | |
366 endif(${pack} STREQUAL ${req}) | |
367 endforeach(pack ${packages}) | |
368 if(NOT req_found) | |
369 set(req_found) | |
370 foreach(pack ${all_packages}) | |
371 if(${pack} STREQUAL ${req}) | |
372 set(req_found 1) | |
373 endif(${pack} STREQUAL ${req}) | |
374 endforeach(pack ${all_packages}) | |
375 if(req_found) | |
244 | 376 message(STATUS "Package '${package_big}' requires '${req}', but it is not active") |
132 | 377 else(req_found) |
244 | 378 message(STATUS "Package '${package_big}' requires '${req}', but it is not found") |
132 | 379 endif(req_found) |
380 set(all_req_found) | |
381 endif(NOT req_found) | |
382 endforeach(req ${required}) | |
383 else(BUILD_QT_${package_upper}) | |
384 set(all_req_found) | |
385 endif(BUILD_QT_${package_upper}) | |
386 | |
387 if("${all_req_found}" EQUAL 1) | |
388 set(packages_big ${packages_big} ${package_big}) | |
389 set(packages ${packages} ${package}) | |
264
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
390 ## Load a package sources list. |
177 | 391 foreach(d_source ${package}/ArrayOps2 ${d_generated_files}) |
132 | 392 set(d_sources ${d_sources} ${CMAKE_BINARY_DIR}/qt/${d_source}.d) |
393 endforeach(d_source ${d_generated_files}) | |
394 set(classes ArrayOps ${classes}) | |
395 foreach(class ${classes}) | |
265 | 396 set(d_sources ${d_sources} ${CMAKE_BINARY_DIR}/qt/${package}/${class}.d) |
397 set(cpp_sources ${cpp_sources} ${CMAKE_BINARY_DIR}/cpp/qt_${package}/${class}_shell.cpp) | |
398 if(EXISTS ${CMAKE_BINARY_DIR}/qt/${package}/${class}_aux.d) | |
399 set(d_sources ${d_sources} ${CMAKE_BINARY_DIR}/qt/${package}/${class}_aux.d) | |
400 endif(EXISTS ${CMAKE_BINARY_DIR}/qt/${package}/${class}_aux.d) | |
132 | 401 endforeach(class ${classes}) |
402 set(files_for_gen ${files_for_gen} ${cpp_sources} ${d_sources}) | |
403 | |
404 foreach (cpp_source ${cpp_files}) | |
405 set(cpp_sources ${cpp_sources} ${CMAKE_SOURCE_DIR}/cpp/${cpp_source}.cpp) | |
227 | 406 endforeach(cpp_source ${cpp_files}) |
407 foreach (cpp_source ${cpp_generated_files}) | |
408 set(cpp_sources ${cpp_sources} ${CMAKE_BINARY_DIR}/cpp/${cpp_source}.cpp) | |
409 endforeach(cpp_source ${cpp_generated_files}) | |
132 | 410 foreach(d_source ${d_version_files}) |
411 set(d_sources ${d_sources} ${CMAKE_SOURCE_DIR}/qt/d${D_VERSION}/qt/${d_source}.d) | |
412 endforeach(d_source ${d_version_files}) | |
413 foreach(d_source ${d_files}) | |
414 set(d_sources ${d_sources} ${CMAKE_SOURCE_DIR}/qt/${d_source}.d) | |
415 endforeach(d_source ${d_files}) | |
416 | |
417 if(NOT GENERATE_DI_FILES) | |
418 foreach(d_source ${d_sources}) | |
264
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
419 get_filename_component(path ${d_source} PATH) |
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
420 get_filename_component(name ${d_source} NAME_WE) |
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
421 regex_safe_string(cbd_safe_tmp ${CMAKE_CURRENT_BINARY_DIR}) |
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
422 regex_safe_string(csd_safe_tmp ${CMAKE_CURRENT_SOURCE_DIR}) |
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
423 regex_safe_string(ver_safe_tmp ${CMAKE_CURRENT_SOURCE_DIR}/qt/d${D_VERSION}) |
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
424 set(regexp_str_tmp "(${ver_safe_tmp}/|${cbd_safe_tmp}/|${csd_safe_tmp}/|)(.+)") |
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
425 string(REGEX REPLACE ${regexp_str_tmp} "\\2" ins_path "${path}") |
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
426 install(FILES ${d_source} DESTINATION include/d/${ins_path} COMPONENT qtd RENAME ${name}.di) |
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
427 install(FILES ${path}/${name}_enum.d DESTINATION include/d/${ins_path} COMPONENT qtd RENAME ${name}_enum.di OPTIONAL) |
132 | 428 endforeach(d_source ${d_sources}) |
429 endif(NOT GENERATE_DI_FILES) | |
430 | |
264
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
431 ## Build the CPP part. |
229 | 432 if(CPP_SHARED) |
433 set(cpp_method SHARED) | |
434 else(CPP_SHARED) | |
435 set(cpp_method STATIC) | |
436 endif(CPP_SHARED) | |
264
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
437 add_library(cpp_${package} ${cpp_method} ${cpp_sources}) |
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
438 set_property(TARGET cpp_${package} PROPERTY RUNTIME_OUTPUT_DIRECTORY lib) |
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
439 set_property(TARGET cpp_${package} PROPERTY ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/CMakeFiles) |
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
440 set(link_cpp ${link_cpp} ${QT_QT${package_upper}_LIBRARY}) |
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
441 target_link_libraries(cpp_${package} ${link_cpp} ) |
229 | 442 if(CPP_SHARED) |
443 else(CPP_SHARED) | |
264
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
444 ## Get an objects list. It will be used in building the D part. |
132 | 445 foreach(cpp_source ${cpp_sources}) |
446 set(cpp_source ${cpp_source}) | |
447 obj_path(cpp_source) | |
448 set(cpp_objs ${cpp_objs} ${CMAKE_BINARY_DIR}/CMakeFiles/cpp_${package}.dir/${cpp_source}${CMAKE_CXX_OUTPUT_EXTENSION}) | |
449 endforeach(cpp_source ${cpp_sources}) | |
229 | 450 endif(CPP_SHARED) |
264
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
451 |
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
452 ## Settings for the D part. |
132 | 453 set(lib_name qtd${package}) |
136
798e54c1f66e
CMake: disable building examples by default. You can use -DBUILD_EXAMPLES switch for enable that.
SokoL_SD
parents:
135
diff
changeset
|
454 if(BUILD_SHARED_LIBRARIES) |
132 | 455 set(lib lib/${CMAKE_SHARED_LIBRARY_PREFIX}${lib_name}${CMAKE_SHARED_LIBRARY_SUFFIX}) |
456 set(build_type SHARED) | |
136
798e54c1f66e
CMake: disable building examples by default. You can use -DBUILD_EXAMPLES switch for enable that.
SokoL_SD
parents:
135
diff
changeset
|
457 else(BUILD_SHARED_LIBRARIES) |
132 | 458 set(lib lib/${D_LIB_PREFIX}${lib_name}${D_LIB_SUFFIX}) |
459 set(build_type STATIC) | |
136
798e54c1f66e
CMake: disable building examples by default. You can use -DBUILD_EXAMPLES switch for enable that.
SokoL_SD
parents:
135
diff
changeset
|
460 endif(BUILD_SHARED_LIBRARIES) |
132 | 461 |
264
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
462 ## A test of packages dependencies. |
132 | 463 foreach(req ${required}) |
464 set(is_found) | |
465 foreach(pack ${packages_big}) | |
466 if("${pack}" STREQUAL "${req}") | |
467 set(is_found 1) | |
468 break(pack ${packages_big}) | |
469 endif("${pack}" STREQUAL "${req}") | |
470 endforeach(pack ${packages_big}) | |
471 if(NOT is_found) | |
244 | 472 message(FATAL_ERROR "Package ${package_big} requires ${req}, but it is not found") |
132 | 473 endif(NOT is_found) |
474 string(TOUPPER ${req} req_upper) | |
475 string(TOLOWER ${req} req_lower) | |
476 set(link_cpp ${link_cpp} cpp_${req_lower} ${QT_QT${req_upper}_LIBRARY}) | |
477 endforeach(req ${require}) | |
478 set(d_objs ${d_objs} ${objects}) | |
479 | |
229 | 480 if(CPP_SHARED) |
264
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
481 ## Create an implib library which will be linked to the D part. |
136
798e54c1f66e
CMake: disable building examples by default. You can use -DBUILD_EXAMPLES switch for enable that.
SokoL_SD
parents:
135
diff
changeset
|
482 set(cpp_lib ${CMAKE_BINARY_DIR}/lib/libcpp_${package}.dll) |
132 | 483 set(cpp_lib_native ${cpp_lib}) |
484 make_native_path(cpp_lib_native) | |
485 set(d_implib ${CMAKE_BINARY_DIR}/CMakeFiles/${package}.dir/cpp_${package}.lib) | |
486 set(d_implib_native ${d_implib}) | |
487 make_native_path(d_implib_native) | |
488 add_custom_command( | |
489 OUTPUT "${d_implib}" | |
490 COMMAND "${IMPLIB}" | |
491 ARGS /system /PAGESIZE:32 ${d_implib_native} ${cpp_lib_native} | |
492 DEPENDS "cpp_${package}" | |
493 COMMENT "Creating implib ${lib_name}" | |
494 ) | |
495 install(FILES ${cpp_lib} COMPONENT qtd DESTINATION lib) | |
229 | 496 else(CPP_SHARED) |
264
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
497 set(${package}_lib_param Qt${package_big}) |
229 | 498 endif(CPP_SHARED) |
264
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
499 ## Link the D part. |
215 | 500 add_d_target(${lib_name} NOT_DETECT_DEPENDS TYPE ${build_type} INCLUDES ${QTD_IMPORT_PATH} SOURCES ${d_sources} OBJECTS ${cpp_objs} ${d_implib} |
235
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
501 OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib DEPENDS ${d_implib} ) |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
502 install(FILES ${CMAKE_BINARY_DIR}/${lib} COMPONENT qtd DESTINATION lib) |
264
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
503 ## Paths for the QtD libs. It is necessary for examples. |
132 | 504 set(${package}_lib_param qtd${package} ${${package}_lib_param} ${link_example}) |
505 | |
264
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
506 ## Generate dependences for make (or nmake). |
235
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
507 add_custom_target(${package}) |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
508 add_dependencies(${package} ${lib_name}) |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
509 add_dependencies(${lib_name} cpp_${package}) |
132 | 510 foreach(depend ${required}) |
511 string(TOLOWER ${depend} depend) | |
512 add_dependencies(cpp_${package} cpp_${depend}) | |
513 add_dependencies(${package} ${depend}) | |
514 endforeach(depend ${required}) | |
515 add_dependencies(allpackages ${package}) | |
264
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
516 |
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
517 ## TODO: Do we need generating of *.di files? |
132 | 518 if(GENERATE_DI_FILES) |
264
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
519 regexseafestring(cbd_safe ${CMAKE_BINARY_DIR}) |
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
520 regexseafestring(csd_safe ${CMAKE_SOURCE_DIR}) |
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
521 set(regexp_str "(${csd}/qt/d${D_VERSION}|${csd_safe}|${cbd_safe})/([A-Za-z0-9\\-_\\\\/]+)[/]+([A-Za-z0-9\\-_\\\\]+).d") |
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
522 foreach(source ${d_sources}) |
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
523 # find_file(source ${source} PATHS ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} |
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
524 # ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}) |
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
525 string(REGEX REPLACE ${regexp_str} "\\2" inc_path "${source}") |
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
526 string(REGEX REPLACE ${regexp_str} "\\3" file_name "${source}") |
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
527 set(interface_file_path ${CMAKE_BINARY_DIR}/d/${inc_path}) |
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
528 set(interface_file "${interface_file_path}/${file_name}.di") |
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
529 if(NOT "${file_name}" STREQUAL "QGlobal") |
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
530 add_custom_command(OUTPUT "${interface_file}" |
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
531 COMMAND "${DC}" |
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
532 ARGS ${D_FLAGS} -o- -H -Hd${interface_file_path} ${source} |
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
533 COMMENT "Generating header for ${source}" |
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
534 DEPENDS ${source} |
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
535 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} |
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
536 ) |
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
537 else(NOT "${file_name}" STREQUAL "QGlobal") ## The DMD frontend crashes on this file. |
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
538 add_custom_command(OUTPUT "${interface_file}" |
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
539 COMMAND ${CMAKE_COMMAND} -E make_directory ${interface_file_path} |
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
540 COMMAND ${CMAKE_COMMAND} -E remove -f ${interface_file} |
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
541 COMMAND ${CMAKE_COMMAND} -E copy ${source} ${interface_file} |
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
542 COMMENT "" |
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
543 DEPENDS ${source} |
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
544 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} |
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
545 ) |
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
546 endif(NOT "${file_name}" STREQUAL "QGlobal" AND GENERATE_DI_FILES) |
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
547 set(interfaces_list ${interfaces_list} ${interface_file_path}/${file_name}.di) |
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
548 install(FILES ${interface_file} COMPONENT qtd DESTINATION include/d/${inc_path}) |
da7c867ef2ef
1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents:
254
diff
changeset
|
549 endforeach(source) |
132 | 550 endif(GENERATE_DI_FILES) |
551 endif("${all_req_found}" EQUAL 1) | |
552 endforeach(package_big ${packages_big}) | |
553 if(GENERATE_DI_FILES) | |
554 add_custom_target(generate_headers ALL DEPENDS ${interfaces_list}) | |
555 endif(GENERATE_DI_FILES) | |
556 | |
557 set(CPACK_COMPONENTS_ALL qtd qtd_tools) | |
558 | |
559 ##-------------------------------------------- | |
560 ## Build other parts of the QtD. | |
561 ##-------------------------------------------- | |
237 | 562 |
132 | 563 if(BUILD_TOOLS) |
237 | 564 add_custom_target(tools ALL) |
132 | 565 add_subdirectory(tools) |
566 add_dependencies(tools drcc duic) | |
567 endif(BUILD_TOOLS) | |
568 | |
569 if(BUILD_EXAMPLES) | |
237 | 570 add_custom_target(examples ALL) |
571 add_dependencies(examples allpackages tools) | |
132 | 572 add_subdirectory(demos) |
573 add_subdirectory(examples) | |
574 endif(BUILD_EXAMPLES) | |
575 | |
239 | 576 set(SECOND_RUN 0 CACHE INTERNAL "") |
235
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
577 |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
229
diff
changeset
|
578 endif(NOT SECOND_RUN) |