merge from trunk #37722
[blender-staging.git] / build_files / cmake / macros.cmake
1 # -*- mode: cmake; indent-tabs-mode: t; -*-
2 # $Id$
3
4
5 # foo_bar.spam --> foo_barMySuffix.spam
6 macro(file_suffix
7         file_name_new file_name file_suffix
8         )
9
10         get_filename_component(_file_name_PATH ${file_name} PATH)
11         get_filename_component(_file_name_NAME_WE ${file_name} NAME_WE)
12         get_filename_component(_file_name_EXT ${file_name} EXT)
13         set(${file_name_new} "${_file_name_PATH}/${_file_name_NAME_WE}${file_suffix}${_file_name_EXT}")
14
15         unset(_file_name_PATH)
16         unset(_file_name_NAME_WE)
17         unset(_file_name_EXT)
18 endmacro()
19
20 # usefil for adding debug suffix to library lists:
21 # /somepath/foo.lib --> /somepath/foo_d.lib
22 macro(file_list_suffix
23         fp_list_new fp_list fn_suffix
24         )
25
26         # incase of empty list
27         set(_fp)
28         set(_fp_suffixed)
29
30         set(fp_list_new)
31
32         foreach(_fp ${fp_list})
33                 file_suffix(_fp_suffixed "${_fp}" "${fn_suffix}")
34                 list(APPEND "${fp_list_new}" "${_fp_suffixed}")
35         endforeach()
36
37         unset(_fp)
38         unset(_fp_suffixed)
39
40 endmacro()
41
42 # Nicer makefiles with -I/1/foo/ instead of -I/1/2/3/../../foo/
43 # use it instead of include_directories()
44 macro(blender_include_dirs
45         includes)
46         set(_ALL_INCS "")
47         foreach(_INC ${ARGV})
48                 get_filename_component(_ABS_INC ${_INC} ABSOLUTE)
49                 list(APPEND _ALL_INCS ${_ABS_INC})
50         endforeach()
51         include_directories(${_ALL_INCS})
52         unset(_INC)
53         unset(_ABS_INC)
54         unset(_ALL_INCS)
55 endmacro()
56
57 macro(blender_include_dirs_sys
58         includes)
59         set(_ALL_INCS "")
60         foreach(_INC ${ARGV})
61                 get_filename_component(_ABS_INC ${_INC} ABSOLUTE)
62                 list(APPEND _ALL_INCS ${_ABS_INC})
63         endforeach()
64         include_directories(SYSTEM ${_ALL_INCS})
65         unset(_INC)
66         unset(_ABS_INC)
67         unset(_ALL_INCS)
68 endmacro()
69
70 macro(blender_source_group
71         sources)
72
73         # Group by location on disk
74         source_group("Source Files" FILES CMakeLists.txt)
75
76         foreach(_SRC ${sources})
77                 get_filename_component(_SRC_EXT ${_SRC} EXT)
78                 if((${_SRC_EXT} MATCHES ".h") OR (${_SRC_EXT} MATCHES ".hpp"))
79                         source_group("Header Files" FILES ${_SRC})
80                 else()
81                         source_group("Source Files" FILES ${_SRC})
82                 endif()
83         endforeach()
84
85         unset(_SRC)
86         unset(_SRC_EXT)
87 endmacro()
88
89
90 # only MSVC uses SOURCE_GROUP
91 macro(blender_add_lib_nolist
92         name
93         sources
94         includes
95         includes_sys)
96
97         # message(STATUS "Configuring library ${name}")
98
99         # include_directories(${includes})
100         # include_directories(SYSTEM ${includes_sys})
101         blender_include_dirs("${includes}")
102         blender_include_dirs_sys("${includes_sys}")
103
104         add_library(${name} ${sources})
105
106         # works fine without having the includes
107         # listed is helpful for IDE's (QtCreator/MSVC)
108         blender_source_group("${sources}")
109
110 endmacro()
111
112
113 macro(blender_add_lib
114         name
115         sources
116         includes
117         includes_sys)
118
119         blender_add_lib_nolist(${name} "${sources}" "${includes}" "${includes_sys}")
120
121         set_property(GLOBAL APPEND PROPERTY BLENDER_LINK_LIBS ${name})
122 endmacro()
123
124
125 macro(SETUP_LIBDIRS)
126         # see "cmake --help-policy CMP0003"
127         if(COMMAND cmake_policy)
128                 cmake_policy(SET CMP0003 NEW)
129         endif()
130
131         link_directories(${JPEG_LIBPATH} ${PNG_LIBPATH} ${ZLIB_LIBPATH} ${FREETYPE_LIBPATH})
132
133         if(WITH_PYTHON)  #  AND NOT WITH_PYTHON_MODULE  # WIN32 needs
134                 link_directories(${PYTHON_LIBPATH})
135         endif()
136         if(WITH_INTERNATIONAL)
137                 link_directories(${ICONV_LIBPATH})
138                 link_directories(${GETTEXT_LIBPATH})
139         endif()
140         if(WITH_SDL)
141                 link_directories(${SDL_LIBPATH})
142         endif()
143         if(WITH_CODEC_FFMPEG)
144                 link_directories(${FFMPEG_LIBPATH})
145         endif()
146         if(WITH_IMAGE_OPENEXR)
147                 link_directories(${OPENEXR_LIBPATH})
148         endif()
149         if(WITH_IMAGE_TIFF)
150                 link_directories(${TIFF_LIBPATH})
151         endif()
152         if(WITH_IMAGE_OPENJPEG AND UNIX AND NOT APPLE)
153                 link_directories(${OPENJPEG_LIBPATH})
154         endif()
155         if(WITH_CODEC_QUICKTIME)
156                 link_directories(${QUICKTIME_LIBPATH})
157         endif()
158         if(WITH_OPENAL)
159                 link_directories(${OPENAL_LIBPATH})
160         endif()
161         if(WITH_JACK)
162                 link_directories(${JACK_LIBPATH})
163         endif()
164         if(WITH_CODEC_SNDFILE)
165                 link_directories(${SNDFILE_LIBPATH})
166         endif()
167         if(WITH_SAMPLERATE)
168                 link_directories(${SAMPLERATE_LIBPATH})
169         endif()
170         if(WITH_FFTW3)
171                 link_directories(${FFTW3_LIBPATH})
172         endif()
173         if(WITH_OPENCOLLADA)
174                 link_directories(${OPENCOLLADA_LIBPATH})
175                 link_directories(${PCRE_LIBPATH})
176                 link_directories(${EXPAT_LIBPATH})
177         endif()
178         if(WITH_MEM_JEMALLOC)
179                 link_directories(${JEMALLOC_LIBPATH})
180         endif()
181
182         if(WIN32 AND NOT UNIX)
183                 link_directories(${PTHREADS_LIBPATH})
184         endif()
185 endmacro()
186
187 macro(setup_liblinks
188         target)
189         set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS} ")
190
191         target_link_libraries(${target}
192                         ${OPENGL_gl_LIBRARY}
193                         ${OPENGL_glu_LIBRARY}
194                         ${JPEG_LIBRARIES}
195                         ${PNG_LIBRARIES}
196                         ${ZLIB_LIBRARIES}
197                         ${LLIBS})
198
199         # since we are using the local libs for python when compiling msvc projects, we need to add _d when compiling debug versions
200         if(WITH_PYTHON)  # AND NOT WITH_PYTHON_MODULE  # WIN32 needs
201                 target_link_libraries(${target} ${PYTHON_LINKFLAGS})
202
203                 if(WIN32 AND NOT UNIX)
204                         file_list_suffix(PYTHON_LIBRARIES_DEBUG "${PYTHON_LIBRARIES}" "_d")
205                         target_link_libraries(${target}
206                                         debug ${PYTHON_LIBRARIES_DEBUG}
207                                         optimized ${PYTHON_LIBRARIES})
208                         unset(PYTHON_LIBRARIES_DEBUG)
209                 else()
210                         target_link_libraries(${target} ${PYTHON_LIBRARIES})
211                 endif()
212         endif()
213
214         if(NOT WITH_BUILTIN_GLEW)
215                 target_link_libraries(${target} ${GLEW_LIBRARY})
216         endif()
217
218         target_link_libraries(${target}
219                         ${OPENGL_glu_LIBRARY}
220                         ${JPEG_LIBRARIES}
221                         ${PNG_LIBRARIES}
222                         ${ZLIB_LIBRARIES}
223                         ${FREETYPE_LIBRARY})
224
225         if(WITH_INTERNATIONAL)
226                 target_link_libraries(${target} ${GETTEXT_LIB})
227
228                 if(WIN32 AND NOT UNIX)
229                         target_link_libraries(${target} ${ICONV_LIBRARIES})
230                 endif()
231         endif()
232
233         if(WITH_OPENAL)
234                 target_link_libraries(${target} ${OPENAL_LIBRARY})
235         endif()
236         if(WITH_FFTW3)
237                 target_link_libraries(${target} ${FFTW3_LIBRARIES})
238         endif()
239         if(WITH_JACK)
240                 target_link_libraries(${target} ${JACK_LIBRARIES})
241         endif()
242         if(WITH_CODEC_SNDFILE)
243                 target_link_libraries(${target} ${SNDFILE_LIBRARIES})
244         endif()
245         if(WITH_SAMPLERATE)
246                 target_link_libraries(${target} ${SAMPLERATE_LIBRARIES})
247         endif()
248         if(WITH_SDL)
249                 target_link_libraries(${target} ${SDL_LIBRARY})
250         endif()
251         if(WITH_CODEC_QUICKTIME)
252                 target_link_libraries(${target} ${QUICKTIME_LIBRARIES})
253         endif()
254         if(WITH_IMAGE_TIFF)
255                 target_link_libraries(${target} ${TIFF_LIBRARY})
256         endif()
257         if(WITH_IMAGE_OPENEXR)
258                 if(WIN32 AND NOT UNIX)
259                         file_list_suffix(OPENEXR_LIBRARIES_DEBUG "${OPENEXR_LIBRARIES}" "_d")
260                         target_link_libraries(${target}
261                                         debug ${OPENEXR_LIBRARIES_DEBUG}
262                                         optimized ${OPENEXR_LIBRARIES})
263                         unset(OPENEXR_LIBRARIES_DEBUG)
264                 else()
265                         target_link_libraries(${target} ${OPENEXR_LIBRARIES})
266                 endif()
267         endif()
268         if(WITH_IMAGE_OPENJPEG AND UNIX AND NOT APPLE)
269                 target_link_libraries(${target} ${OPENJPEG_LIBRARIES})
270         endif()
271         if(WITH_CODEC_FFMPEG)
272                 target_link_libraries(${target} ${FFMPEG_LIBRARIES})
273         endif()
274         if(WITH_OPENCOLLADA)
275                 if(WIN32 AND NOT UNIX)
276                         file_list_suffix(OPENCOLLADA_LIBRARIES_DEBUG "${OPENCOLLADA_LIBRARIES}" "_d")
277                         target_link_libraries(${target}
278                                         debug ${OPENCOLLADA_LIBRARIES_DEBUG}
279                                         optimized ${OPENCOLLADA_LIBRARIES})
280                         unset(OPENCOLLADA_LIBRARIES_DEBUG)
281
282                         file_list_suffix(PCRE_LIB_DEBUG "${PCRE_LIB}" "_d")
283                         target_link_libraries(${target}
284                                         debug ${PCRE_LIB_DEBUG}
285                                         optimized ${PCRE_LIB})
286                         unset(PCRE_LIB_DEBUG)
287
288                         if(EXPAT_LIB)
289                                 file_list_suffix(EXPAT_LIB_DEBUG "${EXPAT_LIB}" "_d")
290                                 target_link_libraries(${target}
291                                                 debug ${EXPAT_LIB_DEBUG}
292                                                 optimized ${EXPAT_LIB})
293                                 unset(EXPAT_LIB_DEBUG)
294                         endif()
295                 else()
296                         target_link_libraries(${target}
297                                         ${OPENCOLLADA_LIBRARIES}
298                                         ${PCRE_LIB}
299                                         ${EXPAT_LIB})
300                 endif()
301         endif()
302         if(WITH_MEM_JEMALLOC)
303                 target_link_libraries(${target} ${JEMALLOC_LIBRARIES})
304         endif()
305         if(WIN32 AND NOT UNIX)
306                 target_link_libraries(${target} ${PTHREADS_LIBRARIES})
307         endif()
308 endmacro()
309
310 macro(TEST_SSE_SUPPORT)
311         include(CheckCSourceRuns)
312
313         # message(STATUS "Detecting SSE support")
314         if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
315                 set(CMAKE_REQUIRED_FLAGS "-msse -msse2")
316         elseif(MSVC)
317                 set(CMAKE_REQUIRED_FLAGS "/arch:SSE2") # TODO, SSE 1 ?
318         endif()
319
320         if(NOT DEFINED ${SUPPORT_SSE_BUILD})
321                 check_c_source_runs("
322                         #include <xmmintrin.h>
323                         int main() { __m128 v = _mm_setzero_ps(); return 0; }"
324                 SUPPORT_SSE_BUILD)
325                 
326                 if(SUPPORT_SSE_BUILD)
327                         message(STATUS "SSE Support: detected.")
328                 else()
329                         message(STATUS "SSE Support: missing.")
330                 endif()
331                 set(${SUPPORT_SSE_BUILD} ${SUPPORT_SSE_BUILD} CACHE INTERNAL "SSE Test")
332         endif() 
333
334         if(NOT DEFINED ${SUPPORT_SSE2_BUILD})
335                 check_c_source_runs("
336                         #include <emmintrin.h>
337                         int main() { __m128d v = _mm_setzero_pd(); return 0; }"
338                 SUPPORT_SSE2_BUILD)
339
340                 if(SUPPORT_SSE2_BUILD)
341                         message(STATUS "SSE2 Support: detected.")
342                 else()
343                         message(STATUS "SSE2 Support: missing.")
344                 endif() 
345                 set(${SUPPORT_SSE2_BUILD} ${SUPPORT_SSE2_BUILD} CACHE INTERNAL "SSE2 Test")
346         endif()
347
348 endmacro()
349
350 # when we have warnings as errors applied globally this
351 # needs to be removed for some external libs which we dont maintain.
352
353 # utility macro
354 macro(remove_flag
355         flag)
356
357         string(REGEX REPLACE ${flag} "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
358         string(REGEX REPLACE ${flag} "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
359         string(REGEX REPLACE ${flag} "" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
360         string(REGEX REPLACE ${flag} "" CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL}")
361         string(REGEX REPLACE ${flag} "" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
362
363         string(REGEX REPLACE ${flag} "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
364         string(REGEX REPLACE ${flag} "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
365         string(REGEX REPLACE ${flag} "" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
366         string(REGEX REPLACE ${flag} "" CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL}")
367         string(REGEX REPLACE ${flag} "" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
368
369 endmacro()
370
371 macro(remove_strict_flags)
372
373         if(CMAKE_COMPILER_IS_GNUCC)
374                 remove_flag("-Wstrict-prototypes")
375                 remove_flag("-Wunused-parameter")
376                 remove_flag("-Wwrite-strings")
377                 remove_flag("-Wshadow")
378                 remove_flag("-Werror=[^ ]+")
379                 remove_flag("-Werror")
380         endif()
381
382         if(MSVC)
383                 # TODO
384         endif()
385
386 endmacro()
387
388 macro(ADD_CHECK_C_COMPILER_FLAG
389         _CFLAGS
390         _CACHE_VAR
391         _FLAG)
392
393         include(CheckCCompilerFlag)
394
395         CHECK_C_COMPILER_FLAG("${_FLAG}" "${_CACHE_VAR}")
396         if(${_CACHE_VAR})
397                 # message(STATUS "Using CFLAG: ${_FLAG}")
398                 set(${_CFLAGS} "${${_CFLAGS}} ${_FLAG}")
399         else()
400                 message(STATUS "Unsupported CFLAG: ${_FLAG}")
401         endif()
402 endmacro()
403
404 macro(ADD_CHECK_CXX_COMPILER_FLAG
405         _CXXFLAGS
406         _CACHE_VAR
407         _FLAG)
408
409         include(CheckCXXCompilerFlag)
410
411         CHECK_CXX_COMPILER_FLAG("${_FLAG}" "${_CACHE_VAR}")
412         if(${_CACHE_VAR})
413                 # message(STATUS "Using CXXFLAG: ${_FLAG}")
414                 set(${_CXXFLAGS} "${${_CXXFLAGS}} ${_FLAG}")
415         else()
416                 message(STATUS "Unsupported CXXFLAG: ${_FLAG}")
417         endif()
418 endmacro()
419
420 macro(get_blender_version)
421         # So cmake depends on BKE_blender.h, beware of inf-loops!
422         CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/source/blender/blenkernel/BKE_blender.h ${CMAKE_BINARY_DIR}/source/blender/blenkernel/BKE_blender.h.done)
423
424         file(STRINGS ${CMAKE_SOURCE_DIR}/source/blender/blenkernel/BKE_blender.h _contents REGEX "^#define[ \t]+BLENDER_.*$")
425
426         string(REGEX REPLACE ".*#define[ \t]+BLENDER_VERSION[ \t]+([0-9]+).*" "\\1" _out_version "${_contents}")
427         string(REGEX REPLACE ".*#define[ \t]+BLENDER_SUBVERSION[ \t]+([0-9]+).*" "\\1" _out_subversion "${_contents}")
428         string(REGEX REPLACE ".*#define[ \t]+BLENDER_VERSION_CHAR[ \t]+([a-z]+).*" "\\1" _out_version_char "${_contents}")
429         string(REGEX REPLACE ".*#define[ \t]+BLENDER_VERSION_CYCLE[ \t]+([a-z]+).*" "\\1" _out_version_cycle "${_contents}")
430
431         if(NOT ${_out_version} MATCHES "[0-9]+")
432                 message(FATAL_ERROR "Version parsing failed for BLENDER_VERSION")
433         endif()
434
435         if(NOT ${_out_subversion} MATCHES "[0-9]+")
436                 message(FATAL_ERROR "Version parsing failed for BLENDER_SUBVERSION")
437         endif()
438
439         # clumsy regex, only single char are ok but it could be unset
440
441         string(LENGTH "${_out_version_char}" _out_version_char_len)
442         if(NOT _out_version_char_len EQUAL 1)
443                 set(_out_version_char "")
444         elseif(NOT ${_out_version_char} MATCHES "[a-z]+")
445                 message(FATAL_ERROR "Version parsing failed for BLENDER_VERSION_CHAR")
446         endif()
447
448         if(NOT ${_out_version_cycle} MATCHES "[a-z]+")
449                 message(FATAL_ERROR "Version parsing failed for BLENDER_VERSION_CYCLE")
450         endif()
451
452         math(EXPR BLENDER_VERSION_MAJOR "${_out_version} / 100")
453         math(EXPR BLENDER_VERSION_MINOR "${_out_version} % 100")
454         set(BLENDER_VERSION "${BLENDER_VERSION_MAJOR}.${BLENDER_VERSION_MINOR}")
455
456         set(BLENDER_SUBVERSION ${_out_subversion})
457         set(BLENDER_VERSION_CHAR ${_out_version_char})
458         set(BLENDER_VERSION_CYCLE ${_out_version_cycle})
459
460         # for packaging, alpha to numbers
461         string(COMPARE EQUAL "${BLENDER_VERSION_CHAR}" "" _out_version_char_empty)
462         if(${_out_version_char_empty})
463                 set(BLENDER_VERSION_CHAR_INDEX "0")
464         else()
465                 set(_char_ls a b c d e f g h i j k l m n o p q r s t u v w q y z)
466                 list(FIND _char_ls ${BLENDER_VERSION_CHAR} _out_version_char_index)
467                 math(EXPR BLENDER_VERSION_CHAR_INDEX "${_out_version_char_index} + 1")
468                 unset(_char_ls)
469                 unset(_out_version_char_index)
470         endif()
471
472         unset(_out_subversion)
473         unset(_out_version_char)
474         unset(_out_version_char_empty)
475         unset(_out_version_cycle)
476
477         # message(STATUS "Version (Internal): ${BLENDER_VERSION}.${BLENDER_SUBVERSION}, Version (external): ${BLENDER_VERSION}${BLENDER_VERSION_CHAR}-${BLENDER_VERSION_CYCLE}")
478 endmacro()
479
480
481 # hacks to override initial project settings
482 # these macros must be called directly before/after project(Blender) 
483 macro(blender_project_hack_pre)
484         # ----------------
485         # MINGW HACK START
486         # ignore system set flag, use our own
487         # must be before project(...)
488         # if the user wants to add their own its ok after first run.
489         if(DEFINED CMAKE_C_STANDARD_LIBRARIES)
490                 set(_reset_standard_libraries OFF)
491         else()
492                 set(_reset_standard_libraries ON)
493         endif()
494
495         # ------------------
496         # GCC -O3 HACK START
497         # needed because O3 can cause problems but
498         # allow the builder to set O3 manually after.
499         if(DEFINED CMAKE_C_FLAGS_RELEASE)
500                 set(_reset_standard_cflags_rel OFF)
501         else()
502                 set(_reset_standard_cflags_rel ON)
503         endif()
504         if(DEFINED CMAKE_CXX_FLAGS_RELEASE)
505                 set(_reset_standard_cxxflags_rel OFF)
506         else()
507                 set(_reset_standard_cxxflags_rel ON)
508         endif()
509 endmacro()
510
511
512 macro(blender_project_hack_post)
513         # --------------
514         # MINGW HACK END
515         if (_reset_standard_libraries)
516                 # Must come after project(...)
517                 #
518                 # MINGW workaround for -ladvapi32 being included which surprisingly causes
519                 # string formatting of floats, eg: printf("%.*f", 3, value). to crash blender
520                 # with a meaningless stack trace. by overriding this flag we ensure we only
521                 # have libs we define and that cmake & scons builds match.
522                 set(CMAKE_C_STANDARD_LIBRARIES "" CACHE STRING "" FORCE)
523                 set(CMAKE_CXX_STANDARD_LIBRARIES "" CACHE STRING "" FORCE)
524                 mark_as_advanced(CMAKE_C_STANDARD_LIBRARIES)
525                 mark_as_advanced(CMAKE_CXX_STANDARD_LIBRARIES)
526         endif()
527         unset(_reset_standard_libraries)
528
529
530         # ----------------
531         # GCC -O3 HACK END
532         if(_reset_standard_cflags_rel)
533                 string(REGEX REPLACE "-O3" "-O2" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
534                 set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}" CACHE STRING "" FORCE)
535                 mark_as_advanced(CMAKE_C_FLAGS_RELEASE)
536         endif()
537
538         if(_reset_standard_cxxflags_rel)
539                 string(REGEX REPLACE "-O3" "-O2" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
540                 set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}" CACHE STRING "" FORCE)
541                 mark_as_advanced(CMAKE_CXX_FLAGS_RELEASE)
542         endif()
543
544         unset(_reset_standard_cflags_rel)
545         unset(_reset_standard_cxxflags_rel)
546
547         # ------------------------------------------------------------------
548         # workaround for omission in cmake 2.8.4's GNU.cmake, fixed in 2.8.5
549         if(CMAKE_COMPILER_IS_GNUCC)
550                 if(NOT DARWIN)
551                         set(CMAKE_INCLUDE_SYSTEM_FLAG_C "-isystem ")
552                 endif()
553         endif()
554
555 endmacro()