2008-04-17 13:41:41 -07:00
|
|
|
include_directories (BEFORE "${GD_SOURCE_DIR}/src" "${CMAKE_BINARY_DIR}")
|
2007-10-04 12:47:41 -07:00
|
|
|
|
|
|
|
SET(TESTS_FILES
|
2018-06-21 20:55:11 -07:00
|
|
|
gif
|
2007-10-04 12:47:41 -07:00
|
|
|
)
|
|
|
|
|
2018-06-21 20:55:11 -07:00
|
|
|
if (PNG_FOUND)
|
|
|
|
LIST(APPEND TEST_FILES arc crop tgaread)
|
|
|
|
|
|
|
|
if (JPEG_FOUND)
|
2021-08-15 23:47:59 -07:00
|
|
|
LIST(APPEND TESTS_FILES copyrotated flip nnquant imagescale)
|
2018-06-21 20:55:11 -07:00
|
|
|
endif (JPEG_FOUND)
|
|
|
|
endif (PNG_FOUND)
|
|
|
|
|
2008-01-13 13:11:35 -08:00
|
|
|
if (JPEG_FOUND)
|
2018-06-21 20:55:11 -07:00
|
|
|
LIST(APPEND TESTS_FILES resize)
|
2008-01-13 13:11:35 -08:00
|
|
|
endif (JPEG_FOUND)
|
|
|
|
|
|
|
|
if (TIFF_FOUND)
|
2013-03-07 23:56:32 -08:00
|
|
|
LIST(APPEND TESTS_FILES tiffread)
|
2008-01-13 13:11:35 -08:00
|
|
|
endif (TIFF_FOUND)
|
|
|
|
|
2021-08-13 14:09:39 -07:00
|
|
|
if (HEIF_FOUND)
|
|
|
|
LIST(APPEND TESTS_FILES png2heif)
|
|
|
|
endif (HEIF_FOUND)
|
|
|
|
|
2015-08-27 09:41:25 -07:00
|
|
|
if (BUILD_SHARED_LIBS)
|
|
|
|
set(GD_LINK_LIB ${GD_LIB})
|
|
|
|
else()
|
|
|
|
set(GD_LINK_LIB ${GD_LIB_STATIC})
|
|
|
|
endif()
|
|
|
|
|
2007-10-04 12:47:41 -07:00
|
|
|
FOREACH(test_name ${TESTS_FILES})
|
|
|
|
add_executable(${test_name} "${test_name}.c")
|
2015-08-27 09:41:25 -07:00
|
|
|
target_link_libraries (${test_name} ${GD_LINK_LIB})
|
2007-10-04 12:47:41 -07:00
|
|
|
ENDFOREACH(test_name)
|
2008-04-17 10:03:45 -07:00
|
|
|
|
2018-06-26 01:07:10 -07:00
|
|
|
# Add libraries *after* we've called add_executable on all the tests.
|
|
|
|
|
|
|
|
if (PNG_FOUND AND JPEG_FOUND)
|
|
|
|
if (UNIX)
|
|
|
|
target_link_libraries(copyrotated m)
|
|
|
|
endif (UNIX)
|
|
|
|
endif(PNG_FOUND AND JPEG_FOUND)
|
|
|
|
|
2008-04-17 13:41:41 -07:00
|
|
|
if (WIN32 AND NOT MINGW AND NOT MSYS)
|
2008-04-17 10:03:45 -07:00
|
|
|
add_executable(windows WIN32 "windows.c")
|
2015-08-27 09:41:25 -07:00
|
|
|
target_link_libraries (windows ${GD_LINK_LIB})
|
2008-04-17 13:41:41 -07:00
|
|
|
else (WIN32 AND NOT MINGW AND NOT MSYS)
|
|
|
|
if (MINGW OR MSYS)
|
|
|
|
add_executable(windows "windows.c")
|
|
|
|
add_definitions("-mwindows")
|
2015-08-27 09:41:25 -07:00
|
|
|
target_link_libraries(windows ${GD_LINK_LIB} stdc++ gdi32)
|
2008-04-17 13:41:41 -07:00
|
|
|
endif (MINGW OR MSYS)
|
|
|
|
endif (WIN32 AND NOT MINGW AND NOT MSYS)
|