mirror of
https://github.com/SFML/SFML.git
synced 2024-11-25 04:41:05 +08:00
Use CMake-standard <PackageName>_ROOT variable to locating config module
https://cmake.org/cmake/help/v3.22/command/find_package.html https://cmake.org/cmake/help/v3.22/variable/PackageName_ROOT.html#variable:%3CPackageName%3E_ROOT SFML_DIR predates the existence of <PackageName>_ROOT which is now the preferred way to specify where to find a given package's config module. User reports have shown that SFML_DIR may be broken at least in certain circumstances so lets stop mentioning it.
This commit is contained in:
parent
a2c003b2b7
commit
30a986e632
@ -41,7 +41,7 @@
|
|||||||
# Additionally, keep in mind that SFML frameworks are only available as release libraries unlike dylibs which
|
# Additionally, keep in mind that SFML frameworks are only available as release libraries unlike dylibs which
|
||||||
# are available for both release and debug modes.
|
# are available for both release and debug modes.
|
||||||
#
|
#
|
||||||
# If SFML is not installed in a standard path, you can use the SFML_DIR CMake variable
|
# If SFML is not installed in a standard path, you can use the SFML_ROOT CMake variable
|
||||||
# to tell CMake where SFML's config file is located (PREFIX/lib/cmake/SFML for a library-based installation,
|
# to tell CMake where SFML's config file is located (PREFIX/lib/cmake/SFML for a library-based installation,
|
||||||
# and PREFIX/SFML.framework/Resources/CMake on macOS for a framework-based installation).
|
# and PREFIX/SFML.framework/Resources/CMake on macOS for a framework-based installation).
|
||||||
#
|
#
|
||||||
@ -109,7 +109,7 @@ list(REMOVE_DUPLICATES SFML_FIND_COMPONENTS)
|
|||||||
if(SFML_STATIC_LIBRARIES)
|
if(SFML_STATIC_LIBRARIES)
|
||||||
set(SFML_IS_FRAMEWORK_INSTALL "@SFML_BUILD_FRAMEWORKS@")
|
set(SFML_IS_FRAMEWORK_INSTALL "@SFML_BUILD_FRAMEWORKS@")
|
||||||
if(SFML_IS_FRAMEWORK_INSTALL)
|
if(SFML_IS_FRAMEWORK_INSTALL)
|
||||||
message(WARNING "Static frameworks are not supported by SFML. Clear SFML_DIR cache entry, \
|
message(WARNING "Static frameworks are not supported by SFML. Clear SFML_ROOT cache entry, \
|
||||||
and either change SFML_STATIC_LIBRARIES or CMAKE_FIND_FRAMEWORK before calling find_package(SFML)")
|
and either change SFML_STATIC_LIBRARIES or CMAKE_FIND_FRAMEWORK before calling find_package(SFML)")
|
||||||
endif()
|
endif()
|
||||||
set(config_name "Static")
|
set(config_name "Static")
|
||||||
@ -134,7 +134,7 @@ if(EXISTS "${targets_config_file}")
|
|||||||
if(TARGET SFML::${component})
|
if(TARGET SFML::${component})
|
||||||
set(SFML_${UPPER_COMPONENT}_FOUND TRUE)
|
set(SFML_${UPPER_COMPONENT}_FOUND TRUE)
|
||||||
elseif(SFML_FIND_REQUIRED_${component})
|
elseif(SFML_FIND_REQUIRED_${component})
|
||||||
set(FIND_SFML_ERROR "Found SFML but requested component '${component}' is missing in the config defined in ${SFML_DIR}.")
|
set(FIND_SFML_ERROR "Found SFML but requested component '${component}' is missing in the config defined in ${SFML_ROOT}.")
|
||||||
set(SFML_FOUND FALSE)
|
set(SFML_FOUND FALSE)
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
cmake_minimum_required(VERSION 3.22)
|
cmake_minimum_required(VERSION 3.22)
|
||||||
project(sfml-example CXX)
|
project(sfml-example CXX)
|
||||||
|
|
||||||
set(SFML_DIR "${CMAKE_ANDROID_NDK}/sources/third_party/sfml/lib/${CMAKE_ANDROID_ARCH_ABI}/cmake/SFML")
|
set(SFML_ROOT "${CMAKE_ANDROID_NDK}/sources/third_party/sfml/lib/${CMAKE_ANDROID_ARCH_ABI}/cmake/SFML")
|
||||||
|
|
||||||
# Create the libsfml-example.so library that contains the application's c++ code
|
# Create the libsfml-example.so library that contains the application's c++ code
|
||||||
add_library(sfml-example SHARED main.cpp)
|
add_library(sfml-example SHARED main.cpp)
|
||||||
|
Loading…
Reference in New Issue
Block a user