cmake: Add changes for CMake build framework 3.0

New code path only taken if OBS_CMAKE_VERSION is set to 3.0.0 or
greater, old functionality remains unchanged.
This commit is contained in:
PatTheMav
2023-03-26 18:20:38 -04:00
committed by Ryan Foster
parent bbeea0972a
commit 349372b3b3
266 changed files with 7786 additions and 3888 deletions
+4 -9
View File
@@ -37,8 +37,7 @@ find_library(
../bin)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PythonWindows DEFAULT_MSG PYTHON_LIB
PYTHON_INCLUDE_DIR)
find_package_handle_standard_args(PythonWindows DEFAULT_MSG PYTHON_LIB PYTHON_INCLUDE_DIR)
mark_as_advanced(PYTHON_INCLUDE_DIR PYTHON_LIB)
if(PYTHONWINDOWS_FOUND)
@@ -50,16 +49,12 @@ if(PYTHONWINDOWS_FOUND)
if(NOT TARGET Python::Python)
if(IS_ABSOLUTE "${Python_LIBRARIES}")
add_library(Python::Python UNKNOWN IMPORTED)
set_target_properties(Python::Python PROPERTIES IMPORTED_LOCATION
"${Python_LIBRARIES}")
set_target_properties(Python::Python PROPERTIES IMPORTED_LOCATION "${Python_LIBRARIES}")
else()
add_library(Python::Python INTERFACE IMPORTED)
set_target_properties(Python::Python PROPERTIES IMPORTED_LIBNAME
"${Python_LIBRARIES}")
set_target_properties(Python::Python PROPERTIES IMPORTED_LIBNAME "${Python_LIBRARIES}")
endif()
set_target_properties(
Python::Python PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
"${Python_INCLUDE_DIRS}")
set_target_properties(Python::Python PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${Python_INCLUDE_DIRS}")
endif()
endif()