| 1 |
include_directories (BEFORE "${GD_SOURCE_DIR}/src" "${CMAKE_BINARY_DIR}") |
| 2 |
|
| 3 |
SET(TESTS_FILES |
| 4 |
gif |
| 5 |
) |
| 6 |
|
| 7 |
if (PNG_FOUND) |
| 8 |
LIST(APPEND TEST_FILES arc crop tgaread) |
| 9 |
|
| 10 |
if (JPEG_FOUND) |
| 11 |
LIST(APPEND TESTS_FILES copyrotated flip nnquant imagescale) |
| 12 |
endif (JPEG_FOUND) |
| 13 |
endif (PNG_FOUND) |
| 14 |
|
| 15 |
if (JPEG_FOUND) |
| 16 |
LIST(APPEND TESTS_FILES resize) |
| 17 |
endif (JPEG_FOUND) |
| 18 |
|
| 19 |
if (TIFF_FOUND) |
| 20 |
LIST(APPEND TESTS_FILES tiffread) |
| 21 |
endif (TIFF_FOUND) |
| 22 |
|
| 23 |
if (HEIF_FOUND) |
| 24 |
LIST(APPEND TESTS_FILES png2heif) |
| 25 |
endif (HEIF_FOUND) |
| 26 |
|
| 27 |
if (BUILD_SHARED_LIBS) |
| 28 |
set(GD_LINK_LIB ${GD_LIB}) |
| 29 |
else() |
| 30 |
set(GD_LINK_LIB ${GD_LIB_STATIC}) |
| 31 |
endif() |
| 32 |
|
| 33 |
FOREACH(test_name ${TESTS_FILES}) |
| 34 |
add_executable(${test_name} "${test_name}.c") |
| 35 |
target_link_libraries (${test_name} ${GD_LINK_LIB}) |
| 36 |
ENDFOREACH(test_name) |
| 37 |
|
| 38 |
# Add libraries *after* we've called add_executable on all the tests. |
| 39 |
|
| 40 |
if (PNG_FOUND AND JPEG_FOUND) |
| 41 |
if (UNIX) |
| 42 |
target_link_libraries(copyrotated m) |
| 43 |
endif (UNIX) |
| 44 |
endif(PNG_FOUND AND JPEG_FOUND) |
| 45 |
|
| 46 |
if (WIN32 AND NOT MINGW AND NOT MSYS) |
| 47 |
add_executable(windows WIN32 "windows.c") |
| 48 |
target_link_libraries (windows ${GD_LINK_LIB}) |
| 49 |
else (WIN32 AND NOT MINGW AND NOT MSYS) |
| 50 |
if (MINGW OR MSYS) |
| 51 |
add_executable(windows "windows.c") |
| 52 |
add_definitions("-mwindows") |
| 53 |
target_link_libraries(windows ${GD_LINK_LIB} stdc++ gdi32) |
| 54 |
endif (MINGW OR MSYS) |
| 55 |
endif (WIN32 AND NOT MINGW AND NOT MSYS) |