diff options
author | Hiroshi Miura <miurahr@linux.com> | 2021-10-06 00:39:02 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-10-06 15:28:09 (GMT) |
commit | 6e8754c6251bc2f7edfb0d71303e1b85fce93f5e (patch) | |
tree | 077977c922a7e5cf3a9473cce443777605d2fff2 /Modules | |
parent | bdbce845cd714a1e844976e4cba4734932e89dd5 (diff) | |
download | CMake-6e8754c6251bc2f7edfb0d71303e1b85fce93f5e.zip CMake-6e8754c6251bc2f7edfb0d71303e1b85fce93f5e.tar.gz CMake-6e8754c6251bc2f7edfb0d71303e1b85fce93f5e.tar.bz2 |
FindJasper: Add IMPORTED target
Fixes: #20601
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindJasper.cmake | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Modules/FindJasper.cmake b/Modules/FindJasper.cmake index 0ca0f31..9a62669 100644 --- a/Modules/FindJasper.cmake +++ b/Modules/FindJasper.cmake @@ -7,6 +7,12 @@ FindJasper Find the Jasper JPEG2000 library. +IMPORTED Targets +^^^^^^^^^^^^^^^^ + +``Jasper::Jasper`` + The jasper library, if found. + Result Variables ^^^^^^^^^^^^^^^^ @@ -60,4 +66,25 @@ find_package_handle_standard_args(Jasper if(JASPER_FOUND) set(JASPER_LIBRARIES ${JASPER_LIBRARIES} ${JPEG_LIBRARIES}) set(JASPER_INCLUDE_DIRS ${JASPER_INCLUDE_DIR}) + if(NOT TARGET Jasper::Jasper) + add_library(Jasper::Jasper UNKNOWN IMPORTED) + if(JASPER_INCLUDE_DIRS) + set_target_properties(Jasper::Jasper PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${JASPER_INCLUDE_DIRS}") + endif() + if(EXISTS "${JASPER_LIBRARY_RELEASE}") + set_property(TARGET Jasper::Jasper APPEND PROPERTY + IMPORTED CONFIGURATION RELEASE) + set_target_properties(Jasper::Jasper PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C" + IMPORTED_LOCATION "${JASPER_LIBRARY_RELEASE}") + endif() + if(EXISTS "${JASPER_LIBRARY_DEBUG}") + set_property(TARGET Jasper::Jasper APPEND PROPERTY + IMPORTED CONFIGURATION DEBUG) + set_target_properties(Jasper::Jasper PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "C" + IMPORTED_LOCATION "${JASPER_LIBRARY_DEBUG}") + endif() + endif() endif() |