-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathWkCompilerSetup.cmake
353 lines (309 loc) · 15.9 KB
/
WkCompilerSetup.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
#
# Copyright (c) 2009, Asmodehn's Corp.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the Asmodehn's Corp. nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
# THE POSSIBILITY OF SUCH DAMAGE.
#
#
# Compiler Specific rules
# All modifications for Flags should be here
# These macros exists to use more pedantic rules to build software. Thus improving the quality of working code
#
#debug
message ( STATUS "== Loading WkCompilerSetup.cmake ... ")
if ( CMAKE_BACKWARDS_COMPATIBILITY LESS 2.6 )
message ( FATAL_ERROR " CMAKE MINIMUM BACKWARD COMPATIBILITY REQUIRED : 2.6 !" )
endif( CMAKE_BACKWARDS_COMPATIBILITY LESS 2.6 )
# Macros to redefine default options for build type
# Usage : WkSetCFlags( "-new -flags" )
macro(WkSetCFlags)
SET(${PROJECT_NAME}_C_FLAGS "${ARGN}" CACHE STRING "${PROJECT_NAME} Flags for C Compiler." )
MARK_AS_ADVANCED(FORCE ${PROJECT_NAME}_C_FLAGS )
endmacro(WkSetCFlags )
# Usage : WkAddCFlags( "-new -flags" )
macro(WkAddCFlags)
IF ( ${PROJECT_NAME}_C_FLAGS )
STRING(FIND ${${PROJECT_NAME}_C_FLAGS} ${ARGN} already_stored)
IF(${already_stored} LESS 0)
SET(${PROJECT_NAME}_C_FLAGS "${${PROJECT_NAME}_C_FLAGS} ${ARGN}" CACHE STRING "${PROJECT_NAME} Flags for C Compiler." FORCE)
ENDIF()
ELSE ( ${PROJECT_NAME}_C_FLAGS )
SET(${PROJECT_NAME}_C_FLAGS "${ARGN}" CACHE STRING "${PROJECT_NAME} Flags for C Compiler." FORCE)
ENDIF ( ${PROJECT_NAME}_C_FLAGS )
endmacro(WkAddCFlags)
# Usage : WkAddCDefinitions( [Debug|Release] [newdef1] [newdef2] )
macro(WkAddCDefinitions Build)
IF ( ${PROJECT_NAME}_C_DEFINITIONS_DEBUG AND ${Build} STREQUAL Debug )
foreach(newdef ${ARGN})
#message(STATUS "LIST(FIND ${${PROJECT_NAME}_C_DEFINITIONS_DEBUG} ${newdef} already_stored)")
LIST(FIND ${PROJECT_NAME}_C_DEFINITIONS_DEBUG ${newdef} already_stored)
#message(STATUS ${already_stored})
IF(${already_stored} LESS 0)
LIST(APPEND ${PROJECT_NAME}_C_DEFINITIONS_DEBUG "${newdef}")
ENDIF()
endforeach()
ELSEIF ( ${PROJECT_NAME}_C_DEFINITIONS_RELEASE AND ${Build} STREQUAL Release )
foreach(newdef ${ARGN})
LIST(FIND ${PROJECT_NAME}_C_DEFINITIONS_RELEASE ${newdef} already_stored)
IF(${already_stored} LESS 0)
LIST(APPEND ${PROJECT_NAME}_C_DEFINITIONS_RELEASE "${newdef}")
ENDIF()
endforeach()
ELSE()
IF( ${Build} STREQUAL Debug )
LIST(APPEND ${PROJECT_NAME}_C_DEFINITIONS_DEBUG "${ARGN}")
ELSEIF ( ${Build} STREQUAL Release)
LIST(APPEND ${PROJECT_NAME}_C_DEFINITIONS_RELEASE "${ARGN}")
ELSE()
message(WARNING " ${Build} is not a valid build type.")
ENDIF()
ENDIF ()
endmacro(WkAddCDefinitions Build)
# Usage : WkRmDefaultCFlags( "FLAG_TO_MODIFY -new -flags" )
macro(WkRmFlags FLAG)
IF ( ${FLAG} )
#explode string as list
set(CURRENT_C_ARGS ${${FLAG}})
separate_arguments(CURRENT_C_ARGS)
# remove items from list
LIST(REMOVE_ITEM CURRENT_C_ARGS ${ARGN})
#rewrite all arguments as string
set(NEW_FLAGS "")
foreach(f ${CURRENT_C_ARGS})
set(NEW_FLAGS "${NEW_FLAGS}${f} " )
endforeach(f)
set(${FLAG} ${NEW_FLAGS} CACHE STRING "" FORCE)
ELSE ( ${FLAG} )
message(${FLAG} " not set!")
ENDIF ( ${FLAG} )
endmacro(WkRmFlags)
# Usage : WkSetCXXFlags( "-new -flags" )
macro(WkSetCXXFlags)
SET(${PROJECT_NAME}_CXX_FLAGS "${ARGN}" CACHE STRING "${PROJECT_NAME} Flags for C++ Compiler.")
MARK_AS_ADVANCED(FORCE ${PROJECT_NAME}_CXX_FLAGS )
endmacro(WkSetCXXFlags)
# Usage : WkAddCXXFlags( "-new -flags" )
macro(WkAddCXXFlags)
IF ( ${PROJECT_NAME}_CXX_FLAGS )
STRING(FIND ${${PROJECT_NAME}_CXX_FLAGS} ${ARGN} already_stored)
IF( ${already_stored} LESS 0)
SET(${PROJECT_NAME}_CXX_FLAGS "${${PROJECT_NAME}_CXX_FLAGS} ${ARGN}" CACHE STRING "${PROJECT_NAME} Flags for C++ Compiler." FORCE)
ENDIF()
ELSE( ${PROJECT_NAME}_CXX_FLAGS )
SET(${PROJECT_NAME}_CXX_FLAGS "${ARGN}" CACHE STRING "${PROJECT_NAME} Flags for C++ Compiler." FORCE)
ENDIF ( ${PROJECT_NAME}_CXX_FLAGS )
endmacro(WkAddCXXFlags)
macro(WkAddDefaultCXXFlagsDebug)
STRING(FIND CMAKE_CXX_FLAGS_DEBUG ${ARGN} already_stored)
IF( ${already_stored} LESS 0)
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${ARGN}" CACHE STRING "CMAKE Flags for C++ Compiler." FORCE)
ENDIF()
endmacro(WkAddDefaultCXXFlagsDebug)
# Usage : WkAddCXXDefinitions( [Debug|Release] [newdef1] [newdef2] )
macro(WkAddCXXDefinitions Build)
IF ( ${PROJECT_NAME}_CXX_DEFINITIONS_DEBUG AND ${Build} STREQUAL Debug )
foreach( newdef ${ARGN} )
LIST(FIND ${PROJECT_NAME}_CXX_DEFINITIONS_DEBUG ${newdef} already_stored)
IF( ${already_stored} LESS 0)
LIST( APPEND ${PROJECT_NAME}_CXX_DEFINITIONS_DEBUG "${newdef}")
ENDIF()
endforeach()
ELSEIF (${PROJECT_NAME}_CXX_DEFINITIONS_RELEASE AND ${Build} STREQUAL Release )
foreach ( newdef ${ARGN} )
LIST(FIND ${PROJECT_NAME}_CXX_DEFINITIONS_RELEASE ${newdef} already_stored)
IF( ${already_stored} LESS 0)
LIST(APPEND ${PROJECT_NAME}_CXX_DEFINITIONS_RELEASE "${newdef}")
ENDIF()
endforeach()
ELSE()
IF( ${Build} STREQUAL Debug )
LIST(APPEND ${PROJECT_NAME}_CXX_DEFINITIONS_DEBUG "${ARGN}")
ELSEIF ( ${Build} STREQUAL Release)
LIST(APPEND ${PROJECT_NAME}_CXX_DEFINITIONS_RELEASE "${ARGN}")
ELSE()
message(WARNING " ${Build} is not a valid build type.")
ENDIF()
ENDIF ()
endmacro(WkAddCXXDefinitions Build)
#TODO : Change usage: All | Debug | Release might not alway be obvious to use...
# Usage : WkSetExeLinkerFlags( Build [flags] )
macro(WkSetExeLinkerFlags Build)
IF (${Build} STREQUAL All )
SET(${PROJECT_NAME}_EXE_LINKER_FLAGS "${ARGN}" CACHE STRING "${PROJECT_NAME} Flags used by the linker.")
MARK_AS_ADVANCED(FORCE ${PROJECT_NAME}_EXE_LINKER_FLAGS )
ELSEIF (${Build} STREQUAL Debug )
SET(${PROJECT_NAME}_EXE_LINKER_FLAGS_DEBUG "${ARGN}" CACHE STRING " ${PROJECT_NAME} Flags used by the linker during debug builds.")
MARK_AS_ADVANCED(FORCE ${PROJECT_NAME}_EXE_LINKER_FLAGS_DEBUG )
ELSEIF (${Build} STREQUAL Release )
SET(${PROJECT_NAME}_EXE_LINKER_FLAGS_RELEASE "${ARGN}" CACHE STRING " ${PROJECT_NAME} Flags used by the linker during release builds.")
MARK_AS_ADVANCED(FORCE ${PROJECT_NAME}_EXE_LINKER_FLAGS_RELEASE )
ENDIF (${Build} STREQUAL All )
endmacro(WkSetExeLinkerFlags )
# Usage : WkSetSharedLinkerFlags( Build [flags] )
macro(WkSetSharedLinkerFlags Build)
IF (${Build} STREQUAL All )
SET(${PROJECT_NAME}_SHARED_LINKER_FLAGS "${ARGN}" CACHE STRING "${PROJECT_NAME} Flags used by the linker during the creation of dll's.")
MARK_AS_ADVANCED(FORCE ${PROJECT_NAME}_SHARED_LINKER_FLAGS )
ELSEIF (${Build} STREQUAL Debug )
SET(${PROJECT_NAME}_SHARED_LINKER_FLAGS_DEBUG "${ARGN}" CACHE STRING " ${PROJECT_NAME} Flags used by the linker during debug builds.")
MARK_AS_ADVANCED(FORCE ${PROJECT_NAME}_SHARED_LINKER_FLAGS_DEBUG )
ELSEIF (${Build} STREQUAL Release )
SET(${PROJECT_NAME}_SHARED_LINKER_FLAGS_RELEASE "${ARGN}" CACHE STRING " ${PROJECT_NAME} Flags used by the linker during release builds.")
MARK_AS_ADVANCED(FORCE ${PROJECT_NAME}_SHARED_LINKER_FLAGS_RELEASE )
ENDIF (${Build} STREQUAL All )
endmacro(WkSetSharedLinkerFlags )
# Usage : WkSetModuleLinkerFlags( Build [flags] )
macro(WkSetModuleLinkerFlags Build)
IF (${Build} STREQUAL All )
SET(${PROJECT_NAME}_MODULE_LINKER_FLAGS "${ARGN}" CACHE STRING "${PROJECT_NAME} Flags used by the linker during the creation of modules.")
MARK_AS_ADVANCED(FORCE ${PROJECT_NAME}_MODULE_LINKER_FLAGS )
ELSEIF (${Build} STREQUAL Debug )
SET(${PROJECT_NAME}_MODULE_LINKER_FLAGS_DEBUG "${ARGN}" CACHE STRING " ${PROJECT_NAME} Flags used by the linker during debug builds.")
MARK_AS_ADVANCED(FORCE ${PROJECT_NAME}_MODULE_LINKER_FLAGS_DEBUG )
ELSEIF (${Build} STREQUAL Release )
SET(${PROJECT_NAME}_MODULE_LINKER_FLAGS_RELEASE "${ARGN}" CACHE STRING " ${PROJECT_NAME} Flags used by the linker during release builds.")
MARK_AS_ADVANCED(FORCE ${PROJECT_NAME}_MODULE_LINKER_FLAGS_RELEASE )
ENDIF (${Build} STREQUAL All )
endmacro(WkSetModuleLinkerFlags )
# Usage : WkDisableFlags ( Build )
#TODO : Remove. Sounds like a bad idea now...
macro ( WkDisableFlags Build )
IF(${Build} STREQUAL Debug)
SET(CMAKE_C_DEFINITIONS_DEBUG CACHE INTERNAL "Internal CMake C flags for Debug mode do not edit" FORCE)
SET(CMAKE_CXX_DEFINITIONS_DEBUG CACHE INTERNAL "Internal CMake C++ flags for Debug mode do not edit" FORCE)
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG CACHE INTERNAL "Internal CMake linker flags for Debug mode do not edit" FORCE)
SET(CMAKE_SHARED_LINKER_FLAGS_DEBUG CACHE INTERNAL "Internal CMake linker flags for Debug mode do not edit" FORCE)
SET(CMAKE_MODULE_LINKER_FLAGS_DEBUG CACHE INTERNAL "Internal CMake linker flags for Debug mode do not edit" FORCE)
ELSEIF(${Build} STREQUAL Release)
SET(CMAKE_C_DEFINITIONS_RELEASE CACHE INTERNAL "Internal CMake C flags for Release mode do not edit" FORCE)
SET(CMAKE_CXX_DEFINITIONS_RELEASE CACHE INTERNAL "Internal CMake C++ flags for Release mode do not edit" FORCE)
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE CACHE INTERNAL "Internal CMake linker flags for Release mode do not edit" FORCE)
SET(CMAKE_SHARED_LINKER_FLAGS_RELEASE CACHE INTERNAL "Internal CMake linker flags for Release mode do not edit" FORCE)
SET(CMAKE_MODULE_LINKER_FLAGS_RELEASE CACHE INTERNAL "Internal CMake linker flags for Release mode do not edit" FORCE)
ELSEIF(${Build} STREQUAL RelWithDebInfo)
SET(CMAKE_C_DEFINITIONS_RELWITHDEBINFO CACHE INTERNAL "Internal CMake C flags for Release with Debug Info mode do not edit" FORCE)
SET(CMAKE_CXX_DEFINITIONS_RELWITHDEBINFO CACHE INTERNAL "Internal CMake C++ flags for Release with Debug Info mode do not edit" FORCE)
SET(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO CACHE INTERNAL "Internal CMake linker flags for Release with Debug Info mode do not edit" FORCE)
SET(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO CACHE INTERNAL "Internal CMake linker flags for Release with Debug Info mode do not edit" FORCE)
SET(CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO CACHE INTERNAL "Internal CMake linker flags for Release with Debug Info mode do not edit" FORCE)
ELSEIF(${Build} STREQUAL MinSizeRel)
SET(CMAKE_C_DEFINITIONS_MINSIZEREL CACHE INTERNAL "Internal CMake C flags for Release minsize mode do not edit" FORCE)
SET(CMAKE_CXX_DEFINITIONS_MINSIZEREL CACHE INTERNAL "Internal CMake C++ flags for Release minsize mode do not edit" FORCE)
SET(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL CACHE INTERNAL "Internal CMake linker flags for Release minsize mode do not edit" FORCE)
SET(CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL CACHE INTERNAL "Internal CMake linker flags for Release minsize mode do not edit" FORCE)
SET(CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL CACHE INTERNAL "Internal CMake linker flags for Release minsize mode do not edit" FORCE)
ENDIF(${Build} STREQUAL Debug)
endmacro ( WkDisableFlags )
macro ( WkCompilerSetup )
#TODO : setup only needed compiler settings, depending on loaded compilers
#Default : Multiple-Configuration Generator ( MSVC )
#Forcing configuration at build time
SET(CMAKE_CONFIGURATION_TYPES "Debug;Release;" CACHE INTERNAL "Semicolon separated list of supported configuration types in your Build Environment. Do not edit." )
#message ( "CMAKE_CONFIGURATION_TYPES : ${CMAKE_CONFIGURATION_TYPES} ")
# However special case for Single-Configuration Generator ( make ... )
if ( NOT MSVC )
SET(${PROJECT_NAME}_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build, options are: ${CMAKE_CONFIGURATION_TYPES}." )
#Checking if a the required build type is available in configurations list...
IF( ${PROJECT_NAME}_BUILD_TYPE )
string ( REGEX MATCH "${${PROJECT_NAME}_BUILD_TYPE}" BUILD_TYPE_MATCH ${CMAKE_CONFIGURATION_TYPES} )
IF ( NOT BUILD_TYPE_MATCH )
message ( " ${${PROJECT_NAME}_BUILD_TYPE} is not a possible build type ! Defaulting to Debug . " )
SET(${PROJECT_NAME}_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build, options are: ${CMAKE_CONFIGURATION_TYPES}." FORCE )
ENDIF ( NOT BUILD_TYPE_MATCH )
ELSE( ${PROJECT_NAME}_BUILD_TYPE )
message ( FATAL_ERROR " ${PROJECT_NAME}_BUILD_TYPE is not defined ! Defaulting to Debug. " )
SET(${PROJECT_NAME}_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build, options are: ${CMAKE_CONFIGURATION_TYPES}." FORCE )
ENDIF( ${PROJECT_NAME}_BUILD_TYPE )
#Forcing configuration at generation time
SET(CMAKE_BUILD_TYPE "${${PROJECT_NAME}_BUILD_TYPE}" CACHE INTERNAL "Internal CMake Build Type. Do not edit." )
#message ( "CMAKE_BUILD_TYPE : ${CMAKE_BUILD_TYPE} ")
endif( NOT MSVC )
IF(MSVC)
MESSAGE( STATUS "Visual Studio Compiler detected. Adjusting C++ flags...")
WkSetCFlags ( "" )
WkSetCXXFlags ( "/wd4100 /wd4290 /wd4512" )
WkSetExeLinkerFlags ( All "" )
WkSetSharedLinkerFlags ( All "" )
WkSetModuleLinkerFlags ( All "" )
WkSetExeLinkerFlags( Debug )
WkSetSharedLinkerFlags( Debug )
WkSetModuleLinkerFlags( Debug )
WkSetExeLinkerFlags( Release )
WkSetSharedLinkerFlags( Release )
WkSetModuleLinkerFlags( Release )
ELSEIF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
MESSAGE( STATUS "GNU Compiler detected.")
#IF ( COMMAND gprof )
SET(${PROJECT_NAME}_PROFILE OFF CACHE BOOL "On to generate profiling information to use with gprof.")
SET(PROFILE_FLAG)
IF(${PROJECT_NAME}_PROFILE)
SET(PROFILE_FLAG -pg)
ENDIF(${PROJECT_NAME}_PROFILE)
#ENDIF ( COMMAND gprof )
WkSetCFlags ( "${PROFILE_FLAG} -Wall " )
WkAddCDefinitions ( Debug "_DEBUG" )
WkAddCDefinitions ( Release "" )
WkSetCXXFlags ( "${PROFILE_FLAG} -Wall -Wabi " )
WkAddCXXDefinitions ( Debug "_DEBUG" )
WkAddCXXDefinitions ( Release "" )
IF (MSYS)
WkSetExeLinkerFlags( All -Wl,--warn-once )
WkSetSharedLinkerFlags( All -Wl,--warn-once )
WkSetModuleLinkerFlags( All -Wl,--warn-once )
ELSE (MSYS)
WkSetExeLinkerFlags( All -Wl,--warn-unresolved-symbols )
WkSetSharedLinkerFlags( All -Wl,--warn-unresolved-symbols )
WkSetModuleLinkerFlags( All -Wl,--warn-unresolved-symbols )
ENDIF (MSYS)
WkSetExeLinkerFlags( Debug )
WkSetSharedLinkerFlags( Debug )
WkSetModuleLinkerFlags( Debug )
WkSetExeLinkerFlags( Release )
WkSetSharedLinkerFlags( Release )
WkSetModuleLinkerFlags( Release )
ENDIF(MSVC)
#per build mode section
IF (CMAKE_BUILD_TYPE STREQUAL Debug)
IF(MSVC)
SET(CMAKE_CXX_WARNING_LEVEL 4)
ENDIF(MSVC)
IF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
IF(CMAKE_COMPILER_IS_GNUCC)
ENDIF(CMAKE_COMPILER_IS_GNUCC)
IF(CMAKE_COMPILER_IS_GNUCXX)
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
ENDIF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
ELSEIF (CMAKE_BUILD_TYPE STREQUAL Release)
IF(MSVC)
SET(CMAKE_CXX_WARNING_LEVEL 2)
ENDIF(MSVC)
IF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
IF(CMAKE_COMPILER_IS_GNUCC)
ENDIF(CMAKE_COMPILER_IS_GNUCC)
IF(CMAKE_COMPILER_IS_GNUCXX)
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
ENDIF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
ENDIF (CMAKE_BUILD_TYPE STREQUAL Debug)
endmacro ( WkCompilerSetup )