"git@developer.sourcefind.cn:OpenDAS/dgl.git" did not exist on "f1e4f3786d686308d6b987ae28e998fa0016380c"
Commit e30f5e2f authored by Morwenn's avatar Morwenn Committed by Davis E. King
Browse files

Propagate CMake flags to try_compile (fixes #1900) (#1905)

* Forward CMake environment flags to libjpeg tests

* Forward CMake environment flags to libpng tests
parent 1b83016a
...@@ -16,11 +16,17 @@ endif() ...@@ -16,11 +16,17 @@ endif()
find_package(JPEG QUIET) find_package(JPEG QUIET)
if(JPEG_FOUND) if(JPEG_FOUND)
set(JPEG_TEST_CMAKE_FLAGS
"-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}"
"-DCMAKE_INCLUDE_PATH=${CMAKE_INCLUDE_PATH}"
"-DCMAKE_LIBRARY_PATH=${CMAKE_LIBRARY_PATH}")
try_compile(test_for_libjpeg_worked try_compile(test_for_libjpeg_worked
${PROJECT_BINARY_DIR}/test_for_libjpeg_build ${PROJECT_BINARY_DIR}/test_for_libjpeg_build
${CMAKE_CURRENT_LIST_DIR}/test_for_libjpeg ${CMAKE_CURRENT_LIST_DIR}/test_for_libjpeg
test_if_libjpeg_is_broken) test_if_libjpeg_is_broken
CMAKE_FLAGS "${JPEG_TEST_CMAKE_FLAGS}")
message (STATUS "Found system copy of libjpeg: ${JPEG_LIBRARY}") message (STATUS "Found system copy of libjpeg: ${JPEG_LIBRARY}")
if(NOT test_for_libjpeg_worked) if(NOT test_for_libjpeg_worked)
......
...@@ -16,11 +16,17 @@ endif() ...@@ -16,11 +16,17 @@ endif()
find_package(PNG QUIET) find_package(PNG QUIET)
if(PNG_FOUND) if(PNG_FOUND)
set(PNG_TEST_CMAKE_FLAGS
"-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}"
"-DCMAKE_INCLUDE_PATH=${CMAKE_INCLUDE_PATH}"
"-DCMAKE_LIBRARY_PATH=${CMAKE_LIBRARY_PATH}")
try_compile(test_for_libpng_worked try_compile(test_for_libpng_worked
${PROJECT_BINARY_DIR}/test_for_libpng_build ${PROJECT_BINARY_DIR}/test_for_libpng_build
${CMAKE_CURRENT_LIST_DIR}/test_for_libpng ${CMAKE_CURRENT_LIST_DIR}/test_for_libpng
test_if_libpng_is_broken) test_if_libpng_is_broken
CMAKE_FLAGS "${PNG_TEST_CMAKE_FLAGS}")
message (STATUS "Found system copy of libpng: ${PNG_LIBRARIES}") message (STATUS "Found system copy of libpng: ${PNG_LIBRARIES}")
if(NOT test_for_libpng_worked) if(NOT test_for_libpng_worked)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment