mirror of
https://gitlab.gnome.org/GNOME/libxslt
synced 2025-08-05 23:35:48 +03:00
Check if target exists when reading target properties
This commit is contained in:
committed by
Nick Wellnhofer
parent
3aadd27592
commit
3d72e6151e
@@ -19,6 +19,7 @@ set(LIBXSLT_EXSLT_INCLUDE_DIR "${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_INCLUDEDIR@"
|
||||
set(LIBXSLT_EXSLT_LIBRARY_DIR "${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_LIBDIR@")
|
||||
|
||||
macro(select_library_location target basename)
|
||||
if(TARGET ${target})
|
||||
foreach(property IN ITEMS IMPORTED_LOCATION IMPORTED_IMPLIB)
|
||||
get_target_property(${basename}_${property}_DEBUG ${target} ${property}_DEBUG)
|
||||
get_target_property(${basename}_${property}_MINSIZEREL ${target} ${property}_MINSIZEREL)
|
||||
@@ -41,9 +42,11 @@ macro(select_library_location target basename)
|
||||
set(${basename}_LIBRARY ${${basename}_${property}_DEBUG})
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro(select_executable_location target basename)
|
||||
if(TARGET ${target})
|
||||
get_target_property(${basename}_IMPORTED_LOCATION_DEBUG ${target} IMPORTED_LOCATION_DEBUG)
|
||||
get_target_property(${basename}_IMPORTED_LOCATION_MINSIZEREL ${target} IMPORTED_LOCATION_MINSIZEREL)
|
||||
get_target_property(${basename}_IMPORTED_LOCATION_RELEASE ${target} IMPORTED_LOCATION_RELEASE)
|
||||
@@ -58,6 +61,7 @@ macro(select_executable_location target basename)
|
||||
elseif(${basename}_IMPORTED_LOCATION_DEBUG)
|
||||
set(${basename}_EXECUTABLE ${${basename}_IMPORTED_LOCATION_DEBUG})
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
select_library_location(LibXslt::LibXslt LIBXSLT)
|
||||
|
Reference in New Issue
Block a user