summaryrefslogtreecommitdiff
path: root/Build/source/libs/gd/libgd-src/examples/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/gd/libgd-src/examples/CMakeLists.txt')
-rw-r--r--Build/source/libs/gd/libgd-src/examples/CMakeLists.txt28
1 files changed, 17 insertions, 11 deletions
diff --git a/Build/source/libs/gd/libgd-src/examples/CMakeLists.txt b/Build/source/libs/gd/libgd-src/examples/CMakeLists.txt
index 869880fa958..120a8f3df4a 100644
--- a/Build/source/libs/gd/libgd-src/examples/CMakeLists.txt
+++ b/Build/source/libs/gd/libgd-src/examples/CMakeLists.txt
@@ -1,15 +1,19 @@
include_directories (BEFORE "${GD_SOURCE_DIR}/src" "${CMAKE_BINARY_DIR}")
SET(TESTS_FILES
- arc
- crop
- gif
- nnquant
- tgaread
+ gif
)
+if (PNG_FOUND)
+ LIST(APPEND TEST_FILES arc crop tgaread)
+
+ if (JPEG_FOUND)
+ LIST(APPEND TESTS_FILES copyrotated flip nnquant)
+ endif (JPEG_FOUND)
+endif (PNG_FOUND)
+
if (JPEG_FOUND)
- LIST(APPEND TESTS_FILES copyrotated flip)
+ LIST(APPEND TESTS_FILES resize)
endif (JPEG_FOUND)
if (TIFF_FOUND)
@@ -27,11 +31,13 @@ FOREACH(test_name ${TESTS_FILES})
target_link_libraries (${test_name} ${GD_LINK_LIB})
ENDFOREACH(test_name)
-if(JPEG_FOUND)
- if(UNIX)
- target_link_libraries(copyrotated m)
- endif(UNIX)
-endif(JPEG_FOUND)
+# 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)
if (WIN32 AND NOT MINGW AND NOT MSYS)
add_executable(windows WIN32 "windows.c")