summaryrefslogtreecommitdiff
path: root/examples/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'examples/CMakeLists.txt')
-rw-r--r--examples/CMakeLists.txt12
1 files changed, 9 insertions, 3 deletions
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index e31e67d..869880f 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -16,9 +16,15 @@ if (TIFF_FOUND)
LIST(APPEND TESTS_FILES tiffread)
endif (TIFF_FOUND)
+if (BUILD_SHARED_LIBS)
+ set(GD_LINK_LIB ${GD_LIB})
+else()
+ set(GD_LINK_LIB ${GD_LIB_STATIC})
+endif()
+
FOREACH(test_name ${TESTS_FILES})
add_executable(${test_name} "${test_name}.c")
- target_link_libraries (${test_name} ${GD_LIB})
+ target_link_libraries (${test_name} ${GD_LINK_LIB})
ENDFOREACH(test_name)
if(JPEG_FOUND)
@@ -29,11 +35,11 @@ endif(JPEG_FOUND)
if (WIN32 AND NOT MINGW AND NOT MSYS)
add_executable(windows WIN32 "windows.c")
- target_link_libraries (windows ${GD_LIB})
+ target_link_libraries (windows ${GD_LINK_LIB})
else (WIN32 AND NOT MINGW AND NOT MSYS)
if (MINGW OR MSYS)
add_executable(windows "windows.c")
add_definitions("-mwindows")
- target_link_libraries(windows ${GD_LIB} stdc++ gdi32)
+ target_link_libraries(windows ${GD_LINK_LIB} stdc++ gdi32)
endif (MINGW OR MSYS)
endif (WIN32 AND NOT MINGW AND NOT MSYS)