2016-06-03 18:25:43 -05:00
|
|
|
# 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}
|
|
|
|
)
|
|
|
|
|
2018-02-20 00:39:44 -06:00
|
|
|
_add_example(datetime
|
|
|
|
datetime/main.c
|
|
|
|
${_EXAMPLE_RESOURCES_RC}
|
|
|
|
)
|
|
|
|
|
2016-06-03 18:25:43 -05:00
|
|
|
_add_example(cpp-multithread
|
|
|
|
cpp-multithread/main.cpp
|
|
|
|
${_EXAMPLE_RESOURCES_RC}
|
|
|
|
)
|
|
|
|
if(NOT WIN32)
|
|
|
|
target_link_libraries(cpp-multithread pthread)
|
|
|
|
endif()
|
2018-03-20 01:10:48 -05:00
|
|
|
if(APPLE)
|
|
|
|
# since we use a deployment target of 10.8, the non-C++11-compliant libstdc++ is chosen by default; we need C++11
|
|
|
|
# see issue #302 for more details
|
|
|
|
target_compile_options(cpp-multithread PRIVATE --stdlib=libc++)
|
|
|
|
target_link_libraries(cpp-multithread --stdlib=libc++)
|
|
|
|
endif()
|
2016-06-03 18:25:43 -05:00
|
|
|
|
2018-03-10 20:57:45 -06:00
|
|
|
_add_example(drawtext
|
|
|
|
drawtext/main.c
|
2017-06-10 22:33:25 -05:00
|
|
|
${_EXAMPLE_RESOURCES_RC}
|
|
|
|
)
|
|
|
|
|
2017-08-19 17:32:52 -05:00
|
|
|
_add_example(timer
|
|
|
|
timer/main.c
|
|
|
|
${_EXAMPLE_RESOURCES_RC}
|
|
|
|
)
|
|
|
|
|
2016-06-03 18:25:43 -05:00
|
|
|
add_custom_target(examples
|
|
|
|
DEPENDS
|
|
|
|
controlgallery
|
|
|
|
histogram
|
2017-01-17 12:30:00 -06:00
|
|
|
cpp-multithread
|
2017-08-19 17:32:52 -05:00
|
|
|
drawtext
|
2018-02-20 00:39:44 -06:00
|
|
|
datetime
|
2017-08-19 17:32:52 -05:00
|
|
|
timer)
|