[libpng16] Updated CMakeLists.txt, added supporting scripts/gen*.cmake.in

and test.cmake.in
This commit is contained in:
Roger Leigh
2016-01-28 15:58:45 -06:00
committed by Glenn Randers-Pehrson
parent 98c6fa2495
commit 74e481c743
7 changed files with 771 additions and 82 deletions

22
scripts/test.cmake.in Normal file
View File

@@ -0,0 +1,22 @@
set(TEST_OPTIONS "@TEST_OPTIONS@")
set(TEST_FILES "@TEST_FILES@")
foreach(file ${TEST_FILES})
file(TO_NATIVE_PATH "${file}" native_file)
list(APPEND NATIVE_TEST_FILES "${native_file}")
endforeach()
# Add the directory containing libpng to the PATH (Windows only)
if(WIN32)
get_filename_component(LIBPNG_DIR "${LIBPNG}" PATH)
file(TO_NATIVE_PATH "${LIBPNG_DIR}" LIBPNG_DIR)
set(ENV{PATH} "${LIBPNG_DIR};$ENV{PATH}")
endif()
execute_process(COMMAND "${CMAKE_COMMAND}" -E echo "Running ${TEST_COMMAND}" ${TEST_OPTIONS} ${NATIVE_TEST_FILES})
execute_process(COMMAND "${TEST_COMMAND}" ${TEST_OPTIONS} ${NATIVE_TEST_FILES}
RESULT_VARIABLE TEST_STATUS)
if(TEST_STATUS)
message(FATAL_ERROR "Returned failed status ${TEST_STATUS}!")
endif()