Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'build_files/cmake/macros.cmake')
-rw-r--r--build_files/cmake/macros.cmake43
1 files changed, 26 insertions, 17 deletions
diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index b42e62e719c..40bea5ed761 100644
--- a/build_files/cmake/macros.cmake
+++ b/build_files/cmake/macros.cmake
@@ -221,7 +221,7 @@ macro(SETUP_LIBDIRS)
if(WITH_PYTHON) # AND NOT WITH_PYTHON_MODULE # WIN32 needs
link_directories(${PYTHON_LIBPATH})
endif()
- if(WITH_SDL)
+ if(WITH_SDL AND NOT WITH_SDL_DYNLOAD)
link_directories(${SDL_LIBPATH})
endif()
if(WITH_CODEC_FFMPEG)
@@ -321,7 +321,7 @@ macro(setup_liblinks
if(WITH_CODEC_SNDFILE)
target_link_libraries(${target} ${SNDFILE_LIBRARIES})
endif()
- if(WITH_SDL)
+ if(WITH_SDL AND NOT WITH_SDL_DYNLOAD)
target_link_libraries(${target} ${SDL_LIBRARY})
endif()
if(WITH_CODEC_QUICKTIME)
@@ -559,6 +559,7 @@ macro(SETUP_BLENDER_SORTED_LIBS)
extern_wcwidth
extern_libmv
extern_glog
+ extern_sdlew
bf_intern_glew_mx
)
@@ -722,6 +723,8 @@ macro(TEST_SSE_SUPPORT
endmacro()
macro(TEST_STDBOOL_SUPPORT)
+ include(CheckCSourceRuns)
+
# This program will compile correctly if and only if
# this C compiler supports C99 stdbool.
check_c_source_runs("
@@ -996,7 +999,7 @@ macro(ADD_CHECK_CXX_COMPILER_FLAG
endif()
endmacro()
-macro(get_blender_version)
+function(get_blender_version)
# So cmake depends on BKE_blender.h, beware of inf-loops!
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/source/blender/blenkernel/BKE_blender.h
${CMAKE_BINARY_DIR}/source/blender/blenkernel/BKE_blender.h.done)
@@ -1031,31 +1034,24 @@ macro(get_blender_version)
math(EXPR BLENDER_VERSION_MAJOR "${_out_version} / 100")
math(EXPR BLENDER_VERSION_MINOR "${_out_version} % 100")
- set(BLENDER_VERSION "${BLENDER_VERSION_MAJOR}.${BLENDER_VERSION_MINOR}")
+ set(BLENDER_VERSION "${BLENDER_VERSION_MAJOR}.${BLENDER_VERSION_MINOR}" PARENT_SCOPE)
- set(BLENDER_SUBVERSION ${_out_subversion})
- set(BLENDER_VERSION_CHAR ${_out_version_char})
- set(BLENDER_VERSION_CYCLE ${_out_version_cycle})
+ set(BLENDER_SUBVERSION ${_out_subversion} PARENT_SCOPE)
+ set(BLENDER_VERSION_CHAR ${_out_version_char} PARENT_SCOPE)
+ set(BLENDER_VERSION_CYCLE ${_out_version_cycle} PARENT_SCOPE)
# for packaging, alpha to numbers
string(COMPARE EQUAL "${BLENDER_VERSION_CHAR}" "" _out_version_char_empty)
if(${_out_version_char_empty})
- set(BLENDER_VERSION_CHAR_INDEX "0")
+ set(BLENDER_VERSION_CHAR_INDEX "0" PARENT_SCOPE)
else()
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 x y z)
list(FIND _char_ls ${BLENDER_VERSION_CHAR} _out_version_char_index)
- math(EXPR BLENDER_VERSION_CHAR_INDEX "${_out_version_char_index} + 1")
- unset(_char_ls)
- unset(_out_version_char_index)
+ math(EXPR BLENDER_VERSION_CHAR_INDEX "${_out_version_char_index} + 1" PARENT_SCOPE)
endif()
- unset(_out_subversion)
- unset(_out_version_char)
- unset(_out_version_char_empty)
- unset(_out_version_cycle)
-
# message(STATUS "Version (Internal): ${BLENDER_VERSION}.${BLENDER_SUBVERSION}, Version (external): ${BLENDER_VERSION}${BLENDER_VERSION_CHAR}-${BLENDER_VERSION_CYCLE}")
-endmacro()
+endfunction()
# hacks to override initial project settings
@@ -1152,6 +1148,7 @@ macro(delayed_install
endif()
set_property(GLOBAL APPEND PROPERTY DELAYED_INSTALL_DESTINATIONS ${destination})
endforeach()
+ unset(f)
endmacro()
# note this is a function instead of a macro so that ${BUILD_TYPE} in targetdir
@@ -1171,6 +1168,7 @@ function(delayed_do_install
list(GET destinations ${i} d)
install(FILES ${f} DESTINATION ${targetdir}/${d})
endforeach()
+ unset(f)
endif()
endfunction()
@@ -1385,3 +1383,14 @@ macro(find_python_package
unset(_upper_package)
endmacro()
+
+# like Python's 'print(dir())'
+macro(print_all_vars)
+ get_cmake_property(_vars VARIABLES)
+ foreach(_var ${_vars})
+ message("${_var}=${${_var}}")
+ endforeach()
+ unset(_vars)
+ unset(_var)
+endmacro()
+