summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2018-06-26 04:07:10 -0400
committerMike Frysinger <vapier@gentoo.org>2018-06-26 04:07:10 -0400
commit1e3a3d9819036870bcdc24389466145f691ccd53 (patch)
tree7faaa1e9bdf648445c42981b59f694a6727bfde5
parent748578ff3fa4b636513373f0613e158b930f3ed4 (diff)
downloadlibgd-1e3a3d9819036870bcdc24389466145f691ccd53.tar.gz
examples: fix build errors in previous cleanup here
There was a double paste error in the name "nnquant", and the link line needs to come after we add programs. This was missed locally due to the conditional logic (blah).
-rw-r--r--examples/CMakeLists.txt13
1 files changed, 9 insertions, 4 deletions
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index ac3c612..120a8f3 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -8,10 +8,7 @@ if (PNG_FOUND)
LIST(APPEND TEST_FILES arc crop tgaread)
if (JPEG_FOUND)
- LIST(APPEND TESTS_FILES copyrotated flip nnquantnnquant)
- if (UNIX)
- target_link_libraries(copyrotated m)
- endif (UNIX)
+ LIST(APPEND TESTS_FILES copyrotated flip nnquant)
endif (JPEG_FOUND)
endif (PNG_FOUND)
@@ -34,6 +31,14 @@ FOREACH(test_name ${TESTS_FILES})
target_link_libraries (${test_name} ${GD_LINK_LIB})
ENDFOREACH(test_name)
+# 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")
target_link_libraries (windows ${GD_LINK_LIB})