chore: update CMake dependency configurations to remove PARENT_SCOPE
- Removed PARENT_SCOPE from various dependency target definitions in CMake files (grpc.cmake, imgui.cmake, sdl2.cmake, testing.cmake, yaml.cmake). - Ensured that all targets are set locally for better clarity and management. Benefits: - Simplifies the dependency management process and improves the readability of CMake configurations.
This commit is contained in:
@@ -76,4 +76,4 @@ endif()
|
|||||||
message(STATUS "=================================")
|
message(STATUS "=================================")
|
||||||
|
|
||||||
# Export all dependency targets for use in other CMake files
|
# Export all dependency targets for use in other CMake files
|
||||||
set(YAZE_ALL_DEPENDENCIES ${YAZE_ALL_DEPENDENCIES} PARENT_SCOPE)
|
set(YAZE_ALL_DEPENDENCIES ${YAZE_ALL_DEPENDENCIES})
|
||||||
@@ -113,7 +113,6 @@ set(ABSL_TARGETS
|
|||||||
absl::str_format
|
absl::str_format
|
||||||
absl::synchronization
|
absl::synchronization
|
||||||
absl::time
|
absl::time
|
||||||
PARENT_SCOPE
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Export gRPC targets for use in other CMake files
|
# Export gRPC targets for use in other CMake files
|
||||||
@@ -123,7 +122,6 @@ set(YAZE_GRPC_TARGETS
|
|||||||
protobuf::libprotobuf
|
protobuf::libprotobuf
|
||||||
protoc
|
protoc
|
||||||
grpc_cpp_plugin
|
grpc_cpp_plugin
|
||||||
PARENT_SCOPE
|
|
||||||
)
|
)
|
||||||
|
|
||||||
message(STATUS "gRPC setup complete - targets available: ${YAZE_GRPC_TARGETS}")
|
message(STATUS "gRPC setup complete - targets available: ${YAZE_GRPC_TARGETS}")
|
||||||
@@ -152,7 +150,6 @@ message(STATUS "Protobuf include dir: ${_gRPC_PROTOBUF_WELLKNOWN_INCLUDE_DIR}")
|
|||||||
# Export protobuf targets
|
# Export protobuf targets
|
||||||
set(YAZE_PROTOBUF_TARGETS
|
set(YAZE_PROTOBUF_TARGETS
|
||||||
protobuf::libprotobuf
|
protobuf::libprotobuf
|
||||||
PARENT_SCOPE
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Function to add protobuf/gRPC code generation to a target
|
# Function to add protobuf/gRPC code generation to a target
|
||||||
|
|||||||
@@ -67,7 +67,6 @@ if(YAZE_BUILD_TESTS)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Export ImGui targets for use in other CMake files
|
# Export ImGui targets for use in other CMake files
|
||||||
set(YAZE_IMGUI_TARGETS ImGui PARENT_SCOPE)
|
|
||||||
set(YAZE_IMGUI_TARGETS ImGui)
|
set(YAZE_IMGUI_TARGETS ImGui)
|
||||||
|
|
||||||
message(STATUS "Dear ImGui setup complete - YAZE_IMGUI_TARGETS = ${YAZE_IMGUI_TARGETS}")
|
message(STATUS "Dear ImGui setup complete - YAZE_IMGUI_TARGETS = ${YAZE_IMGUI_TARGETS}")
|
||||||
|
|||||||
@@ -96,9 +96,6 @@ elseif(UNIX)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Export SDL2 targets for use in other CMake files
|
# Export SDL2 targets for use in other CMake files
|
||||||
# Use PARENT_SCOPE to set in the calling scope (dependencies.cmake)
|
|
||||||
set(YAZE_SDL2_TARGETS yaze_sdl2 PARENT_SCOPE)
|
|
||||||
# Also set locally for use in this file
|
|
||||||
set(YAZE_SDL2_TARGETS yaze_sdl2)
|
set(YAZE_SDL2_TARGETS yaze_sdl2)
|
||||||
|
|
||||||
message(STATUS "SDL2 setup complete - YAZE_SDL2_TARGETS = ${YAZE_SDL2_TARGETS}")
|
message(STATUS "SDL2 setup complete - YAZE_SDL2_TARGETS = ${YAZE_SDL2_TARGETS}")
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ if(YAZE_ENABLE_COVERAGE OR DEFINED ENV{YAZE_ENABLE_BENCHMARKS})
|
|||||||
message(FATAL_ERROR "Benchmark target not found after CPM fetch")
|
message(FATAL_ERROR "Benchmark target not found after CPM fetch")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(YAZE_BENCHMARK_TARGETS benchmark::benchmark PARENT_SCOPE)
|
set(YAZE_BENCHMARK_TARGETS benchmark::benchmark)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Create convenience targets for the rest of the project
|
# Create convenience targets for the rest of the project
|
||||||
@@ -64,7 +64,6 @@ if(TARGET benchmark::benchmark)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Export testing targets for use in other CMake files
|
# Export testing targets for use in other CMake files
|
||||||
set(YAZE_TESTING_TARGETS yaze_testing PARENT_SCOPE)
|
|
||||||
set(YAZE_TESTING_TARGETS yaze_testing)
|
set(YAZE_TESTING_TARGETS yaze_testing)
|
||||||
|
|
||||||
message(STATUS "Testing dependencies setup complete - GTest + GMock available")
|
message(STATUS "Testing dependencies setup complete - GTest + GMock available")
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ if(YAZE_USE_SYSTEM_DEPS)
|
|||||||
message(STATUS "Using system yaml-cpp")
|
message(STATUS "Using system yaml-cpp")
|
||||||
add_library(yaze_yaml INTERFACE IMPORTED)
|
add_library(yaze_yaml INTERFACE IMPORTED)
|
||||||
target_link_libraries(yaze_yaml INTERFACE yaml-cpp)
|
target_link_libraries(yaze_yaml INTERFACE yaml-cpp)
|
||||||
set(YAZE_YAML_TARGETS yaze_yaml PARENT_SCOPE)
|
set(YAZE_YAML_TARGETS yaze_yaml)
|
||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
Reference in New Issue
Block a user