fix for using system includes, the include macro wasn't un-setting the previous inclu...
authorCampbell Barton <ideasman42@gmail.com>
Sat, 11 Jun 2011 06:00:28 +0000 (06:00 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 11 Jun 2011 06:00:28 +0000 (06:00 +0000)
Also workaround for CMake 2.8.4 & GNU-Make which doesn't set CMAKE_INCLUDE_SYSTEM_FLAG_C

build_files/cmake/FindPythonLibsUnix.cmake
build_files/cmake/macros.cmake
source/blenderplayer/CMakeLists.txt
source/creator/CMakeLists.txt

index 0752de4ce3cd18a93514b2c029ab62bf2e5946cb..2554b8a35853df323280067e9e6e043895028de9 100644 (file)
@@ -53,8 +53,17 @@ if(NOT DEFINED PYTHON_INCLUDE_DIRS)
        if(NOT _Found_PYTHON_H)
                message(FATAL_ERROR "Python.h not found")
        endif()
+       
+       unset(_Found_PYTHON_H)
+       unset(_Python_HEADER)
+       unset(_CURRENT_ABI_FLAGS)
+       unset(_CURRENT_PATH)
+       
 endif()
 
+unset(_Python_ABI_FLAGS)
+unset(_Python_PATHS)
+
 #=============================================================================
 # now the python versions are found
 
index 265d507220549bd61be3c41c183fc53bd2ca595c..6c6621b74668d7b8b9de8277f501ac0032bdded7 100644 (file)
@@ -5,22 +5,28 @@
 # use it instead of include_directories()
 macro(blender_include_dirs
        includes)
-
-       foreach(inc ${ARGV})
-               get_filename_component(abs_inc ${inc} ABSOLUTE)
-               list(APPEND all_incs ${abs_inc})
+       set(_ALL_INCS "")
+       foreach(_INC ${ARGV})
+               get_filename_component(_ABS_INC ${_INC} ABSOLUTE)
+               list(APPEND _ALL_INCS ${_ABS_INC})
        endforeach()
-       include_directories(${all_incs})
+       include_directories(${_ALL_INCS})
+       unset(_INC)
+       unset(_ABS_INC)
+       unset(_ALL_INCS)
 endmacro()
 
 macro(blender_include_dirs_sys
        includes)
-
-       foreach(inc ${ARGV})
-               get_filename_component(abs_inc ${inc} ABSOLUTE)
-               list(APPEND all_incs ${abs_inc})
+       set(_ALL_INCS "")
+       foreach(_INC ${ARGV})
+               get_filename_component(_ABS_INC ${_INC} ABSOLUTE)
+               list(APPEND _ALL_INCS ${_ABS_INC})
        endforeach()
-       include_directories(SYSTEM ${all_incs})
+       include_directories(SYSTEM ${_ALL_INCS})
+       unset(_INC)
+       unset(_ABS_INC)
+       unset(_ALL_INCS)
 endmacro()
 
 macro(blender_source_group
@@ -29,14 +35,17 @@ macro(blender_source_group
        # Group by location on disk
        source_group("Source Files" FILES CMakeLists.txt)
 
-       foreach(SRC ${sources})
-               get_filename_component(SRC_EXT ${SRC} EXT)
-               if(${SRC_EXT} MATCHES ".h" OR ${SRC_EXT} MATCHES ".hpp")
-                       source_group("Header Files" FILES ${SRC})
+       foreach(_SRC ${sources})
+               get_filename_component(_SRC_EXT ${_SRC} EXT)
+               if(${_SRC_EXT} MATCHES ".h" OR ${_SRC_EXT} MATCHES ".hpp")
+                       source_group("Header Files" FILES ${_SRC})
                else()
-                       source_group("Source Files" FILES ${SRC})
+                       source_group("Source Files" FILES ${_SRC})
                endif()
        endforeach()
+
+       unset(_SRC)
+       unset(_SRC_EXT)
 endmacro()
 
 
@@ -196,10 +205,11 @@ macro(setup_liblinks
        endif()
        if(WITH_IMAGE_OPENEXR)
                if(WIN32 AND NOT UNIX)
-                       foreach(loop_var ${OPENEXR_LIB})
-                               target_link_libraries(${target} debug ${loop_var}_d)
-                               target_link_libraries(${target} optimized ${loop_var})
+                       foreach(_LOOP_VAR ${OPENEXR_LIB})
+                               target_link_libraries(${target} debug ${_LOOP_VAR}_d)
+                               target_link_libraries(${target} optimized ${_LOOP_VAR})
                        endforeach()
+                       unset(_LOOP_VAR)
                else()
                        target_link_libraries(${target} ${OPENEXR_LIB})
                endif()
@@ -212,10 +222,11 @@ macro(setup_liblinks
        endif()
        if(WITH_OPENCOLLADA)
                if(WIN32 AND NOT UNIX)
-                       foreach(loop_var ${OPENCOLLADA_LIB})
-                               target_link_libraries(${target} debug ${loop_var}_d)
-                               target_link_libraries(${target} optimized ${loop_var})
+                       foreach(_LOOP_VAR ${OPENCOLLADA_LIB})
+                               target_link_libraries(${target} debug ${_LOOP_VAR}_d)
+                               target_link_libraries(${target} optimized ${_LOOP_VAR})
                        endforeach()
+                       unset(_LOOP_VAR)
                        target_link_libraries(${target} debug ${PCRE_LIB}_d)
                        target_link_libraries(${target} optimized ${PCRE_LIB})
                        if(EXPAT_LIB)
@@ -472,4 +483,13 @@ macro(blender_project_hack_post)
 
        unset(_reset_standard_cflags_rel)
        unset(_reset_standard_cxxflags_rel)
+
+       # --------------------------------------------------
+       # workaround for omission in cmake 2.8.4's GNU.cmake
+       if(CMAKE_COMPILER_IS_GNUCC)
+               if(NOT DARWIN)
+                       set(CMAKE_INCLUDE_SYSTEM_FLAG_C "-isystem ")
+               endif()
+       endif()
+
 endmacro()
index 901aaea3eca7037dd6f350dd10f576793c53952d..5fe045fda1087df287690dc8cb71e33da4e71c51 100644 (file)
@@ -183,6 +183,12 @@ endif()
                message(STATUS "Player Skipping: (${REM_MSG})")
        endif()
        target_link_libraries(blenderplayer ${BLENDER_SORTED_LIBS})
+
+       unset(SEARCHLIB)
+       unset(SORTLIB)
+       unset(REMLIB)
+       unset(REM_MSG)
+
 # else()
 #      target_link_libraries(blenderplayer ${BLENDER_LINK_LIBS})
 # endif()
index db467eebb5c26f5c126af39bae68641d1f821b0f..85fda11bd6695a4ed2bfd3f8e1bfd6cc5618eba3 100644 (file)
@@ -851,6 +851,12 @@ endif()
                message(STATUS "Blender Skipping: (${REM_MSG})")
        endif()
        target_link_libraries(blender ${BLENDER_SORTED_LIBS})
+       
+       unset(SEARCHLIB)
+       unset(SORTLIB)
+       unset(REMLIB)
+       unset(REM_MSG)
+       
 #else()
 #      target_link_libraries(blender ${BLENDER_LINK_LIBS})
 #endif()