From 6035a5fa5af494c972ec862c623133b24cde64b4 Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Sun, 1 Sep 2024 13:56:44 -0600 Subject: [PATCH] Use `SFML_ROOT` to find SFML installation This is line with modern CMake convention where -D_ROOT is used to locate a given package's installation. https://cmake.org/cmake/help/latest/variable/PackageName_ROOT.html#variable:%3CPackageName%3E_ROOT --- .github/workflows/ci.yml | 4 ++-- readme.md | 2 +- tools/BuildMacOS.sh | 2 +- tools/nuget/build.linux.sh | 2 +- tools/nuget/build.macos.sh | 2 +- tools/nuget/build.win.ps1 | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 31995ab..bf102a0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,7 +61,7 @@ jobs: path: CSFML - name: Configure CSFML CMake - run: cmake --preset dev -S CSFML -B CSFML/build -DCMAKE_INSTALL_PREFIX=CSFML/install -DCSFML_LINK_SFML_STATICALLY=FALSE -DSFML_DIR=$GITHUB_WORKSPACE/SFML/install/lib/cmake/SFML -DCMAKE_VERBOSE_MAKEFILE=ON ${{matrix.platform.flags}} -DCMAKE_BUILD_TYPE=${{matrix.type.name}} + run: cmake --preset dev -S CSFML -B CSFML/build -DCMAKE_INSTALL_PREFIX=CSFML/install -DCSFML_LINK_SFML_STATICALLY=FALSE -DSFML_ROOT=SFML/install -DCMAKE_VERBOSE_MAKEFILE=ON ${{matrix.platform.flags}} -DCMAKE_BUILD_TYPE=${{matrix.type.name}} - name: Build CSFML run: cmake --build CSFML/build --config ${{matrix.type.name}} --target install @@ -113,7 +113,7 @@ jobs: path: CSFML - name: Configure CSFML CMake - run: cmake --preset dev -S CSFML -B CSFML/build -DSFML_DIR=$GITHUB_WORKSPACE/SFML/install/lib/cmake/SFML -DCMAKE_BUILD_TYPE=Debug + run: cmake --preset dev -S CSFML -B CSFML/build -DSFML_ROOT=SFML/install -DCMAKE_BUILD_TYPE=Debug - name: Tidy run: cmake --build CSFML/build --target tidy diff --git a/readme.md b/readme.md index 6a6f9bb..d41ab11 100644 --- a/readme.md +++ b/readme.md @@ -27,7 +27,7 @@ Of course, you can also find the CSFML API documentation in the SDK. ## Building -Set `SFML_DIR` to a directory containing the `SFMLConfig.cmake` file, usually located at `lib/cmake/SFML`. +Set `SFML_ROOT` to a directory containing the installation of SFML. ## Contribute diff --git a/tools/BuildMacOS.sh b/tools/BuildMacOS.sh index ceab487..e64a997 100644 --- a/tools/BuildMacOS.sh +++ b/tools/BuildMacOS.sh @@ -371,7 +371,7 @@ build_csfml () # $1: 'clang' => clang & libc++ -D "CMAKE_OSX_DEPLOYMENT_TARGET:STRING=$target" \ -D "CMAKE_OSX_SYSROOT:STRING=$sdk" \ -D "BUILD_DOC:BOOL=$doc" \ - -D "SFML_DIR:PATH=$sfml_package1070/Frameworks/SFML.framework/Versions/$gittag/Resources/CMake" \ + -D "SFML_ROOT:PATH=$sfml_package1070/Frameworks/SFML.framework/Versions/$gittag/Resources/CMake" \ "$codedir" assert $? "CMake failed" diff --git a/tools/nuget/build.linux.sh b/tools/nuget/build.linux.sh index 30fbed3..b7d70d4 100755 --- a/tools/nuget/build.linux.sh +++ b/tools/nuget/build.linux.sh @@ -113,7 +113,7 @@ CSFMLLibDir="$(realpath lib)" # The directory that contains the final CSFML libr cmake -E env LDFLAGS="-z origin" \ cmake \ - "-DSFML_DIR=$SFMLBuiltDir" \ + "-DSFML_ROOT=$SFMLBuiltDir" \ '-DBUILD_SHARED_LIBS=1' \ '-DCMAKE_BUILD_TYPE=Release' \ "-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=$CSFMLLibDir" \ diff --git a/tools/nuget/build.macos.sh b/tools/nuget/build.macos.sh index 57a4319..2ecf36e 100755 --- a/tools/nuget/build.macos.sh +++ b/tools/nuget/build.macos.sh @@ -133,7 +133,7 @@ CSFMLLibDir="$(realpath lib)" # The directory that contains the final CSFML libr cmake -E env \ cmake -G "Unix Makefiles" \ - -D "SFML_DIR=$SFMLBuiltDir" \ + -D "SFML_ROOT=$SFMLBuiltDir" \ -D 'BUILD_SHARED_LIBS=ON' \ -D 'CMAKE_BUILD_TYPE=Release' \ -D "CMAKE_OSX_ARCHITECTURES=$ARCHITECTURE" \ diff --git a/tools/nuget/build.win.ps1 b/tools/nuget/build.win.ps1 index 515b387..2e87959 100644 --- a/tools/nuget/build.win.ps1 +++ b/tools/nuget/build.win.ps1 @@ -141,7 +141,7 @@ New-Item -ItemType Directory lib > $null $CSFMLLibDir = (Get-Item lib).FullName; # The directory where the final CSFML dlls are located cmake ` - "-DSFML_DIR=$SFMLBuiltDir" ` + "-DSFML_ROOT=$SFMLBuiltDir" ` '-DCSFML_LINK_SFML_STATICALLY=1' ` "-DCMAKE_LIBRARY_PATH=$SFMLExtLibs" ` `