Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stefano Sinigardi
CMake
Commits
bf91e926
Commit
bf91e926
authored
Feb 24, 2018
by
Stefano Sinigardi
Browse files
update FindJPEG tu support debug configurations
parent
a4e7538a
Pipeline
#92427
passed with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Modules/FindJPEG.cmake
View file @
bf91e926
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#
#.rst:
# FindJPEG
# --------
#
# Find JPEG
#
# Find the native JPEG includes and library This module defines
# Result Variables
# ^^^^^^^^^^^^^^^^
#
# The following variables will be defined:
#
# ``JPEG_FOUND``
# True if JPEG found on local system
#
# ``JPEG_INCLUDE_DIR``
# Location of JPEG header files
#
# ``JPEG_LIBRARY``
# List of JPEG libraries
#
#
:
:
#
For compatibility with existing scripts, also this variable is defined but should not be used
:
#
# JPEG_INCLUDE_DIR, where to find jpeglib.h, etc.
# JPEG_LIBRARIES, the libraries needed to use JPEG.
# JPEG_FOUND, If false, do not try to use JPEG.
# ``JPEG_LIBRARIES``
# List of JPEG libraries
#
# also defined, but not for general use are
# Hints
# ^^^^^
#
# ::
# ``JPEG_ROOT``
# Set this variable to a directory that contains a JPEG installation
#
# JPEG_LIBRARY, where to find the JPEG library.
#
include
(
${
CMAKE_CURRENT_LIST_DIR
}
/FindPackageHandleStandardArgs.cmake
)
include
(
${
CMAKE_CURRENT_LIST_DIR
}
/SelectLibraryConfigurations.cmake
)
find_path
(
JPEG_INCLUDE_DIR jpeglib.h
)
# If the user has provided ``JPEG_ROOT``, use it! Choose items found
# at this location over system locations.
if
(
EXISTS
"$ENV{JPEG_ROOT}"
)
file
(
TO_CMAKE_PATH
"$ENV{JPEG_ROOT}"
JPEG_ROOT
)
set
(
JPEG_ROOT
"
${
JPEG_ROOT
}
"
CACHE PATH
"Prefix for JPEG installation."
)
elseif
(
EXISTS
"$ENV{JPEG_DIR}"
)
file
(
TO_CMAKE_PATH
"$ENV{JPEG_DIR}"
JPEG_ROOT
)
set
(
JPEG_ROOT
"
${
JPEG_ROOT
}
"
CACHE PATH
"Prefix for JPEG installation."
)
endif
()
set
(
JPEG_NAMES
${
JPEG_NAMES
}
jpeg
libjpeg
)
find_library
(
JPEG_LIBRARY NAMES
${
JPEG_NAMES
}
)
list
(
APPEND
JPEG_
H_
NAMES jpeglib
.h
jpeg
.h
)
list
(
APPEND JPEG_NAMES jpeg libjpeg
)
include
(
${
CMAKE_CURRENT_LIST_DIR
}
/FindPackageHandleStandardArgs.cmake
)
FIND_PACKAGE_HANDLE_STANDARD_ARGS
(
JPEG DEFAULT_MSG JPEG_LIBRARY JPEG_INCLUDE_DIR
)
foreach
(
jpeg_name
${
JPEG_NAMES
}
)
list
(
APPEND JPEG_NAMES_DEBUG
${
jpeg_name
}
d
)
endforeach
()
if
(
JPEG_
FOUND
)
set
(
JPEG_LIBRARIES
${
JPEG_LIBRARY
}
)
if
(
NOT
JPEG_
INCLUDE_DIR
)
find_path
(
JPEG_INCLUDE_DIR NAMES
${
JPEG_H_NAMES
}
PATHS
${
JPEG_ROOT
}
/include
${
JPEG_INCLUDE_DIRS
}
PATH_SUFFIXES jpeg Release Debug
)
endif
()
# Deprecated declarations.
set
(
NATIVE_JPEG_INCLUDE_
PATH
${
JPEG_
INCLUDE_DIR
}
)
if
(
JPEG_LIBRARY
)
get_filename_component
(
NATIVE_JPEG_LIB_PATH
${
JPEG_LIBRARY
}
PATH
)
if
(
NOT JPEG_LIBRARY
)
find_library
(
JPEG_LIBRARY_RELEASE NAMES
${
JPEG_NAMES
}
PATH
S
${
JPEG_
ROOT
}
PATH_SUFFIXES jpeg
)
find_library
(
JPEG_LIBRARY_DEBUG NAMES
${
JPEG_NAMES_DEBUG
}
PATHS
${
JPEG_ROOT
}
PATH_SUFFIXES debug jpeg
)
select_library_configurations
(
JPEG
)
endif
()
mark_as_advanced
(
JPEG_LIBRARY JPEG_INCLUDE_DIR
)
set
(
JPEG_LIBRARIES
${
JPEG_LIBRARY
}
)
find_package_handle_standard_args
(
JPEG REQUIRED_VARS JPEG_LIBRARY JPEG_INCLUDE_DIR
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment