From 8e48049013a5a6668d2bd3c1bcb1fbc0ddd9534d Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Thu, 7 Sep 2023 14:45:42 +0200 Subject: cmake: consolidate find_package invocations --- source/CMakeLists.txt | 12 ++++++++++-- source/app/wandac/CMakeLists.txt | 5 ----- source/app/wandad/CMakeLists.txt | 3 --- source/lib/control/CMakeLists.txt | 3 --- source/lib/proto/CMakeLists.txt | 2 -- source/lib/system/CMakeLists.txt | 5 ----- source/tests/CMakeLists.txt | 2 -- 7 files changed, 10 insertions(+), 22 deletions(-) diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 300953d..ab23c84 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -5,8 +5,16 @@ project("wanda" VERSION "1.0.0" ) -enable_testing() +find_package("Boost" REQUIRED COMPONENTS "headers") +find_package("Catch2" REQUIRED COMPONENTS "Catch2WithMain") +find_package("JPEG" REQUIRED) +find_package("lyra" REQUIRED) +find_package("spdlog" REQUIRED) +find_package("PNG" REQUIRED) + +include("CTest") +include("Catch") add_subdirectory("app") add_subdirectory("lib") -add_subdirectory("tests") \ No newline at end of file +add_subdirectory("tests") diff --git a/source/app/wandac/CMakeLists.txt b/source/app/wandac/CMakeLists.txt index a9b977c..43740d1 100644 --- a/source/app/wandac/CMakeLists.txt +++ b/source/app/wandac/CMakeLists.txt @@ -1,8 +1,3 @@ -find_package("lyra") -find_package("spdlog") - -#[=====[ Client ]=====] - add_executable("wandac" "src/main.cpp" ) diff --git a/source/app/wandad/CMakeLists.txt b/source/app/wandad/CMakeLists.txt index dfcaeb3..9bf0ec5 100644 --- a/source/app/wandad/CMakeLists.txt +++ b/source/app/wandad/CMakeLists.txt @@ -1,6 +1,3 @@ -find_package("lyra") -find_package("spdlog") - add_executable("wandad" "src/main.cpp" ) diff --git a/source/lib/control/CMakeLists.txt b/source/lib/control/CMakeLists.txt index 9e5a33d..b4a4b02 100644 --- a/source/lib/control/CMakeLists.txt +++ b/source/lib/control/CMakeLists.txt @@ -3,9 +3,6 @@ cmake_path(GET CMAKE_CURRENT_SOURCE_DIR STEM LIB_NAME) file(GLOB_RECURSE LIB_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" CONFIGURE_DEPENDS "**/*.hpp") file(GLOB_RECURSE LIB_SOURCES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" CONFIGURE_DEPENDS "**/*.cpp") -find_package("Boost" REQUIRED COMPONENTS "headers") -find_package("spdlog" REQUIRED) - add_library("wanda-${LIB_NAME}" ${WANDA_LIBRARY_TYPE} ${LIB_SOURCES} ) diff --git a/source/lib/proto/CMakeLists.txt b/source/lib/proto/CMakeLists.txt index a99c364..b20663c 100644 --- a/source/lib/proto/CMakeLists.txt +++ b/source/lib/proto/CMakeLists.txt @@ -3,8 +3,6 @@ cmake_path(GET CMAKE_CURRENT_SOURCE_DIR STEM LIB_NAME) file(GLOB_RECURSE LIB_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" CONFIGURE_DEPENDS "**/*.hpp") file(GLOB_RECURSE LIB_SOURCES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" CONFIGURE_DEPENDS "**/*.cpp") -find_package("spdlog") - add_library("wanda-${LIB_NAME}" ${WANDA_LIBRARY_TYPE} ${LIB_SOURCES} ) diff --git a/source/lib/system/CMakeLists.txt b/source/lib/system/CMakeLists.txt index 59d0b50..7589c56 100644 --- a/source/lib/system/CMakeLists.txt +++ b/source/lib/system/CMakeLists.txt @@ -3,11 +3,6 @@ cmake_path(GET CMAKE_CURRENT_SOURCE_DIR STEM LIB_NAME) file(GLOB_RECURSE LIB_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" CONFIGURE_DEPENDS "**/*.hpp") file(GLOB_RECURSE LIB_SOURCES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" CONFIGURE_DEPENDS "**/*.cpp") -find_package("Boost" REQUIRED COMPONENTS "headers") -find_package("JPEG" REQUIRED) -find_package("PNG" REQUIRED) -find_package("spdlog" REQUIRED) - find_package("PkgConfig" REQUIRED) pkg_check_modules("GIO" diff --git a/source/tests/CMakeLists.txt b/source/tests/CMakeLists.txt index bf49461..769814c 100644 --- a/source/tests/CMakeLists.txt +++ b/source/tests/CMakeLists.txt @@ -1,5 +1,3 @@ -find_package("Catch2" REQUIRED COMPONENTS "Catch2WithMain") - include("Catch") add_subdirectory("lib/system") \ No newline at end of file -- cgit v1.2.3