diff options
author | Mateusz Loskot <mateusz@loskot.net> | 2018-04-17 21:26:44 (GMT) |
---|---|---|
committer | Mateusz Loskot <mateusz@loskot.net> | 2018-04-17 21:26:44 (GMT) |
commit | 13952a3b7fb930baeeda299bf186e29d57d794fe (patch) | |
tree | e2d518abcba507174e3d35b4e67195428626fe02 | |
parent | 1f6649b7d118e9de2a51c9e48b5fea527f608fc1 (diff) | |
download | CMake-13952a3b7fb930baeeda299bf186e29d57d794fe.zip CMake-13952a3b7fb930baeeda299bf186e29d57d794fe.tar.gz CMake-13952a3b7fb930baeeda299bf186e29d57d794fe.tar.bz2 |
FindJPEG: Add multi config support and associated docs
-rw-r--r-- | Modules/FindJPEG.cmake | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/Modules/FindJPEG.cmake b/Modules/FindJPEG.cmake index 9c047e5..fa4f3a1 100644 --- a/Modules/FindJPEG.cmake +++ b/Modules/FindJPEG.cmake @@ -28,13 +28,33 @@ # # ``JPEG_INCLUDE_DIR`` # where to find jpeglib.h, etc. +# ``JPEG_LIBRARY_RELEASE`` +# where to find the JPEG library (optimized). +# ``JPEG_LIBRARY_DEBUG`` +# where to find the JPEG library (debug). +# +# Obsolete variables +# ^^^^^^^^^^^^^^^^^^ +# # ``JPEG_LIBRARY`` # where to find the JPEG library. find_path(JPEG_INCLUDE_DIR jpeglib.h) -set(JPEG_NAMES ${JPEG_NAMES} jpeg libjpeg) -find_library(JPEG_LIBRARY NAMES ${JPEG_NAMES}) +set(jpeg_names ${JPEG_NAMES} jpeg libjpeg) +foreach(name ${JPEG_NAMES}) + list(APPEND jpeg_names_debug "${name}d") +endforeach() + +if(NOT JPEG_LIBRARY) + find_library(JPEG_LIBRARY_RELEASE NAMES ${jpeg_names}) + find_library(JPEG_LIBRARY_DEBUG NAMES ${jpeg_names_debug}) + include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake) + select_library_configurations(JPEG) + mark_as_advanced(JPEG_LIBRARY_RELEASE JPEG_LIBRARY_DEBUG) +endif() +unset(jpeg_names) +unset(jpeg_names_debug) if(JPEG_INCLUDE_DIR AND EXISTS "${JPEG_INCLUDE_DIR}/jpeglib.h") file(STRINGS "${JPEG_INCLUDE_DIR}/jpeglib.h" |