CMake: cleanup, arg rename, add definitions last
authorCampbell Barton <ideasman42@gmail.com>
Tue, 16 Apr 2019 04:11:27 +0000 (06:11 +0200)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 16 Apr 2019 04:15:18 +0000 (06:15 +0200)
25 files changed:
build_files/cmake/macros.cmake
extern/ceres/CMakeLists.txt
extern/ceres/bundle.sh
intern/cycles/bvh/CMakeLists.txt
intern/cycles/cmake/macros.cmake
intern/cycles/device/CMakeLists.txt
intern/cycles/graph/CMakeLists.txt
intern/cycles/kernel/CMakeLists.txt
intern/cycles/kernel/osl/CMakeLists.txt
intern/cycles/render/CMakeLists.txt
intern/cycles/subd/CMakeLists.txt
intern/cycles/util/CMakeLists.txt
intern/libmv/CMakeLists.txt
intern/libmv/bundle.sh
source/blender/blenkernel/CMakeLists.txt
source/blender/blenkernel/intern/smoke.c
source/blender/bmesh/CMakeLists.txt
source/blender/editors/physics/CMakeLists.txt
source/blender/editors/physics/physics_fluid.c
source/blender/editors/sound/CMakeLists.txt
source/blender/editors/space_graph/CMakeLists.txt
source/blender/ikplugin/CMakeLists.txt
source/blender/imbuf/CMakeLists.txt
source/blender/modifiers/CMakeLists.txt
source/creator/CMakeLists.txt

index c0340427d9588ea6856e8ec9c0872e8899ab761d..0da4a4a1bf9e3b0f3d50825bff619e6cfe403b68 100644 (file)
@@ -222,7 +222,7 @@ function(blender_add_lib__impl
        sources
        includes
        includes_sys
-       libraries
+       library_deps
        )
 
        # message(STATUS "Configuring library ${name}")
