summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorLeo Yang <lyang@topologyinc.com>2015-08-27 12:41:25 -0400
committerLeo Yang <lyang@topologyinc.com>2015-08-27 13:11:37 -0400
commit7147b646f4de2eafc847730eaecee684183959e1 (patch)
tree15cb4c01ecfad00b5bd01581276ff31f642b866c /examples
parent4751b606fa38edc456d627140898a7ec679fcc24 (diff)
downloadlibgd-7147b646f4de2eafc847730eaecee684183959e1.tar.gz
Make BUILD_SHARED_LIBS configurable
As previously build both shared and static if BUILD_SHARED_LIBS is ON. Otherwise build static only.
Diffstat (limited to 'examples')
-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)