From fc409e4388049354d4055d9ed821ddefc095b1b6 Mon Sep 17 00:00:00 2001 From: Ray Molenkamp Date: Sat, 3 Feb 2024 18:55:09 +0100 Subject: [PATCH] Cleanup: CMake: Modernize extern_fmtlib dependencies Pretty straightforward - Remove any fmtlib paths from INC - Add a dependency though LIB when missing context: https://devtalk.blender.org/t/cmake-cleanup/30260 Pull Request: https://projects.blender.org/blender/blender/pulls/117787 --- extern/fmtlib/CMakeLists.txt | 3 ++- source/blender/blenkernel/CMakeLists.txt | 3 +-- source/blender/blenlib/CMakeLists.txt | 2 +- source/blender/editors/interface/CMakeLists.txt | 2 +- source/blender/editors/object/CMakeLists.txt | 2 +- source/blender/editors/space_file/CMakeLists.txt | 3 +-- source/blender/editors/space_node/CMakeLists.txt | 3 +-- source/blender/editors/space_spreadsheet/CMakeLists.txt | 2 +- source/blender/editors/space_userpref/CMakeLists.txt | 2 +- source/blender/io/ply/CMakeLists.txt | 3 +-- source/blender/io/stl/CMakeLists.txt | 3 +-- source/blender/io/usd/CMakeLists.txt | 3 +-- source/blender/io/wavefront_obj/CMakeLists.txt | 3 +-- source/blender/modifiers/CMakeLists.txt | 3 +-- source/blender/nodes/CMakeLists.txt | 3 +-- source/blender/nodes/geometry/CMakeLists.txt | 3 +-- source/blender/windowmanager/CMakeLists.txt | 2 +- 17 files changed, 18 insertions(+), 27 deletions(-) diff --git a/extern/fmtlib/CMakeLists.txt b/extern/fmtlib/CMakeLists.txt index 64a99cbb935..0e901c11729 100644 --- a/extern/fmtlib/CMakeLists.txt +++ b/extern/fmtlib/CMakeLists.txt @@ -3,7 +3,7 @@ # SPDX-License-Identifier: GPL-2.0-or-later set(INC - include + PUBLIC include ) set(INC_SYS @@ -20,3 +20,4 @@ set(LIB ) blender_add_lib(extern_fmtlib "${SRC}" "${INC}" "${INC_SYS}" "${LIB}") +add_library(bf::extern::fmtlib ALIAS extern_fmtlib) diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt index 39f390f379c..b6f1be2ee5f 100644 --- a/source/blender/blenkernel/CMakeLists.txt +++ b/source/blender/blenkernel/CMakeLists.txt @@ -29,7 +29,6 @@ set(INC ../../../intern/memutil ../../../intern/mikktspace ../../../intern/opensubdiv - ../../../extern/fmtlib/include # RNA_prototypes.h ${CMAKE_BINARY_DIR}/source/blender/makesrna @@ -575,7 +574,7 @@ set(LIB bf_rna bf_shader_fx bf_simulation - extern_fmtlib + PRIVATE bf::extern::fmtlib PRIVATE bf::intern::atomic # For `vfontdata_freetype.c`. ${FREETYPE_LIBRARIES} ${BROTLI_LIBRARIES} diff --git a/source/blender/blenlib/CMakeLists.txt b/source/blender/blenlib/CMakeLists.txt index 8bca0c73efa..f72c625be78 100644 --- a/source/blender/blenlib/CMakeLists.txt +++ b/source/blender/blenlib/CMakeLists.txt @@ -14,7 +14,6 @@ set(INC set(INC_SYS ../../../extern/wcwidth ../../../extern/json/include - ../../../extern/fmtlib/include ${EIGEN3_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS} @@ -392,6 +391,7 @@ set(SRC set(LIB PUBLIC bf::dna + PRIVATE bf::extern::fmtlib bf_intern_eigen PRIVATE bf::intern::guardedalloc extern_wcwidth diff --git a/source/blender/editors/interface/CMakeLists.txt b/source/blender/editors/interface/CMakeLists.txt index d31d67ee8c2..6cbd1294525 100644 --- a/source/blender/editors/interface/CMakeLists.txt +++ b/source/blender/editors/interface/CMakeLists.txt @@ -19,7 +19,6 @@ set(INC ../../render ../../windowmanager ../../../../intern/ghost - ../../../../extern/fmtlib/include ../../bmesh # RNA_prototypes.h ${CMAKE_BINARY_DIR}/source/blender/makesrna @@ -103,6 +102,7 @@ set(LIB PRIVATE bf::depsgraph PRIVATE bf::dna bf_editor_datafiles + PRIVATE bf::extern::fmtlib PRIVATE bf::intern::guardedalloc PRIVATE bf::animrig ) diff --git a/source/blender/editors/object/CMakeLists.txt b/source/blender/editors/object/CMakeLists.txt index 39f216fece5..53ae6ca520b 100644 --- a/source/blender/editors/object/CMakeLists.txt +++ b/source/blender/editors/object/CMakeLists.txt @@ -19,7 +19,6 @@ set(INC ../../render ../../shader_fx ../../windowmanager - ../../../../extern/fmtlib/include # RNA_prototypes.h ${CMAKE_BINARY_DIR}/source/blender/makesrna @@ -69,6 +68,7 @@ set(LIB PRIVATE bf::dna bf_editor_mesh bf_editor_grease_pencil + PRIVATE bf::extern::fmtlib PRIVATE bf::intern::clog PRIVATE bf::intern::guardedalloc bf_render diff --git a/source/blender/editors/space_file/CMakeLists.txt b/source/blender/editors/space_file/CMakeLists.txt index 18dac396a49..0651ccac233 100644 --- a/source/blender/editors/space_file/CMakeLists.txt +++ b/source/blender/editors/space_file/CMakeLists.txt @@ -14,7 +14,6 @@ set(INC ../../makesrna ../../render ../../windowmanager - ../../../../extern/fmtlib/include # RNA_prototypes.h ${CMAKE_BINARY_DIR}/source/blender/makesrna @@ -50,7 +49,7 @@ set(LIB PRIVATE bf::blenlib PRIVATE bf::dna PRIVATE bf::intern::guardedalloc - extern_fmtlib + PRIVATE bf::extern::fmtlib PRIVATE bf::intern::atomic ) diff --git a/source/blender/editors/space_node/CMakeLists.txt b/source/blender/editors/space_node/CMakeLists.txt index 7b85ca33ee3..14acd22b79c 100644 --- a/source/blender/editors/space_node/CMakeLists.txt +++ b/source/blender/editors/space_node/CMakeLists.txt @@ -18,7 +18,6 @@ set(INC ../../nodes ../../render ../../windowmanager - ../../../../extern/fmtlib/include # RNA_prototypes.h ${CMAKE_BINARY_DIR}/source/blender/makesrna @@ -58,7 +57,7 @@ set(LIB PRIVATE bf::dna bf_editor_screen PRIVATE bf::intern::guardedalloc - extern_fmtlib + PRIVATE bf::extern::fmtlib ) if(WITH_COMPOSITOR_CPU) diff --git a/source/blender/editors/space_spreadsheet/CMakeLists.txt b/source/blender/editors/space_spreadsheet/CMakeLists.txt index 019d1d163b1..3cdf5f99d11 100644 --- a/source/blender/editors/space_spreadsheet/CMakeLists.txt +++ b/source/blender/editors/space_spreadsheet/CMakeLists.txt @@ -13,7 +13,6 @@ set(INC ../../makesrna ../../nodes ../../windowmanager - ../../../../extern/fmtlib/include # RNA_prototypes.h ${CMAKE_BINARY_DIR}/source/blender/makesrna @@ -54,6 +53,7 @@ set(LIB PRIVATE bf::blenlib PRIVATE bf::depsgraph PRIVATE bf::dna + PRIVATE bf::extern::fmtlib PRIVATE bf::intern::guardedalloc ) diff --git a/source/blender/editors/space_userpref/CMakeLists.txt b/source/blender/editors/space_userpref/CMakeLists.txt index 98304903eae..637e82a977c 100644 --- a/source/blender/editors/space_userpref/CMakeLists.txt +++ b/source/blender/editors/space_userpref/CMakeLists.txt @@ -9,7 +9,6 @@ set(INC ../../blentranslation ../../makesrna ../../windowmanager - ../../../../extern/fmtlib/include ) @@ -27,6 +26,7 @@ set(SRC set(LIB PRIVATE bf::blenlib PRIVATE bf::dna + PRIVATE bf::extern::fmtlib PRIVATE bf::intern::guardedalloc ) diff --git a/source/blender/io/ply/CMakeLists.txt b/source/blender/io/ply/CMakeLists.txt index 3e83980b5dc..6756be0cb2a 100644 --- a/source/blender/io/ply/CMakeLists.txt +++ b/source/blender/io/ply/CMakeLists.txt @@ -17,7 +17,6 @@ set(INC set(INC_SYS ../../../../extern/fast_float - ../../../../extern/fmtlib/include ) set(SRC @@ -57,7 +56,7 @@ set(LIB PRIVATE bf::dna PRIVATE bf::intern::guardedalloc bf_io_common - extern_fmtlib + PRIVATE bf::extern::fmtlib ) blender_add_lib(bf_io_ply "${SRC}" "${INC}" "${INC_SYS}" "${LIB}") diff --git a/source/blender/io/stl/CMakeLists.txt b/source/blender/io/stl/CMakeLists.txt index f158184c191..dfd4239c9fa 100644 --- a/source/blender/io/stl/CMakeLists.txt +++ b/source/blender/io/stl/CMakeLists.txt @@ -18,7 +18,6 @@ set(INC set(INC_SYS ../../../../extern/fast_float - ../../../../extern/fmtlib/include ) set(SRC @@ -46,7 +45,7 @@ set(LIB PRIVATE bf::dna PRIVATE bf::intern::guardedalloc bf_io_common - extern_fmtlib + PRIVATE bf::extern::fmtlib ) blender_add_lib(bf_io_stl "${SRC}" "${INC}" "${INC_SYS}" "${LIB}") diff --git a/source/blender/io/usd/CMakeLists.txt b/source/blender/io/usd/CMakeLists.txt index 6890e131c02..2f0e8de6cc7 100644 --- a/source/blender/io/usd/CMakeLists.txt +++ b/source/blender/io/usd/CMakeLists.txt @@ -78,7 +78,6 @@ set(INC_SYS ${TBB_INCLUDE_DIR} ${PYTHON_INCLUDE_DIR} - ../../../../extern/fmtlib/include ) set(SRC @@ -202,7 +201,7 @@ set(LIB PRIVATE bf::intern::clog PRIVATE bf::intern::guardedalloc bf_io_common - extern_fmtlib + PRIVATE bf::extern::fmtlib ) list(APPEND LIB diff --git a/source/blender/io/wavefront_obj/CMakeLists.txt b/source/blender/io/wavefront_obj/CMakeLists.txt index 0f80538266f..ba82f3d5441 100644 --- a/source/blender/io/wavefront_obj/CMakeLists.txt +++ b/source/blender/io/wavefront_obj/CMakeLists.txt @@ -18,7 +18,6 @@ set(INC set(INC_SYS ../../../../extern/fast_float - ../../../../extern/fmtlib/include ) set(SRC @@ -60,7 +59,7 @@ set(LIB PRIVATE bf::dna PRIVATE bf::intern::guardedalloc bf_io_common - extern_fmtlib + PRIVATE bf::extern::fmtlib ) if(WITH_TBB) diff --git a/source/blender/modifiers/CMakeLists.txt b/source/blender/modifiers/CMakeLists.txt index cad608cfe13..a015a6f3962 100644 --- a/source/blender/modifiers/CMakeLists.txt +++ b/source/blender/modifiers/CMakeLists.txt @@ -17,7 +17,6 @@ set(INC ../render ../windowmanager ../../../intern/eigen - ../../../extern/fmtlib/include # RNA_prototypes.h ${CMAKE_BINARY_DIR}/source/blender/makesrna @@ -123,7 +122,7 @@ set(LIB PRIVATE bf::depsgraph PUBLIC bf::dna PRIVATE bf::intern::guardedalloc - extern_fmtlib + PRIVATE bf::extern::fmtlib ) if(WITH_ALEMBIC) diff --git a/source/blender/nodes/CMakeLists.txt b/source/blender/nodes/CMakeLists.txt index e780d42b027..c98fd479de4 100644 --- a/source/blender/nodes/CMakeLists.txt +++ b/source/blender/nodes/CMakeLists.txt @@ -66,7 +66,6 @@ set(INC ../modifiers ../render ../windowmanager - ../../../extern/fmtlib/include # RNA_prototypes.h ${CMAKE_BINARY_DIR}/source/blender/makesrna @@ -134,7 +133,7 @@ set(LIB bf_nodes_geometry bf_nodes_shader bf_nodes_texture - extern_fmtlib + PRIVATE bf::extern::fmtlib ) if(WITH_BULLET) diff --git a/source/blender/nodes/geometry/CMakeLists.txt b/source/blender/nodes/geometry/CMakeLists.txt index f90be474998..72c672048db 100644 --- a/source/blender/nodes/geometry/CMakeLists.txt +++ b/source/blender/nodes/geometry/CMakeLists.txt @@ -18,7 +18,6 @@ set(INC ../../modifiers ../../render ../../windowmanager - ../../../../extern/fmtlib/include # RNA_prototypes.h ${CMAKE_BINARY_DIR}/source/blender/makesrna ) @@ -215,7 +214,7 @@ set(LIB bf_geometry PRIVATE bf::intern::guardedalloc bf_nodes - extern_fmtlib + PRIVATE bf::extern::fmtlib ) if(WITH_BULLET) diff --git a/source/blender/windowmanager/CMakeLists.txt b/source/blender/windowmanager/CMakeLists.txt index 3b45ef668b0..bb247962f7d 100644 --- a/source/blender/windowmanager/CMakeLists.txt +++ b/source/blender/windowmanager/CMakeLists.txt @@ -20,7 +20,6 @@ set(INC ../render ../sequencer ../../../intern/memutil - ../../../extern/fmtlib/include ../bmesh # RNA_prototypes.h @@ -101,6 +100,7 @@ set(LIB PRIVATE bf::depsgraph PRIVATE bf::dna bf_editor_screen + PRIVATE bf::extern::fmtlib PRIVATE bf::intern::clog PRIVATE bf::intern::guardedalloc PRIVATE bf::animrig