mirror of
https://github.com/reactos/CMake.git
synced 2025-02-07 20:38:49 +00:00
FindGDAL: add an imported target
This commit is contained in:
parent
dfb3f58f79
commit
87324b9b6a
4
Help/release/dev/FindGDAL-target.rst
Normal file
4
Help/release/dev/FindGDAL-target.rst
Normal file
@ -0,0 +1,4 @@
|
||||
FindGDAL-target
|
||||
---------------
|
||||
|
||||
* The :module:`FindGDAL` module now provides an imported target.
|
@ -7,6 +7,12 @@ FindGDAL
|
||||
|
||||
Find GDAL.
|
||||
|
||||
IMPORTED Targets
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
This module defines :prop_tgt:`IMPORTED` target ``GDAL::GDAL``
|
||||
if GDAL has been found.
|
||||
|
||||
Result Variables
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
@ -135,5 +141,12 @@ find_library(GDAL_LIBRARY
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GDAL DEFAULT_MSG GDAL_LIBRARY GDAL_INCLUDE_DIR)
|
||||
|
||||
if (GDAL_FOUND AND NOT TARGET GDAL::GDAL)
|
||||
add_library(GDAL::GDAL UNKNOWN IMPORTED)
|
||||
set_target_properties(GDAL::GDAL PROPERTIES
|
||||
IMPORTED_LOCATION "${GDAL_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${GDAL_INCLUDE_DIR}")
|
||||
endif ()
|
||||
|
||||
set(GDAL_LIBRARIES ${GDAL_LIBRARY})
|
||||
set(GDAL_INCLUDE_DIRS ${GDAL_INCLUDE_DIR})
|
||||
|
Loading…
x
Reference in New Issue
Block a user