From a87763becbc4672b38f1021418ed94caa0f6540a Mon Sep 17 00:00:00 2001 From: James Cowgill Date: Thu, 22 May 2025 09:59:15 +0100 Subject: [PATCH] Fix pkg-config when SFML_PKGCONFIG_INSTALL_DIR is unset Commit e5127715e64a ("Install pkgconfig only if module is built") attempted to move the pkg-config installation rules into `sfml_add_library`, but this fails if `SFML_PKGCONFIG_INSTALL_DIR` is unset because this code is run before the default value is set in `CMakeLists.txt`. Fix by moving the `add_subdirectory(src/SFML)` line below the pkg-config setup code. Closes: #3504 --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ba5e5f1e1..c89fced965 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -201,9 +201,6 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) set_property(GLOBAL PROPERTY USE_FOLDERS ON) set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "CMake") -# add the subdirectories -add_subdirectory(src/SFML) - # on Linux and BSD-like OS, install pkg-config files by default set(SFML_INSTALL_PKGCONFIG_DEFAULT OFF) @@ -248,6 +245,9 @@ if(SFML_ENABLE_PCH AND SFML_OS_MACOS) message(FATAL_ERROR "Precompiled headers are currently not supported in macOS builds") endif() +# add the subdirectories +add_subdirectory(src/SFML) + # setup the install rules if(NOT SFML_BUILD_FRAMEWORKS) install(DIRECTORY include/