@@ -236,8 +236,8 @@ function(blender_add_lib__impl
 
        # Use for testing 'BLENDER_SORTED_LIBS' removal.
        if(DEFINED WITHOUT_SORTED_LIBS AND WITHOUT_SORTED_LIBS)
-               if (NOT "${libraries}" STREQUAL "")
-                       target_link_libraries(${name} "${libraries}")
+               if (NOT "${library_deps}" STREQUAL "")
+                       target_link_libraries(${name} "${library_deps}")
                endif()
        endif()
 
@@ -265,12 +265,12 @@ function(blender_add_lib_nolist
        sources
        includes
        includes_sys
-       libraries
+       library_deps
        )
 
        add_cc_flags_custom_test(${name} PARENT_SCOPE)
 
-       blender_add_lib__impl(${name} "${sources}" "${includes}" "${includes_sys}" "${libraries}")
+       blender_add_lib__impl(${name} "${sources}" "${includes}" "${includes_sys}" "${library_deps}")
 endfunction()
 
 function(blender_add_lib
@@ -278,12 +278,12 @@ function(blender_add_lib
        sources
        includes
        includes_sys
-       libraries
+       library_deps
        )
 
        add_cc_flags_custom_test(${name} PARENT_SCOPE)
 
-       blender_add_lib__impl(${name} "${sources}" "${includes}" "${includes_sys}" "${libraries}")
+       blender_add_lib__impl(${name} "${sources}" "${includes}" "${includes_sys}" "${library_deps}")
 
        set_property(GLOBAL APPEND PROPERTY BLENDER_LINK_LIBS ${name})
 endfunction()
index 0531eb71ba5c9583f5fcd0f9b3b51dd9b88c5c79..fad0734f52fab12e77e46cb81520f848fc7ab4e5 100644 (file)
@@ -256,6 +256,10 @@ set(SRC
        internal/ceres/wall_time.h
 )
 
+set(LIB
+
+)
+
 if(WITH_LIBMV_SCHUR_SPECIALIZATIONS)
        list(APPEND SRC
                internal/ceres/generated/partitioned_matrix_view_2_2_2.cc
@@ -319,4 +323,4 @@ if(WITH_OPENMP)
        )
 endif()
 
-blender_add_lib(extern_ceres "${SRC}" "${INC}" "${INC_SYS}" "")
+blender_add_lib(extern_ceres "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
index e8212aa1d4118e2f00cdcc52a4b111d1be818859..b084eb4a00c9ad44740cbdc3261161162639229a 100755 (executable)
@@ -109,10 +109,6 @@ cat > CMakeLists.txt << EOF
 #
 # The Original Code is Copyright (C) 2012, Blender Foundation
 # All rights reserved.
-#
-# Contributor(s): Blender Foundation,
-#                 Sergey Sharybin
-#
 # ***** END GPL LICENSE BLOCK *****
 
 # NOTE: This file is automatically generated by bundle.sh script
@@ -139,6 +135,10 @@ ${sources}
 ${headers}
 )
 
+set(LIB
+
+)
+
 if(WITH_LIBMV_SCHUR_SPECIALIZATIONS)
        list(APPEND SRC
 ${generated_sources}
@@ -165,5 +165,5 @@ if(WITH_OPENMP)
        )
 endif()
 
-blender_add_lib(extern_ceres "\${SRC}" "\${INC}" "\${INC_SYS}" "")
+blender_add_lib(extern_ceres "\${SRC}" "\${INC}" "\${INC_SYS}" "\${LIB}")
 EOF
index 6014624f395aeea53b3646475bc17c5b3fd1d690..52f4138432b9f72bd33aed34276740be2053a7f3 100644 (file)
@@ -35,7 +35,11 @@ set(SRC_HEADERS
        bvh_unaligned.h
 )
 
+set(LIB
+
+)
+
 include_directories(${INC})
 include_directories(SYSTEM ${INC_SYS})
 
-cycles_add_library(cycles_bvh ${SRC} ${SRC_HEADERS})
+cycles_add_library(cycles_bvh "${LIB}" ${SRC} ${SRC_HEADERS})
index f3ca06ac6b862f0e7008a08563a4c68467e2b8c2..ed4c0e48c032ee4faddbf607dbb018bb6ca852f2 100644 (file)
@@ -6,7 +6,12 @@ function(cycles_set_solution_folder target)
        endif()
 endfunction()
 
-macro(cycles_add_library target)
+macro(cycles_add_library target library_deps)
        add_library(${target} ${ARGN})
+       if(DEFINED WITHOUT_SORTED_LIBS AND WITHOUT_SORTED_LIBS)
+               if(NOT ("${library_deps}" STREQUAL ""))
+                       target_link_libraries(${target} "${library_deps}")
+               endif()
+       endif()
        cycles_set_solution_folder(${target})
 endmacro()
index d95cd02a85e30c4c2fe91d1e5cf2e6812600707c..f0f0390c29b8f7d0e07cebd8b9d1a6009af9110d 100644 (file)
@@ -58,6 +58,10 @@ set(SRC_HEADERS
        device_task.h
 )
 
+set(LIB
+
+)
+
 add_definitions(${GL_DEFINITIONS})
 if(WITH_CYCLES_NETWORK)
        add_definitions(-DWITH_NETWORK)
@@ -75,4 +79,4 @@ endif()
 include_directories(${INC})
 include_directories(SYSTEM ${INC_SYS})
 
-cycles_add_library(cycles_device ${SRC} ${SRC_OPENCL} ${SRC_HEADERS})
+cycles_add_library(cycles_device "${LIB}" ${SRC} ${SRC_OPENCL} ${SRC_HEADERS})
index 0ce56c2b2e626c613b29ddd4ac3d92fbe6c1b742..bd2b2728a29a978981191a9abcecb4c1021a3cc5 100644 (file)
@@ -16,7 +16,11 @@ set(SRC_HEADERS
        node_xml.h
 )
 
+set(LIB
+
+)
+
 include_directories(${INC})
 include_directories(SYSTEM ${INC_SYS})
 
-cycles_add_library(cycles_graph ${SRC} ${SRC_HEADERS})
+cycles_add_library(cycles_graph "${LIB}" ${SRC} ${SRC_HEADERS})
index 822ce68bdc8dd6fee95138dc2e14a4ce3b46ce08..cbb69962781af0b3ead3b9e11d437eb0c84a0729 100644 (file)
@@ -333,6 +333,10 @@ set(SRC_SPLIT_HEADERS
        split/kernel_subsurface_scatter.h
 )
 
+set(LIB
+
+)
+
 # CUDA module
 
 if(WITH_CYCLES_CUDA_BINARIES)
@@ -507,7 +511,7 @@ if(CXX_HAS_AVX2)
        set_source_files_properties(kernels/cpu/filter_avx2.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_AVX2_KERNEL_FLAGS}")
 endif()
 
-cycles_add_library(cycles_kernel
+cycles_add_library(cycles_kernel "${LIB}"
        ${SRC_CPU_KERNELS}
        ${SRC_CUDA_KERNELS}
        ${SRC_OPENCL_KERNELS}
index adca45c5c76daa56dd79a88ba1876a569c4bc342..804610bdc10b1f91b5b1ac94be7b81d3dc6ef135 100644 (file)
@@ -25,9 +25,13 @@ set(HEADER_SRC
        osl_shader.h
 )
 
+set(LIB
+
+)
+
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${RTTI_DISABLE_FLAGS}")
 
 include_directories(${INC})
 include_directories(SYSTEM ${INC_SYS})
 
-cycles_add_library(cycles_kernel_osl ${SRC} ${HEADER_SRC})
+cycles_add_library(cycles_kernel_osl "${LIB}" ${SRC} ${HEADER_SRC})
index b7c53f17c3d88e2bf56d2ced9b56ad5ce7934d65..af0f8b806a854e8e7e0a313ada42069e376592af 100644 (file)
@@ -73,6 +73,9 @@ set(SRC_HEADERS
        tile.h
 )
 
+set(LIB
+)
+
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${RTTI_DISABLE_FLAGS}")
 
 include_directories(${INC})
@@ -80,4 +83,4 @@ include_directories(SYSTEM ${INC_SYS})
 
 add_definitions(${GL_DEFINITIONS})
 
-cycles_add_library(cycles_render ${SRC} ${SRC_HEADERS})
+cycles_add_library(cycles_render "${LIB}" ${SRC} ${SRC_HEADERS})
index 7f952dd43cecb54b120c5bdc632cfc28f23a8ed4..9669bdede7e7852c89feaa1f3ef930a2f8e06304 100644 (file)
@@ -21,7 +21,11 @@ set(SRC_HEADERS
        subd_split.h
 )
 
+set(LIB
+
+)
+
 include_directories(${INC})
 include_directories(SYSTEM ${INC_SYS})
 
-cycles_add_library(cycles_subd ${SRC} ${SRC_HEADERS})
+cycles_add_library(cycles_subd "${LIB}" ${SRC} ${SRC_HEADERS})
index 16abed142b2c5ba79f596df8520ff21a40b36729..b8b38a531eac5e3d9b4991cbaf36500c33985172 100644 (file)
@@ -27,6 +27,10 @@ set(SRC
        util_transform.cpp
 )
 
+set(LIB
+
+)
+
 if(WITH_CYCLES_STANDALONE)
        if (WITH_CYCLES_STANDALONE_GUI)
                list(APPEND SRC
@@ -146,4 +150,4 @@ include_directories(SYSTEM ${INC_SYS})
 
 add_definitions(${GL_DEFINITIONS})
 
-cycles_add_library(cycles_util ${SRC} ${SRC_HEADERS})
+cycles_add_library(cycles_util "${LIB}" ${SRC} ${SRC_HEADERS})
index 5adfdbea1afdd1365cf6538a0c67da5b0387557e..91e638c9c45d58b1fdfda23b20d0d1a613682d60 100644 (file)
@@ -33,6 +33,10 @@ set(SRC
        libmv-capi.h
 )
 
+set(LIB
+
+)
+
 if(WITH_LIBMV)
        add_definitions(${GFLAGS_DEFINES})
        add_definitions(${GLOG_DEFINES})
@@ -232,4 +236,4 @@ else()
        )
 endif()
 
-blender_add_lib(bf_intern_libmv "${SRC}" "${INC}" "${INC_SYS}" "")
+blender_add_lib(bf_intern_libmv "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
index 98a1e3646348a8465637be592c301b860093bfd4..27fc0e886a1f7c6f0d076cfb6703754a20f3841e 100755 (executable)
@@ -95,10 +95,6 @@ cat > CMakeLists.txt << EOF
 #
 # The Original Code is Copyright (C) 2011, Blender Foundation
 # All rights reserved.
-#
-# Contributor(s): Blender Foundation,
-#                 Sergey Sharybin
-#
 # ***** END GPL LICENSE BLOCK *****
 
 # NOTE: This file is automatically generated by bundle.sh script
@@ -116,6 +112,10 @@ set(SRC
        libmv-capi.h
 )
 
+set(LIB
+
+)
+
 if(WITH_LIBMV)
        add_definitions(\${GFLAGS_DEFINES})
        add_definitions(\${GLOG_DEFINES})
@@ -184,5 +184,5 @@ else()
        )
 endif()
 
-blender_add_lib(bf_intern_libmv "\${SRC}" "\${INC}" "\${INC_SYS}" "")
+blender_add_lib(bf_intern_libmv "\${SRC}" "\${INC}" "\${INC_SYS}" "\${LIB}")
 EOF
index 8e6a912b0713a6a7d45e9413dd2b3583fee2eef2..390ac51e470917fa4dbe9c4de765c6b543cb6573 100644 (file)
@@ -44,7 +44,6 @@ set(INC
        ../../../intern/iksolver/extern
        ../../../intern/memutil
        ../../../intern/mikktspace
-       ../../../intern/smoke/extern
        ../../../intern/atomic
        ../../../intern/clog
        ../../../intern/libmv
@@ -486,6 +485,9 @@ if(WITH_MOD_FLUID)
 endif()
 
 if(WITH_MOD_SMOKE)
+       list(APPEND INC
+               ../../../intern/smoke/extern
+       )
        add_definitions(-DWITH_SMOKE)
 endif()
 
@@ -545,17 +547,17 @@ if(WITH_ALEMBIC)
 endif()
 
 if(WITH_OPENSUBDIV)
-       add_definitions(-DWITH_OPENSUBDIV)
        list(APPEND INC_SYS
                ${OPENSUBDIV_INCLUDE_DIRS}
        )
+       add_definitions(-DWITH_OPENSUBDIV)
 endif()
 
 if(WITH_OPENVDB)
-       add_definitions(-DWITH_OPENVDB)
        list(APPEND INC
                 ../../../intern/openvdb
        )
+       add_definitions(-DWITH_OPENVDB)
 
        if(WITH_OPENVDB_BLOSC)
                add_definitions(
index 82acc272c6bd1bfb3d8b1b54706fe2f66e1498e9..122bb5a19c52d00d151e0e80f9b4a3c384a805a9 100644 (file)
 #  include "PIL_time.h"
 #endif
 
-#include "smoke_API.h"
-
 #ifdef WITH_SMOKE
 
+#include "smoke_API.h"
+
 #include "BLI_task.h"
 #include "BLI_kdtree.h"
 #include "BLI_voxel.h"
index be6c819bc1ff571282c817d03b8fe1d0de9055b3..6e228bba3ee2746d798ec01d6b2b446989120205 100644 (file)
@@ -171,10 +171,10 @@ if(MSVC AND NOT MSVC_CLANG)
 endif()
 
 if(WITH_BULLET)
-       add_definitions(-DWITH_BULLET)
        list(APPEND INC_SYS
                ${BULLET_INCLUDE_DIRS}
        )
+       add_definitions(-DWITH_BULLET)
 endif()
 
 if(WITH_INTERNATIONAL)
index 1b42c3f26692a5b841fa8e31193973e9e57dbb07..25b76f549a245cb6d5efeab73dd61c5edb4fa2c3 100644 (file)
@@ -25,7 +25,6 @@ set(INC
        ../../makesdna
        ../../makesrna
        ../../windowmanager
-       ../../../../intern/elbeem/extern
        ../../../../intern/guardedalloc
        ../../../../intern/glew-mx
 )
@@ -55,6 +54,9 @@ set(LIB
 )
 
 if(WITH_MOD_FLUID)
+       list(APPEND INC
+               ../../../../intern/elbeem/extern
+       )
        add_definitions(-DWITH_MOD_FLUID)
 endif()
 
index 9192d1c2fe9b88b665cd1d5a92c94565f6610b58..d3b57a09a9eab4669ebf9d469e3f393b00be54d9 100644 (file)
@@ -45,8 +45,6 @@
 
 #include "DEG_depsgraph.h"
 
-#include "LBM_fluidsim.h"
-
 #include "ED_screen.h"
 
 #include "WM_types.h"
@@ -57,6 +55,8 @@
 /* enable/disable overall compilation */
 #ifdef WITH_MOD_FLUID
 
+#include "LBM_fluidsim.h"
+
 #include "BLI_blenlib.h"
 #include "BLI_path_util.h"
 #include "BLI_math.h"
index 41650f07101fc0305f74076b5dbc9396aaedf2e7..a7d128a261d8203482382eebd6eabdb23e03a44e 100644 (file)
@@ -39,11 +39,10 @@ set(LIB
 )
 
 if(WITH_AUDASPACE)
-       add_definitions(-DWITH_AUDASPACE)
-
        list(APPEND INC_SYS
                ${AUDASPACE_C_INCLUDE_DIRS}
        )
+       add_definitions(-DWITH_AUDASPACE)
 endif()
 
 if(WITH_CODEC_FFMPEG)
index 53c228cd9c9db4930413bae67e1d21d30a118015..391d0dff0f5b11497ebf1b8f7b3cec9f3794c0b0 100644 (file)
@@ -49,11 +49,10 @@ set(LIB
 )
 
 if(WITH_AUDASPACE)
-       add_definitions(-DWITH_AUDASPACE)
-
        list(APPEND INC_SYS
                ${AUDASPACE_C_INCLUDE_DIRS}
        )
+       add_definitions(-DWITH_AUDASPACE)
 endif()
 
 if(WITH_INTERNATIONAL)
index 9bbc3a62b99051089bd377e3ffbac68ad77566be..e741bf92925d428d690b8ef4b6bc8691f6674e66 100644 (file)
@@ -43,7 +43,6 @@ set(LIB
 )
 
 if(WITH_IK_SOLVER)
-       add_definitions(-DWITH_IK_SOLVER)
        list(APPEND INC
                ../../../intern/iksolver/extern
        )
@@ -51,10 +50,10 @@ if(WITH_IK_SOLVER)
                intern/iksolver_plugin.c
                intern/iksolver_plugin.h
        )
+       add_definitions(-DWITH_IK_SOLVER)
 endif()
 
 if(WITH_IK_ITASC)
-       add_definitions(-DWITH_IK_ITASC)
        list(APPEND INC
                ../../../intern/itasc
        )
@@ -65,6 +64,7 @@ if(WITH_IK_ITASC)
                intern/itasc_plugin.cpp
                intern/itasc_plugin.h
        )
+       add_definitions(-DWITH_IK_ITASC)
 endif()
 
 blender_add_lib(bf_ikplugin "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
index 87002e5efc09c4415b9c3ee3ab3e5616740b0aec..5c16e0d162ac52f8f797bdcb60dd172f3cf0b0ca 100644 (file)
@@ -101,7 +101,6 @@ if(WITH_IMAGE_TIFF)
        list(APPEND SRC
                intern/tiff.c
        )
-
        add_definitions(-DWITH_TIFF)
 endif()
 
index 4873e08bb05b95844084597792d34b1bcb76321f..8cf6382608d70807fe67b2c4cb3c89142ffa3da0 100644 (file)
@@ -119,10 +119,10 @@ if(WITH_ALEMBIC)
 endif()
 
 if(WITH_MOD_REMESH)
-       add_definitions(-DWITH_MOD_REMESH)
        list(APPEND INC
                ../../../intern/dualcon
        )
+       add_definitions(-DWITH_MOD_REMESH)
 endif()
 
 if(WITH_MOD_FLUID)
index 1455560d138e88ddf4f38d80b7569e5a05f7c1ea..5111e2b5491a1f92bb59487c6838e668b13f206b 100644 (file)
@@ -52,9 +52,11 @@ if(WITH_LIBMV)
        add_definitions(-DWITH_LIBMV)
 endif()
 
-if(WITH_CYCLES AND WITH_CYCLES_LOGGING)
-       blender_include_dirs(../../intern/cycles/blender)
-       add_definitions(-DWITH_CYCLES_LOGGING)
+if(WITH_CYCLES)
+       if(WITH_CYCLES_LOGGING)
+               blender_include_dirs(../../intern/cycles/blender)
+               add_definitions(-DWITH_CYCLES_LOGGING)
+       endif()
 endif()
 
 if(WITH_CODEC_FFMPEG)
@@ -76,20 +78,20 @@ endif()
 
 if(WITH_SDL)
        if(WITH_SDL_DYNLOAD)
-               add_definitions(-DWITH_SDL_DYNLOAD)
                blender_include_dirs(../../extern/sdlew/include)
+               add_definitions(-DWITH_SDL_DYNLOAD)
        endif()
        add_definitions(-DWITH_SDL)
 endif()
 
 if(WITH_BINRELOC)
-       add_definitions(-DWITH_BINRELOC)
        blender_include_dirs(${BINRELOC_INCLUDE_DIRS})
+       add_definitions(-DWITH_BINRELOC)
 endif()
 
 if(WITH_FREESTYLE)
-       add_definitions(-DWITH_FREESTYLE)
        blender_include_dirs(../blender/freestyle)
+       add_definitions(-DWITH_FREESTYLE)
 endif()
 
 # Setup the exe sources and buildinfo