cmake: combine debug/optimized into one target_link_libraries() call.
authorCampbell Barton <ideasman42@gmail.com>
Wed, 15 Jun 2011 13:42:02 +0000 (13:42 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 15 Jun 2011 13:42:02 +0000 (13:42 +0000)
build_files/cmake/macros.cmake

index a862034c002c290881993b9514f020a8dd5560e9..10d6f712da1227eeb5eae68a900029baa83d58a5 100644 (file)
@@ -150,15 +150,22 @@ macro(setup_liblinks
        target)
        set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS} ")
 
-       target_link_libraries(${target} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${JPEG_LIBRARIES} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} ${LLIBS})
+       target_link_libraries(${target}
+                       ${OPENGL_gl_LIBRARY}
+                       ${OPENGL_glu_LIBRARY}
+                       ${JPEG_LIBRARIES}
+                       ${PNG_LIBRARIES}
+                       ${ZLIB_LIBRARIES}
+                       ${LLIBS})
 
        # 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
                target_link_libraries(${target} ${PYTHON_LINKFLAGS})
 
                if(WIN32 AND NOT UNIX)
-                       target_link_libraries(${target} debug ${PYTHON_LIBRARY}_d)
-                       target_link_libraries(${target} optimized ${PYTHON_LIBRARY})
+                       target_link_libraries(${target}
+                                       debug ${PYTHON_LIBRARY}_d
+                                       optimized ${PYTHON_LIBRARY})
                else()
                        target_link_libraries(${target} ${PYTHON_LIBRARY})
                endif()
@@ -168,8 +175,12 @@ macro(setup_liblinks
                target_link_libraries(${target} ${GLEW_LIBRARY})
        endif()
 
-       target_link_libraries(${target} ${OPENGL_glu_LIBRARY} ${JPEG_LIBRARIES} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES})
-       target_link_libraries(${target} ${FREETYPE_LIBRARY})
+       target_link_libraries(${target}
+                       ${OPENGL_glu_LIBRARY}
+                       ${JPEG_LIBRARIES}
+                       ${PNG_LIBRARIES}
+                       ${ZLIB_LIBRARIES}
+                       ${FREETYPE_LIBRARY})
 
        if(WITH_INTERNATIONAL)
                target_link_libraries(${target} ${GETTEXT_LIB})
@@ -206,8 +217,9 @@ macro(setup_liblinks
        if(WITH_IMAGE_OPENEXR)
                if(WIN32 AND NOT UNIX)
                        foreach(_LOOP_VAR ${OPENEXR_LIBRARIES})
-                               target_link_libraries(${target} debug ${_LOOP_VAR}_d)
-                               target_link_libraries(${target} optimized ${_LOOP_VAR})
+                               target_link_libraries(${target}
+                                               debug ${_LOOP_VAR}_d
+                                               optimized ${_LOOP_VAR})
                        endforeach()
                        unset(_LOOP_VAR)
                else()
@@ -223,20 +235,24 @@ macro(setup_liblinks
        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})
+                               target_link_libraries(${target}
+                                               debug ${_LOOP_VAR}_d
+                                               optimized ${_LOOP_VAR})
                        endforeach()
                        unset(_LOOP_VAR)
-                       target_link_libraries(${target} debug ${PCRE_LIB}_d)
-                       target_link_libraries(${target} optimized ${PCRE_LIB})
+                       target_link_libraries(${target}
+                                       debug ${PCRE_LIB}_d
+                                       optimized ${PCRE_LIB})
                        if(EXPAT_LIB)
-                               target_link_libraries(${target} debug ${EXPAT_LIB}_d)
-                               target_link_libraries(${target} optimized ${EXPAT_LIB})
+                               target_link_libraries(${target}
+                                               debug ${EXPAT_LIB}_d
+                                               optimized ${EXPAT_LIB})
                        endif()
                else()
-                       target_link_libraries(${target} ${OPENCOLLADA_LIB})
-                       target_link_libraries(${target} ${PCRE_LIB})
-                       target_link_libraries(${target} ${EXPAT_LIB})
+                       target_link_libraries(${target}
+                                       ${OPENCOLLADA_LIB}
+                                       ${PCRE_LIB}
+                                       ${EXPAT_LIB})
                endif()
        endif()
        if(WITH_MEM_JEMALLOC)