Optionally include a CMake configurations file from the project directory to support...
[Torque-3d.git] / Tools / CMake / basics.cmake
blob970518f0f4403ac24da2d4ec40993bb6e2e449cc
1 # -----------------------------------------------------------------------------
2 # Copyright (c) 2014 GarageGames, LLC
4 # Permission is hereby granted, free of charge, to any person obtaining a copy
5 # of this software and associated documentation files (the "Software"), to
6 # deal in the Software without restriction, including without limitation the
7 # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
8 # sell copies of the Software, and to permit persons to whom the Software is
9 # furnished to do so, subject to the following conditions:
11 # The above copyright notice and this permission notice shall be included in
12 # all copies or substantial portions of the Software.
14 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20 # IN THE SOFTWARE.
21 # -----------------------------------------------------------------------------
23 project("Torque3DEngine")
25 if( CMAKE_CXX_SIZEOF_DATA_PTR EQUAL 8 )
26     set( TORQUE_CPU_X64 ON )
27 elseif( CMAKE_CXX_SIZEOF_DATA_PTR EQUAL 4 )
28     set( TORQUE_CPU_X32 ON )
29 endif()
31 if(NOT TORQUE_TEMPLATE)
32     set(TORQUE_TEMPLATE "Full" CACHE STRING "the template to use")
33 endif()
34 if(NOT TORQUE_APP_DIR)
35     set(TORQUE_APP_DIR "${CMAKE_SOURCE_DIR}/My Projects/${TORQUE_APP_NAME}")
36 endif()
37 if(NOT projectOutDir)
38     set(projectOutDir "${TORQUE_APP_DIR}/game")
39 endif()
40 if(NOT projectSrcDir)
41     set(projectSrcDir "${TORQUE_APP_DIR}/source")
42 endif()
43 set(libDir        "${CMAKE_SOURCE_DIR}/Engine/lib")
44 set(srcDir        "${CMAKE_SOURCE_DIR}/Engine/source")
45 set(cmakeDir      "${CMAKE_SOURCE_DIR}/Tools/CMake")
47 # hide some things
48 mark_as_advanced(CMAKE_INSTALL_PREFIX)
49 mark_as_advanced(CMAKE_CONFIGURATION_TYPES)
51 # output folders
52 #set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${projectOutDir}/game)
53 #set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${projectOutDir}/game)
54 #set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${projectOutDir}/game)
56 ###############################################################################
57 ### Source File Handling
58 ###############################################################################
60 # finds and adds sources files in a folder
61 macro(addPath dir)
62     set(tmp_files "")
63     set(glob_config GLOB)
64     if(${ARGC} GREATER 1 AND "${ARGV1}" STREQUAL "REC")
65         set(glob_config GLOB_RECURSE)
66     endif()
67         set(mac_files "")
68         if(APPLE)
69                 set(mac_files ${dir}/*.mm ${dir}/*.m)
70         endif()
71     file(${glob_config} tmp_files
72              ${dir}/*.cpp
73              ${dir}/*.c
74              ${dir}/*.cc
75              ${dir}/*.h
76              ${mac_files}
77              #${dir}/*.asm
78              )
79     foreach(entry ${BLACKLIST})
80                 list(REMOVE_ITEM tmp_files ${dir}/${entry})
81         endforeach()
82     LIST(APPEND ${PROJECT_NAME}_files "${tmp_files}")
83     LIST(APPEND ${PROJECT_NAME}_paths "${dir}")
84     #message(STATUS "addPath ${PROJECT_NAME} : ${tmp_files}")
85 endmacro()
87 # adds a file to the sources
88 macro(addFile filename)
89     LIST(APPEND ${PROJECT_NAME}_files "${filename}")
90     #message(STATUS "addFile ${PROJECT_NAME} : ${filename}")
91 endmacro()
93 # finds and adds sources files in a folder recursively
94 macro(addPathRec dir)
95     addPath("${dir}" "REC")
96 endmacro()
98 ###############################################################################
99 ### Definition Handling
100 ###############################################################################
101 macro(__addDef def config)
102     # two possibilities: a) target already known, so add it directly, or b) target not yet known, so add it to its cache
103     if(TARGET ${PROJECT_NAME})
104         #message(STATUS "directly applying defs: ${PROJECT_NAME} with config ${config}: ${def}")
105         if("${config}" STREQUAL "")
106             set_property(TARGET ${PROJECT_NAME} APPEND PROPERTY COMPILE_DEFINITIONS ${def})
107         else()
108             set_property(TARGET ${PROJECT_NAME} APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:${config}>:${def}>)
109         endif()
110     else()
111         if("${config}" STREQUAL "")
112             list(APPEND ${PROJECT_NAME}_defs_ ${def})
113         else()
114             list(APPEND ${PROJECT_NAME}_defs_ $<$<CONFIG:${config}>:${def}>)
115         endif()
116         #message(STATUS "added definition to cache: ${PROJECT_NAME}_defs_: ${${PROJECT_NAME}_defs_}")
117     endif()
118 endmacro()
120 # adds a definition: argument 1: Nothing(for all), _DEBUG, _RELEASE, <more build configurations>
121 macro(addDef def)
122     set(def_configs "")
123     if(${ARGC} GREATER 1)
124         foreach(config ${ARGN})
125             __addDef(${def} ${config})
126         endforeach()
127     else()
128         __addDef(${def} "")
129     endif()
130 endmacro()
132 # this applies cached definitions onto the target
133 macro(_process_defs)
134     if(DEFINED ${PROJECT_NAME}_defs_)
135         set_property(TARGET ${PROJECT_NAME} APPEND PROPERTY COMPILE_DEFINITIONS ${${PROJECT_NAME}_defs_})
136         #message(STATUS "applying defs to project ${PROJECT_NAME}: ${${PROJECT_NAME}_defs_}")
137     endif()
138 endmacro()
140 ###############################################################################
141 ###  Source Library Handling
142 ###############################################################################
143 macro(addLibSrc libPath)
144     set(cached_project_name ${PROJECT_NAME})
145     include(${libPath})
146     project(${cached_project_name})
147 endmacro()
149 ###############################################################################
150 ### Linked Library Handling
151 ###############################################################################
152 macro(addLib libs)
153    foreach(lib ${libs})
154         # check if we can build it ourselfs
155         if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/libraries/${lib}.cmake")
156             addLibSrc("${CMAKE_CURRENT_SOURCE_DIR}/libraries/${lib}.cmake")
157         endif()
158         # then link against it
159         # two possibilities: a) target already known, so add it directly, or b) target not yet known, so add it to its cache
160         if(TARGET ${PROJECT_NAME})
161             target_link_libraries(${PROJECT_NAME} "${lib}")
162         else()
163             list(APPEND ${PROJECT_NAME}_libs ${lib})
164         endif()
165    endforeach()
166 endmacro()
168 #addLibRelease will add to only release builds
169 macro(addLibRelease libs)
170    foreach(lib ${libs})
171         # check if we can build it ourselfs
172         if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/libraries/${lib}.cmake")
173             addLibSrc("${CMAKE_CURRENT_SOURCE_DIR}/libraries/${lib}.cmake")
174         endif()
175         # then link against it
176         # two possibilities: a) target already known, so add it directly, or b) target not yet known, so add it to its cache
177         if(TARGET ${PROJECT_NAME})
178             target_link_libraries(${PROJECT_NAME} optimized "${lib}")
179         else()
180             list(APPEND ${PROJECT_NAME}_libsRelease ${lib})
181         endif()
182    endforeach()
183 endmacro()
185 #addLibDebug will add to only debug builds
186 macro(addLibDebug libs)
187    foreach(lib ${libs})
188         # check if we can build it ourselfs
189         if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/libraries/${lib}.cmake")
190             addLibSrc("${CMAKE_CURRENT_SOURCE_DIR}/libraries/${lib}.cmake")
191         endif()
192         # then link against it
193         # two possibilities: a) target already known, so add it directly, or b) target not yet known, so add it to its cache
194         if(TARGET ${PROJECT_NAME})
195             target_link_libraries(${PROJECT_NAME} debug "${lib}")
196         else()
197             list(APPEND ${PROJECT_NAME}_libsDebug ${lib})
198         endif()
199    endforeach()
200 endmacro()
202 # this applies cached definitions onto the target
203 macro(_process_libs)
204     if(DEFINED ${PROJECT_NAME}_libs)
205         target_link_libraries(${PROJECT_NAME} "${${PROJECT_NAME}_libs}")
206     endif()
207     if(DEFINED ${PROJECT_NAME}_libsRelease)
208         target_link_libraries(${PROJECT_NAME} optimized "${${PROJECT_NAME}_libsRelease}")
209     endif()
210     if(DEFINED ${PROJECT_NAME}_libsDebug)
211         target_link_libraries(${PROJECT_NAME} debug "${${PROJECT_NAME}_libsDebug}")
212     endif()
214 endmacro()
216 # apple frameworks
217 macro(addFramework framework)
218         if (APPLE)
219                 addLib("-framework ${framework}")
220         endif()
221 endmacro()
223 ###############################################################################
224 ### Include Handling
225 ###############################################################################
226 macro(addInclude incPath)
227     if(TARGET ${PROJECT_NAME})
228         set_property(TARGET ${PROJECT_NAME} APPEND PROPERTY INCLUDE_DIRECTORIES "${incPath}")
229     else()
230         list(APPEND ${PROJECT_NAME}_includes ${incPath})
231     endif()
232 endmacro()
234 # this applies cached definitions onto the target
235 macro(_process_includes)
236     if(DEFINED ${PROJECT_NAME}_includes)
237         set_property(TARGET ${PROJECT_NAME} APPEND PROPERTY INCLUDE_DIRECTORIES "${${PROJECT_NAME}_includes}")
238     endif()
239 endmacro()
241 ###############################################################################
243 macro(_postTargetProcess)
244     _process_includes()
245     _process_defs()
246     _process_libs()
247 endmacro()
249 # adds a path to search for libs
250 macro(addLibPath dir)
251     link_directories(${dir})
252 endmacro()
254 # creates a proper filter for VS
255 macro(generateFilters relDir)
256     foreach(f ${${PROJECT_NAME}_files})
257         # Get the path of the file relative to ${DIRECTORY},
258         # then alter it (not compulsory)
259         file(RELATIVE_PATH SRCGR ${relDir} ${f})
260         set(SRCGR "${PROJECT_NAME}/${SRCGR}")
261         # Extract the folder, ie remove the filename part
262         string(REGEX REPLACE "(.*)(/[^/]*)$" "\\1" SRCGR ${SRCGR})
263         # do not have any ../ dirs
264         string(REPLACE "../" "" SRCGR ${SRCGR})
265         # Source_group expects \\ (double antislash), not / (slash)
266         string(REPLACE / \\ SRCGR ${SRCGR})
267         #STRING(REPLACE "//" "/" SRCGR ${SRCGR})
268         #message(STATUS "FILE: ${f} -> ${SRCGR}")
269         source_group("${SRCGR}" FILES ${f})
270     endforeach()
271 endmacro()
273 # creates a proper filter for VS
274 macro(generateFiltersSpecial relDir)
275     foreach(f ${${PROJECT_NAME}_files})
276         # Get the path of the file relative to ${DIRECTORY},
277         # then alter it (not compulsory)
278         file(RELATIVE_PATH SRCGR ${relDir} ${f})
279         set(SRCGR "torque3d/${SRCGR}")
280         # Extract the folder, ie remove the filename part
281         string(REGEX REPLACE "(.*)(/[^/]*)$" "\\1" SRCGR ${SRCGR})
282         # do not have any ../ dirs
283         string(REPLACE "../" "" SRCGR ${SRCGR})
284         IF("${SRCGR}" MATCHES "^torque3d/My Projects/.*$")
285             string(REPLACE "torque3d/My Projects/${PROJECT_NAME}/" "" SRCGR ${SRCGR})
286             string(REPLACE "/source" "" SRCGR ${SRCGR})
287         endif()
288         # Source_group expects \\ (double antislash), not / (slash)
289         string(REPLACE / \\ SRCGR ${SRCGR})
290         #STRING(REPLACE "//" "/" SRCGR ${SRCGR})
291         IF(EXISTS "${f}" AND NOT IS_DIRECTORY "${f}")
292             #message(STATUS "FILE: ${f} -> ${SRCGR}")
293             source_group("${SRCGR}" FILES ${f})
294         endif()
295     endforeach()
296 endmacro()
298 # macro to add a static library
299 macro(finishLibrary)
300     # more paths?
301     if(${ARGC} GREATER 0)
302         foreach(dir ${ARGV0})
303             addPath("${dir}")
304         endforeach()
305     endif()
306     # now inspect the paths we got
307     set(firstDir "")
308     foreach(dir ${${PROJECT_NAME}_paths})
309         if("${firstDir}" STREQUAL "")
310             set(firstDir "${dir}")
311         endif()
312     endforeach()
313     generateFilters("${firstDir}")
315     # set per target compile flags
316     if(TORQUE_CXX_FLAGS_${PROJECT_NAME})
317         set_source_files_properties(${${PROJECT_NAME}_files} PROPERTIES COMPILE_FLAGS "${TORQUE_CXX_FLAGS_${PROJECT_NAME}}")
318     else()
319         set_source_files_properties(${${PROJECT_NAME}_files} PROPERTIES COMPILE_FLAGS "${TORQUE_CXX_FLAGS_LIBS}")
320     endif()
322     if(TORQUE_STATIC)
323         add_library("${PROJECT_NAME}" STATIC ${${PROJECT_NAME}_files})
324     else()
325         add_library("${PROJECT_NAME}" SHARED ${${PROJECT_NAME}_files})
326     endif()
328     # omg - only use the first folder ... otherwise we get lots of header name collisions
329     #foreach(dir ${${PROJECT_NAME}_paths})
330     addInclude("${firstDir}")
331     #endforeach()
333     _postTargetProcess()
334 endmacro()
336 # macro to add an executable
337 macro(finishExecutable)
338     # now inspect the paths we got
339     set(firstDir "")
340     foreach(dir ${${PROJECT_NAME}_paths})
341         if("${firstDir}" STREQUAL "")
342             set(firstDir "${dir}")
343         endif()
344     endforeach()
345     generateFiltersSpecial("${firstDir}")
347     # set per target compile flags
348     if(TORQUE_CXX_FLAGS_${PROJECT_NAME})
349         set_source_files_properties(${${PROJECT_NAME}_files} PROPERTIES COMPILE_FLAGS "${TORQUE_CXX_FLAGS_${PROJECT_NAME}}")
350     else()
351         set_source_files_properties(${${PROJECT_NAME}_files} PROPERTIES COMPILE_FLAGS "${TORQUE_CXX_FLAGS_EXECUTABLES}")
352     endif()
354     if (APPLE)
355       set(ICON_FILE "${projectSrcDir}/torque.icns")
356         set_source_files_properties(${ICON_FILE} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
357         add_executable("${PROJECT_NAME}" MACOSX_BUNDLE ${ICON_FILE} ${${PROJECT_NAME}_files})
358     else()
359         add_executable("${PROJECT_NAME}" WIN32 ${${PROJECT_NAME}_files})
360     endif()
361     addInclude("${firstDir}")
363     _postTargetProcess()
364 endmacro()
366 macro(setupVersionNumbers)
367     set(TORQUE_APP_VERSION_MAJOR 1 CACHE INTEGER "")
368     set(TORQUE_APP_VERSION_MINOR 0 CACHE INTEGER "")
369     set(TORQUE_APP_VERSION_PATCH 0 CACHE INTEGER "")
370     set(TORQUE_APP_VERSION_TWEAK 0 CACHE INTEGER "")
371     mark_as_advanced(TORQUE_APP_VERSION_TWEAK)
372     MATH(EXPR TORQUE_APP_VERSION "${TORQUE_APP_VERSION_MAJOR} * 1000 + ${TORQUE_APP_VERSION_MINOR} * 100 + ${TORQUE_APP_VERSION_PATCH} * 10 + ${TORQUE_APP_VERSION_TWEAK}")
373     set(TORQUE_APP_VERSION_STRING "${TORQUE_APP_VERSION_MAJOR}.${TORQUE_APP_VERSION_MINOR}.${TORQUE_APP_VERSION_PATCH}.${TORQUE_APP_VERSION_TWEAK}")
374     #message(STATUS "version numbers: ${TORQUE_APP_VERSION} / ${TORQUE_APP_VERSION_STRING}")
375 endmacro()
377 macro(setupPackaging)
378     INCLUDE(CPack)
379     # only enable zips for now
380     set(CPACK_BINARY_NSIS OFF CACHE INTERNAL "" FORCE)
381     set(CPACK_BINARY_ZIP   ON CACHE INTERNAL "" FORCE)
382     set(CPACK_SOURCE_ZIP  OFF CACHE INTERNAL "" FORCE)
383     SET(CPACK_GENERATOR "ZIP")
384     SET(CPACK_PACKAGE_VENDOR "${PROJECT_NAME}")
385     SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PROJECT_NAME}")
386     SET(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 1)
387     SET(CPACK_OUTPUT_FILE_PREFIX "${TORQUE_APP_DIR}/packages/${PROJECT_NAME}")
388     SET(CPACK_PACKAGE_INSTALL_DIRECTORY "")
389     #SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/ReadMe.txt")
390     #SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
391     SET(CPACK_PACKAGE_VERSION_MAJOR "${TORQUE_APP_VERSION_MAJOR}")
392     SET(CPACK_PACKAGE_VERSION_MINOR "${TORQUE_APP_VERSION_MINOR}")
393     SET(CPACK_PACKAGE_VERSION_PATCH "${TORQUE_APP_VERSION_PATCH}")
394     #SET(CPACK_PACKAGE_EXECUTABLES "${PROJECT_NAME}" "${PROJECT_NAME}")
395     SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${TORQUE_APP_VERSION_STRING}")
396     #SET(CPACK_SOURCE_STRIP_FILES "")
397 endmacro()
398 # always static for now
399 set(TORQUE_STATIC ON)
400 #option(TORQUE_STATIC "enables or disable static" OFF)
402 if(WIN32)
403     set(TORQUE_CXX_FLAGS_EXECUTABLES "/wd4018 /wd4100 /wd4121 /wd4127 /wd4130 /wd4244 /wd4245 /wd4389 /wd4511 /wd4512 /wd4800 /wd4995 " CACHE TYPE STRING)
404     mark_as_advanced(TORQUE_CXX_FLAGS_EXECUTABLES)
406     set(TORQUE_CXX_FLAGS_LIBS "/W0" CACHE TYPE STRING)
407     mark_as_advanced(TORQUE_CXX_FLAGS_LIBS)
409     set(TORQUE_CXX_FLAGS_COMMON_DEFAULT "-DUNICODE -D_UNICODE -D_CRT_SECURE_NO_WARNINGS /MP /O2 /Ob2 /Oi /Ot /Oy /GT /Zi /W4 /nologo /GF /EHsc /GS- /Gy- /Qpar- /fp:precise /fp:except- /GR /Zc:wchar_t-" )
410     if( TORQUE_CPU_X32 )
411        set(TORQUE_CXX_FLAGS_COMMON_DEFAULT "${TORQUE_CXX_FLAGS_COMMON_DEFAULT} /arch:SSE2")
412     endif()
413     set(TORQUE_CXX_FLAGS_COMMON ${TORQUE_CXX_FLAGS_COMMON_DEFAULT} CACHE TYPE STRING)
415     mark_as_advanced(TORQUE_CXX_FLAGS_COMMON)
417     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TORQUE_CXX_FLAGS_COMMON}")
418     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_CXX_FLAGS}")
419     set(CMAKE_EXE_LINKER_FLAGS "/LARGEADDRESSAWARE")
420     #set(STATIC_LIBRARY_FLAGS "/OPT:NOREF")
422     # Force static runtime libraries
423     if(TORQUE_STATIC)
424         FOREACH(flag
425             CMAKE_C_FLAGS_RELEASE
426             CMAKE_C_FLAGS_RELWITHDEBINFO
427             CMAKE_C_FLAGS_DEBUG
428             CMAKE_C_FLAGS_DEBUG_INIT
429             CMAKE_CXX_FLAGS_RELEASE
430             CMAKE_CXX_FLAGS_RELWITHDEBINFO
431             CMAKE_CXX_FLAGS_DEBUG
432             CMAKE_CXX_FLAGS_DEBUG_INIT)
433             STRING(REPLACE "/MD"  "/MT" "${flag}" "${${flag}}")
434             SET("${flag}" "${${flag}} /EHsc")
435         ENDFOREACH()
436     endif()
437 else()
438     # TODO: improve default settings on other platforms
439     set(TORQUE_CXX_FLAGS_EXECUTABLES "" CACHE TYPE STRING)
440     mark_as_advanced(TORQUE_CXX_FLAGS_EXECUTABLES)
441     set(TORQUE_CXX_FLAGS_LIBS "" CACHE TYPE STRING)
442     mark_as_advanced(TORQUE_CXX_FLAGS_LIBS)
443     set(TORQUE_CXX_FLAGS_COMMON "" CACHE TYPE STRING)
444     mark_as_advanced(TORQUE_CXX_FLAGS)
445     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TORQUE_CXX_FLAGS}")
446     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_CXX_FLAGS}")
447 endif()
449 if(UNIX AND NOT APPLE)
450         SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${projectOutDir}")
451         set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${projectOutDir}")
452         SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${projectOutDir}")
453         set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG "${projectOutDir}")
454 endif()
456 if(APPLE)
457   SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${projectOutDir}")
458   set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE "${projectOutDir}")
459   SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${projectOutDir}")
460   set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG "${projectOutDir}")
461 endif()
463 # fix the debug/release subfolders on windows
464 if(MSVC)
465     SET("CMAKE_RUNTIME_OUTPUT_DIRECTORY" "${projectOutDir}")
466     FOREACH(CONF ${CMAKE_CONFIGURATION_TYPES})
467         # Go uppercase (DEBUG, RELEASE...)
468         STRING(TOUPPER "${CONF}" CONF)
469         #SET("CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CONF}" "${projectOutDir}")
470         SET("CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CONF}" "${projectOutDir}")
471     ENDFOREACH()
472 endif()