Skip to content

Commit

Permalink
simplify CMakeLists.txt further and unset variables after use (#754)
Browse files Browse the repository at this point in the history
  • Loading branch information
farindk committed Jan 18, 2023
1 parent a2c9dac commit e04bbfe
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ find_package(JPEG)
if (JPEG_FOUND)
add_definitions(-DHAVE_LIBJPEG=1)

include(${CMAKE_ROOT}/Modules/CheckCXXSourceCompiles.cmake)
include(CheckCXXSourceCompiles)

# this is needed for CheckCXXSourceCompiles
set(CMAKE_REQUIRED_LIBRARIES ${JPEG_LIBRARIES})
Expand All @@ -67,6 +67,9 @@ int main() {
return 0;
}
" HAVE_JPEG_WRITE_ICC_PROFILE)
unset(CMAKE_REQUIRED_LIBRARIES)
unset(CMAKE_REQUIRED_INCLUDES)

if (HAVE_JPEG_WRITE_ICC_PROFILE)
add_definitions(-DHAVE_JPEG_WRITE_ICC_PROFILE=1)
endif ()
Expand Down

0 comments on commit e04bbfe

Please sign in to comment.