Removed a remnant to an unsuccessful attempt to get clipping functional so I can...
[blender.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
190         set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}")
191         set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}")
192
193         target_link_libraries(${target}
194                         ${OPENGL_gl_LIBRARY}
195                         ${OPENGL_glu_LIBRARY}
196                         ${JPEG_LIBRARIES}
197                         ${PNG_LIBRARIES}
198                         ${ZLIB_LIBRARIES}
199                         ${PLATFORM_LINKLIBS})
200
201         # since we are using the local libs for python when compiling msvc projects, we need to add _d when compiling debug versions
202         if(WITH_PYTHON)  # AND NOT WITH_PYTHON_MODULE  # WIN32 needs
203                 target_link_libraries(${target} ${PYTHON_LINKFLAGS})
204
205                 if(WIN32 AND NOT UNIX)
206                         file_list_suffix(PYTHON_LIBRARIES_DEBUG "${PYTHON_LIBRARIES}" "_d")
207                         target_link_libraries(${target}
208                                         debug ${PYTHON_LIBRARIES_DEBUG}
209                                         optimized ${PYTHON_LIBRARIES})
210                         unset(PYTHON_LIBRARIES_DEBUG)
211                 else()
212                         target_link_libraries(${target} ${PYTHON_LIBRARIES})
213                 endif()
214         endif()
215
216         if(NOT WITH_BUILTIN_GLEW)
217                 target_link_libraries(${target} ${GLEW_LIBRARY})
218         endif()
219
220         target_link_libraries(${target}
221                         ${OPENGL_glu_LIBRARY}
222                         ${JPEG_LIBRARIES}
223                         ${PNG_LIBRARIES}
224                         ${ZLIB_LIBRARIES}
225                         ${FREETYPE_LIBRARY})
226
227         if(WITH_INTERNATIONAL)
228                 target_link_libraries(${target} ${GETTEXT_LIB})
229
230                 if(WIN32 AND NOT UNIX)
231                         target_link_libraries(${target} ${ICONV_LIBRARIES})
232                 endif()
233         endif()
234
235         if(WITH_OPENAL)
236                 target_link_libraries(${target} ${OPENAL_LIBRARY})
237         endif()
238         if(WITH_FFTW3)
239                 target_link_libraries(${target} ${FFTW3_LIBRARIES})
240         endif()
241         if(WITH_JACK)
242                 target_link_libraries(${target} ${JACK_LIBRARIES})
243         endif()
244         if(WITH_CODEC_SNDFILE)
245                 target_link_libraries(${target} ${SNDFILE_LIBRARIES})
246         endif()
247         if(WITH_SAMPLERATE)
248                 target_link_libraries(${target} ${SAMPLERATE_LIBRARIES})
249         endif()
250         if(WITH_SDL)
251                 target_link_libraries(${target} ${SDL_LIBRARY})
252         endif()
253         if(WITH_CODEC_QUICKTIME)
254                 target_link_libraries(${target} ${QUICKTIME_LIBRARIES})
255         endif()
256         if(WITH_IMAGE_TIFF)
257                 target_link_libraries(${target} ${TIFF_LIBRARY})
258         endif()
259         if(WITH_IMAGE_OPENEXR)
260                 if(WIN32 AND NOT UNIX)
261                         file_list_suffix(OPENEXR_LIBRARIES_DEBUG "${OPENEXR_LIBRARIES}" "_d")
262                         target_link_libraries(${target}
263                                         debug ${OPENEXR_LIBRARIES_DEBUG}
264                                         optimized ${OPENEXR_LIBRARIES})
265                         unset(OPENEXR_LIBRARIES_DEBUG)
266                 else()
267                         target_link_libraries(${target} ${OPENEXR_LIBRARIES})
268                 endif()
269         endif()
270         if(WITH_IMAGE_OPENJPEG AND UNIX AND NOT APPLE)
271                 target_link_libraries(${target} ${OPENJPEG_LIBRARIES})
272         endif()
273         if(WITH_CODEC_FFMPEG)
274                 target_link_libraries(${target} ${FFMPEG_LIBRARIES})
275         endif()
276         if(WITH_OPENCOLLADA)
277                 if(WIN32 AND NOT UNIX)
278                         file_list_suffix(OPENCOLLADA_LIBRARIES_DEBUG "${OPENCOLLADA_LIBRARIES}" "_d")
279                         target_link_libraries(${target}
280                                         debug ${OPENCOLLADA_LIBRARIES_DEBUG}
281                                         optimized ${OPENCOLLADA_LIBRARIES})
282                         unset(OPENCOLLADA_LIBRARIES_DEBUG)
283
284                         file_list_suffix(PCRE_LIB_DEBUG "${PCRE_LIB}" "_d")
285                         target_link_libraries(${target}
286                                         debug ${PCRE_LIB_DEBUG}
287                                         optimized ${PCRE_LIB})
288                         unset(PCRE_LIB_DEBUG)
289
290                         if(EXPAT_LIB)
291                                 file_list_suffix(EXPAT_LIB_DEBUG "${EXPAT_LIB}" "_d")
292                                 target_link_libraries(${target}
293                                                 debug ${EXPAT_LIB_DEBUG}
294                                                 optimized ${EXPAT_LIB})
295                                 unset(EXPAT_LIB_DEBUG)
296                         endif()
297                 else()
298                         target_link_libraries(${target}
299                                         ${OPENCOLLADA_LIBRARIES}
300                                         ${PCRE_LIB}
301                                         ${EXPAT_LIB})
302                 endif()
303         endif()
304         if(WITH_MEM_JEMALLOC)
305                 target_link_libraries(${target} ${JEMALLOC_LIBRARIES})
306         endif()
307         if(WIN32 AND NOT UNIX)
308                 target_link_libraries(${target} ${PTHREADS_LIBRARIES})
309         endif()
310 endmacro()
311
312 macro(TEST_SSE_SUPPORT)
313         include(CheckCSourceRuns)
314
315         # message(STATUS "Detecting SSE support")
316         if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
317                 set(CMAKE_REQUIRED_FLAGS "-msse -msse2")
318         elseif(MSVC)
319                 set(CMAKE_REQUIRED_FLAGS "/arch:SSE2") # TODO, SSE 1 ?
320         endif()
321
322         if(NOT DEFINED ${SUPPORT_SSE_BUILD})
323                 check_c_source_runs("
324                         #include <xmmintrin.h>
325                         int main() { __m128 v = _mm_setzero_ps(); return 0; }"
326                 SUPPORT_SSE_BUILD)
327                 
328                 if(SUPPORT_SSE_BUILD)
329                         message(STATUS "SSE Support: detected.")
330                 else()
331                         message(STATUS "SSE Support: missing.")
332                 endif()
333                 set(${SUPPORT_SSE_BUILD} ${SUPPORT_SSE_BUILD} CACHE INTERNAL "SSE Test")
334         endif() 
335
336         if(NOT DEFINED ${SUPPORT_SSE2_BUILD})
337                 check_c_source_runs("
338                         #include <emmintrin.h>
339                         int main() { __m128d v = _mm_setzero_pd(); return 0; }"
340                 SUPPORT_SSE2_BUILD)
341
342                 if(SUPPORT_SSE2_BUILD)
343                         message(STATUS "SSE2 Support: detected.")
344                 else()
345                         message(STATUS "SSE2 Support: missing.")
346                 endif() 
347                 set(${SUPPORT_SSE2_BUILD} ${SUPPORT_SSE2_BUILD} CACHE INTERNAL "SSE2 Test")
348         endif()
349
350 endmacro()
351
352 # when we have warnings as errors applied globally this
353 # needs to be removed for some external libs which we dont maintain.
354
355 # utility macro
356 macro(remove_flag
357         flag)
358
359         string(REGEX REPLACE ${flag} "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
360         string(REGEX REPLACE ${flag} "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
361         string(REGEX REPLACE ${flag} "" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
362         string(REGEX REPLACE ${flag} "" CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL}")
363         string(REGEX REPLACE ${flag} "" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
364
365         string(REGEX REPLACE ${flag} "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
366         string(REGEX REPLACE ${flag} "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
367         string(REGEX REPLACE ${flag} "" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
368         string(REGEX REPLACE ${flag} "" CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL}")
369         string(REGEX REPLACE ${flag} "" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
370
371 endmacro()
372
373 macro(remove_strict_flags)
374
375         if(CMAKE_COMPILER_IS_GNUCC)
376                 remove_flag("-Wstrict-prototypes")
377                 remove_flag("-Wunused-parameter")
378                 remove_flag("-Wwrite-strings")
379                 remove_flag("-Wshadow")
380                 remove_flag("-Werror=[^ ]+")
381                 remove_flag("-Werror")
382         endif()
383
384         if(MSVC)
385                 # TODO
386         endif()
387
388 endmacro()
389
390 macro(ADD_CHECK_C_COMPILER_FLAG
391         _CFLAGS
392         _CACHE_VAR
393         _FLAG)
394
395         include(CheckCCompilerFlag)
396
397         CHECK_C_COMPILER_FLAG("${_FLAG}" "${_CACHE_VAR}")
398         if(${_CACHE_VAR})
399                 # message(STATUS "Using CFLAG: ${_FLAG}")
400                 set(${_CFLAGS} "${${_CFLAGS}} ${_FLAG}")
401         else()
402                 message(STATUS "Unsupported CFLAG: ${_FLAG}")
403         endif()
404 endmacro()
405
406 macro(ADD_CHECK_CXX_COMPILER_FLAG
407         _CXXFLAGS
408         _CACHE_VAR
409         _FLAG)
410
411         include(CheckCXXCompilerFlag)
412
413         CHECK_CXX_COMPILER_FLAG("${_FLAG}" "${_CACHE_VAR}")
414         if(${_CACHE_VAR})
415                 # message(STATUS "Using CXXFLAG: ${_FLAG}")
416                 set(${_CXXFLAGS} "${${_CXXFLAGS}} ${_FLAG}")
417         else()
418                 message(STATUS "Unsupported CXXFLAG: ${_FLAG}")
419         endif()
420 endmacro()
421
422 macro(get_blender_version)
423         # So cmake depends on BKE_blender.h, beware of inf-loops!
424         CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/source/blender/blenkernel/BKE_blender.h ${CMAKE_BINARY_DIR}/source/blender/blenkernel/BKE_blender.h.done)
425
426         file(STRINGS ${CMAKE_SOURCE_DIR}/source/blender/blenkernel/BKE_blender.h _contents REGEX "^#define[ \t]+BLENDER_.*$")
427
428         string(REGEX REPLACE ".*#define[ \t]+BLENDER_VERSION[ \t]+([0-9]+).*" "\\1" _out_version "${_contents}")
429         string(REGEX REPLACE ".*#define[ \t]+BLENDER_SUBVERSION[ \t]+([0-9]+).*" "\\1" _out_subversion "${_contents}")
430         string(REGEX REPLACE ".*#define[ \t]+BLENDER_VERSION_CHAR[ \t]+([a-z]+).*" "\\1" _out_version_char "${_contents}")
431         string(REGEX REPLACE ".*#define[ \t]+BLENDER_VERSION_CYCLE[ \t]+([a-z]+).*" "\\1" _out_version_cycle "${_contents}")
432
433         if(NOT ${_out_version} MATCHES "[0-9]+")
434                 message(FATAL_ERROR "Version parsing failed for BLENDER_VERSION")
435         endif()
436
437         if(NOT ${_out_subversion} MATCHES "[0-9]+")
438                 message(FATAL_ERROR "Version parsing failed for BLENDER_SUBVERSION")
439         endif()
440
441         # clumsy regex, only single char are ok but it could be unset
442
443         string(LENGTH "${_out_version_char}" _out_version_char_len)
444         if(NOT _out_version_char_len EQUAL 1)
445                 set(_out_version_char "")
446         elseif(NOT ${_out_version_char} MATCHES "[a-z]+")
447                 message(FATAL_ERROR "Version parsing failed for BLENDER_VERSION_CHAR")
448         endif()
449
450         if(NOT ${_out_version_cycle} MATCHES "[a-z]+")
451                 message(FATAL_ERROR "Version parsing failed for BLENDER_VERSION_CYCLE")
452         endif()
453
454         math(EXPR BLENDER_VERSION_MAJOR "${_out_version} / 100")
455         math(EXPR BLENDER_VERSION_MINOR "${_out_version} % 100")
456         set(BLENDER_VERSION "${BLENDER_VERSION_MAJOR}.${BLENDER_VERSION_MINOR}")
457
458         set(BLENDER_SUBVERSION ${_out_subversion})
459         set(BLENDER_VERSION_CHAR ${_out_version_char})
460         set(BLENDER_VERSION_CYCLE ${_out_version_cycle})
461
462         # for packaging, alpha to numbers
463         string(COMPARE EQUAL "${BLENDER_VERSION_CHAR}" "" _out_version_char_empty)
464         if(${_out_version_char_empty})
465                 set(BLENDER_VERSION_CHAR_INDEX "0")
466         else()
467                 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)
468                 list(FIND _char_ls ${BLENDER_VERSION_CHAR} _out_version_char_index)
469                 math(EXPR BLENDER_VERSION_CHAR_INDEX "${_out_version_char_index} + 1")
470                 unset(_char_ls)
471                 unset(_out_version_char_index)
472         endif()
473
474         unset(_out_subversion)
475         unset(_out_version_char)
476         unset(_out_version_char_empty)
477         unset(_out_version_cycle)
478
479         # message(STATUS "Version (Internal): ${BLENDER_VERSION}.${BLENDER_SUBVERSION}, Version (external): ${BLENDER_VERSION}${BLENDER_VERSION_CHAR}-${BLENDER_VERSION_CYCLE}")
480 endmacro()
481
482
483 # hacks to override initial project settings
484 # these macros must be called directly before/after project(Blender) 
485 macro(blender_project_hack_pre)
486         # ----------------
487         # MINGW HACK START
488         # ignore system set flag, use our own
489         # must be before project(...)
490         # if the user wants to add their own its ok after first run.
491         if(DEFINED CMAKE_C_STANDARD_LIBRARIES)
492                 set(_reset_standard_libraries OFF)
493         else()
494                 set(_reset_standard_libraries ON)
495         endif()
496
497         # ------------------
498         # GCC -O3 HACK START
499         # needed because O3 can cause problems but
500         # allow the builder to set O3 manually after.
501         if(DEFINED CMAKE_C_FLAGS_RELEASE)
502                 set(_reset_standard_cflags_rel OFF)
503         else()
504                 set(_reset_standard_cflags_rel ON)
505         endif()
506         if(DEFINED CMAKE_CXX_FLAGS_RELEASE)
507                 set(_reset_standard_cxxflags_rel OFF)
508         else()
509                 set(_reset_standard_cxxflags_rel ON)
510         endif()
511 endmacro()
512
513
514 macro(blender_project_hack_post)
515         # --------------
516         # MINGW HACK END
517         if (_reset_standard_libraries)
518                 # Must come after project(...)
519                 #
520                 # MINGW workaround for -ladvapi32 being included which surprisingly causes
521                 # string formatting of floats, eg: printf("%.*f", 3, value). to crash blender
522                 # with a meaningless stack trace. by overriding this flag we ensure we only
523                 # have libs we define and that cmake & scons builds match.
524                 set(CMAKE_C_STANDARD_LIBRARIES "" CACHE STRING "" FORCE)
525                 set(CMAKE_CXX_STANDARD_LIBRARIES "" CACHE STRING "" FORCE)
526                 mark_as_advanced(CMAKE_C_STANDARD_LIBRARIES)
527                 mark_as_advanced(CMAKE_CXX_STANDARD_LIBRARIES)
528         endif()
529         unset(_reset_standard_libraries)
530
531
532         # ----------------
533         # GCC -O3 HACK END
534         if(_reset_standard_cflags_rel)
535                 string(REGEX REPLACE "-O3" "-O2" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
536                 set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}" CACHE STRING "" FORCE)
537                 mark_as_advanced(CMAKE_C_FLAGS_RELEASE)
538         endif()
539
540         if(_reset_standard_cxxflags_rel)
541                 string(REGEX REPLACE "-O3" "-O2" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
542                 set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}" CACHE STRING "" FORCE)
543                 mark_as_advanced(CMAKE_CXX_FLAGS_RELEASE)
544         endif()
545
546         unset(_reset_standard_cflags_rel)
547         unset(_reset_standard_cxxflags_rel)
548
549         # ------------------------------------------------------------------
550         # workaround for omission in cmake 2.8.4's GNU.cmake, fixed in 2.8.5
551         if(CMAKE_COMPILER_IS_GNUCC)
552                 if(NOT DARWIN)
553                         set(CMAKE_INCLUDE_SYSTEM_FLAG_C "-isystem ")
554                 endif()
555         endif()
556
557 endmacro()