aboutsummaryrefslogtreecommitdiff
path: root/src/libui_sdl/libui/examples/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'src/libui_sdl/libui/examples/CMakeLists.txt')
-rw-r--r--src/libui_sdl/libui/examples/CMakeLists.txt38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/libui_sdl/libui/examples/CMakeLists.txt b/src/libui_sdl/libui/examples/CMakeLists.txt
new file mode 100644
index 0000000..3a9ec4c
--- /dev/null
+++ b/src/libui_sdl/libui/examples/CMakeLists.txt
@@ -0,0 +1,38 @@
+# 3 june 2016
+
+if(WIN32)
+ set(_EXAMPLE_RESOURCES_RC resources.rc)
+endif()
+
+macro(_add_example _name)
+ _add_exec(${_name} ${ARGN})
+ # because Microsoft's toolchain is dumb
+ if(MSVC)
+ set_property(TARGET ${_name} APPEND_STRING PROPERTY
+ LINK_FLAGS " /ENTRY:mainCRTStartup")
+ endif()
+endmacro()
+
+_add_example(controlgallery
+ controlgallery/main.c
+ ${_EXAMPLE_RESOURCES_RC}
+)
+
+_add_example(histogram
+ histogram/main.c
+ ${_EXAMPLE_RESOURCES_RC}
+)
+
+_add_example(cpp-multithread
+ cpp-multithread/main.cpp
+ ${_EXAMPLE_RESOURCES_RC}
+)
+if(NOT WIN32)
+ target_link_libraries(cpp-multithread pthread)
+endif()
+
+add_custom_target(examples
+ DEPENDS
+ controlgallery
+ histogram
+ cpp-multithread)