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.cmake46
1 files changed, 29 insertions, 17 deletions
diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index bb3761d4539..34301458a06 100644
--- a/build_files/cmake/macros.cmake
+++ b/build_files/cmake/macros.cmake
@@ -39,6 +39,21 @@ macro(file_list_suffix
endmacro()
+
+macro(target_link_libraries_optimized TARGET LIBS)
+ foreach(_LIB ${LIBS})
+ target_link_libraries(${TARGET} optimized "${_LIB}")
+ endforeach()
+ unset(_LIB)
+endmacro()
+
+macro(target_link_libraries_debug TARGET LIBS)
+ foreach(_LIB ${LIBS})
+ target_link_libraries(${TARGET} debug "${_LIB}")
+ endforeach()
+ unset(_LIB)
+endmacro()
+
# Nicer makefiles with -I/1/foo/ instead of -I/1/2/3/../../foo/
# use it instead of include_directories()
macro(blender_include_dirs
@@ -186,7 +201,9 @@ endmacro()
macro(setup_liblinks
target)
- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS} ")
+
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}")
+ set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}")
target_link_libraries(${target}
${OPENGL_gl_LIBRARY}
@@ -194,7 +211,7 @@ macro(setup_liblinks
${JPEG_LIBRARIES}
${PNG_LIBRARIES}
${ZLIB_LIBRARIES}
- ${LLIBS})
+ ${PLATFORM_LINKLIBS})
# since we are using the local libs for python when compiling msvc projects, we need to add _d when compiling debug versions
if(WITH_PYTHON) # AND NOT WITH_PYTHON_MODULE # WIN32 needs
@@ -202,9 +219,8 @@ macro(setup_liblinks
if(WIN32 AND NOT UNIX)
file_list_suffix(PYTHON_LIBRARIES_DEBUG "${PYTHON_LIBRARIES}" "_d")
- target_link_libraries(${target}
- debug ${PYTHON_LIBRARIES_DEBUG}
- optimized ${PYTHON_LIBRARIES})
+ target_link_libraries_debug(${target} "${PYTHON_LIBRARIES_DEBUG}")
+ target_link_libraries_optimized(${target} "${PYTHON_LIBRARIES}")
unset(PYTHON_LIBRARIES_DEBUG)
else()
target_link_libraries(${target} ${PYTHON_LIBRARIES})
@@ -257,9 +273,8 @@ macro(setup_liblinks
if(WITH_IMAGE_OPENEXR)
if(WIN32 AND NOT UNIX)
file_list_suffix(OPENEXR_LIBRARIES_DEBUG "${OPENEXR_LIBRARIES}" "_d")
- target_link_libraries(${target}
- debug ${OPENEXR_LIBRARIES_DEBUG}
- optimized ${OPENEXR_LIBRARIES})
+ target_link_libraries_debug(${target} "${OPENEXR_LIBRARIES_DEBUG}")
+ target_link_libraries_optimized(${target} "${OPENEXR_LIBRARIES}")
unset(OPENEXR_LIBRARIES_DEBUG)
else()
target_link_libraries(${target} ${OPENEXR_LIBRARIES})
@@ -274,22 +289,19 @@ macro(setup_liblinks
if(WITH_OPENCOLLADA)
if(WIN32 AND NOT UNIX)
file_list_suffix(OPENCOLLADA_LIBRARIES_DEBUG "${OPENCOLLADA_LIBRARIES}" "_d")
- target_link_libraries(${target}
- debug ${OPENCOLLADA_LIBRARIES_DEBUG}
- optimized ${OPENCOLLADA_LIBRARIES})
+ target_link_libraries_debug(${target} "${OPENCOLLADA_LIBRARIES_DEBUG}")
+ target_link_libraries_optimized(${target} "${OPENCOLLADA_LIBRARIES}")
unset(OPENCOLLADA_LIBRARIES_DEBUG)
file_list_suffix(PCRE_LIB_DEBUG "${PCRE_LIB}" "_d")
- target_link_libraries(${target}
- debug ${PCRE_LIB_DEBUG}
- optimized ${PCRE_LIB})
+ target_link_libraries_debug(${target} "${PCRE_LIB_DEBUG}")
+ target_link_libraries_optimized(${target} "${PCRE_LIB}")
unset(PCRE_LIB_DEBUG)
if(EXPAT_LIB)
file_list_suffix(EXPAT_LIB_DEBUG "${EXPAT_LIB}" "_d")
- target_link_libraries(${target}
- debug ${EXPAT_LIB_DEBUG}
- optimized ${EXPAT_LIB})
+ target_link_libraries_debug(${target} "${EXPAT_LIB_DEBUG}")
+ target_link_libraries_optimized(${target} "${EXPAT_LIB}")
unset(EXPAT_LIB_DEBUG)
endif()
else()