2017-02-08 05:06:52 +03:00
|
|
|
#
|
|
|
|
# "$Id$"
|
|
|
|
#
|
|
|
|
# CMakeLists.txt used to build test and demo apps by the CMake build system
|
|
|
|
#
|
2019-01-17 23:29:24 +03:00
|
|
|
# Copyright 2004-2019 by Bill Spitzak and others.
|
2017-02-08 05:06:52 +03:00
|
|
|
#
|
|
|
|
# This library is free software. Distribution and use rights are outlined in
|
|
|
|
# the file "COPYING" which should have been included with this file. If this
|
|
|
|
# file is missing or damaged, see the license at:
|
|
|
|
#
|
|
|
|
# http://www.fltk.org/COPYING.php
|
|
|
|
#
|
|
|
|
# Please report all bugs and problems on the following page:
|
|
|
|
#
|
|
|
|
# http://www.fltk.org/str.php
|
|
|
|
#
|
|
|
|
#######################################################################
|
|
|
|
|
2018-01-10 23:49:03 +03:00
|
|
|
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/../bin/examples)
|
2004-10-19 00:29:58 +04:00
|
|
|
|
2010-04-18 19:09:04 +04:00
|
|
|
#######################################################################
|
|
|
|
# audio libs for test apps
|
|
|
|
if(WIN32)
|
2016-06-14 14:00:29 +03:00
|
|
|
set(AUDIOLIBS winmm)
|
2010-04-18 19:09:04 +04:00
|
|
|
elseif(APPLE)
|
2016-06-14 14:00:29 +03:00
|
|
|
set(AUDIOLIBS "-framework CoreAudio")
|
2010-04-18 19:09:04 +04:00
|
|
|
elseif(HAVE_ALSA_ASOUNDLIB_H)
|
2016-06-14 14:00:29 +03:00
|
|
|
find_library(LIB_asound asound)
|
|
|
|
if(LIB_asound)
|
|
|
|
set(AUDIOLIBS ${LIB_asound})
|
|
|
|
endif(LIB_asound)
|
2010-04-18 19:09:04 +04:00
|
|
|
endif(WIN32)
|
|
|
|
|
|
|
|
#######################################################################
|
2010-04-06 02:33:58 +04:00
|
|
|
include_directories(
|
2004-10-19 00:29:58 +04:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
)
|
|
|
|
|
2019-01-16 04:12:29 +03:00
|
|
|
#######################################################################
|
2019-01-17 23:29:24 +03:00
|
|
|
# Add the ANDROID_OK option if the example can be compiled for Android
|
|
|
|
# as well as for other platforms.
|
2019-01-15 03:32:26 +03:00
|
|
|
if(NOT ANDROID)
|
2019-01-17 23:29:24 +03:00
|
|
|
CREATE_EXAMPLE(adjuster adjuster.cxx fltk ANDROID_OK)
|
|
|
|
CREATE_EXAMPLE(arc arc.cxx fltk ANDROID_OK)
|
|
|
|
CREATE_EXAMPLE(animated animated.cxx fltk ANDROID_OK)
|
|
|
|
CREATE_EXAMPLE(ask ask.cxx fltk ANDROID_OK)
|
|
|
|
CREATE_EXAMPLE(bitmap bitmap.cxx fltk ANDROID_OK)
|
2010-04-18 19:09:04 +04:00
|
|
|
CREATE_EXAMPLE(blocks blocks.cxx "fltk;${AUDIOLIBS}")
|
2019-01-17 23:29:24 +03:00
|
|
|
CREATE_EXAMPLE(boxtype boxtype.cxx fltk ANDROID_OK)
|
|
|
|
CREATE_EXAMPLE(browser browser.cxx fltk ANDROID_OK)
|
|
|
|
CREATE_EXAMPLE(button button.cxx fltk ANDROID_OK)
|
|
|
|
CREATE_EXAMPLE(buttons buttons.cxx fltk ANDROID_OK)
|
2020-01-04 00:53:56 +03:00
|
|
|
CREATE_EXAMPLE(checkers "checkers.cxx;checkers_pieces.fl" "fltk;fltk_images" ANDROID_OK)
|
2019-01-17 23:29:24 +03:00
|
|
|
CREATE_EXAMPLE(clock clock.cxx fltk ANDROID_OK)
|
2004-10-19 00:29:58 +04:00
|
|
|
CREATE_EXAMPLE(colbrowser colbrowser.cxx "fltk;fltk_forms")
|
2019-01-17 23:29:24 +03:00
|
|
|
CREATE_EXAMPLE(color_chooser color_chooser.cxx fltk ANDROID_OK)
|
|
|
|
CREATE_EXAMPLE(cursor cursor.cxx fltk ANDROID_OK)
|
|
|
|
CREATE_EXAMPLE(curve curve.cxx fltk ANDROID_OK)
|
2016-04-06 00:15:45 +03:00
|
|
|
CREATE_EXAMPLE(demo demo.cxx fltk)
|
2010-04-06 02:33:58 +04:00
|
|
|
CREATE_EXAMPLE(device device.cxx fltk)
|
2019-01-17 23:29:24 +03:00
|
|
|
CREATE_EXAMPLE(doublebuffer doublebuffer.cxx fltk ANDROID_OK)
|
|
|
|
CREATE_EXAMPLE(editor editor.cxx fltk ANDROID_OK)
|
|
|
|
CREATE_EXAMPLE(fast_slow fast_slow.fl fltk ANDROID_OK)
|
2004-10-19 00:29:58 +04:00
|
|
|
CREATE_EXAMPLE(file_chooser file_chooser.cxx "fltk;fltk_images")
|
|
|
|
CREATE_EXAMPLE(fonts fonts.cxx fltk)
|
|
|
|
CREATE_EXAMPLE(forms forms.cxx "fltk;fltk_forms")
|
|
|
|
CREATE_EXAMPLE(hello hello.cxx fltk)
|
2017-02-08 05:06:52 +03:00
|
|
|
CREATE_EXAMPLE(help_dialog help_dialog.cxx "fltk;fltk_images")
|
2014-06-16 15:39:32 +04:00
|
|
|
CREATE_EXAMPLE(icon icon.cxx fltk)
|
2004-10-19 00:29:58 +04:00
|
|
|
CREATE_EXAMPLE(iconize iconize.cxx fltk)
|
|
|
|
CREATE_EXAMPLE(image image.cxx fltk)
|
|
|
|
CREATE_EXAMPLE(inactive inactive.fl fltk)
|
|
|
|
CREATE_EXAMPLE(input input.cxx fltk)
|
2010-04-18 19:09:04 +04:00
|
|
|
CREATE_EXAMPLE(input_choice input_choice.cxx fltk)
|
2004-10-19 00:29:58 +04:00
|
|
|
CREATE_EXAMPLE(keyboard "keyboard.cxx;keyboard_ui.fl" fltk)
|
|
|
|
CREATE_EXAMPLE(label label.cxx "fltk;fltk_forms")
|
|
|
|
CREATE_EXAMPLE(line_style line_style.cxx fltk)
|
|
|
|
CREATE_EXAMPLE(list_visuals list_visuals.cxx fltk)
|
|
|
|
CREATE_EXAMPLE(mandelbrot "mandelbrot_ui.fl;mandelbrot.cxx" fltk)
|
|
|
|
CREATE_EXAMPLE(menubar menubar.cxx fltk)
|
|
|
|
CREATE_EXAMPLE(message message.cxx fltk)
|
|
|
|
CREATE_EXAMPLE(minimum minimum.cxx fltk)
|
2010-01-15 19:02:00 +03:00
|
|
|
CREATE_EXAMPLE(native-filechooser native-filechooser.cxx "fltk;fltk_images")
|
2004-10-19 00:29:58 +04:00
|
|
|
CREATE_EXAMPLE(navigation navigation.cxx fltk)
|
|
|
|
CREATE_EXAMPLE(output output.cxx "fltk;fltk_forms")
|
|
|
|
CREATE_EXAMPLE(overlay overlay.cxx fltk)
|
|
|
|
CREATE_EXAMPLE(pack pack.cxx fltk)
|
|
|
|
CREATE_EXAMPLE(pixmap pixmap.cxx fltk)
|
|
|
|
CREATE_EXAMPLE(pixmap_browser pixmap_browser.cxx "fltk;fltk_images")
|
|
|
|
CREATE_EXAMPLE(preferences preferences.fl fltk)
|
2016-03-05 03:53:40 +03:00
|
|
|
CREATE_EXAMPLE(offscreen offscreen.cxx fltk)
|
2004-10-19 00:29:58 +04:00
|
|
|
CREATE_EXAMPLE(radio radio.fl fltk)
|
|
|
|
CREATE_EXAMPLE(resize resize.fl fltk)
|
|
|
|
CREATE_EXAMPLE(resizebox resizebox.cxx fltk)
|
2010-04-18 19:09:04 +04:00
|
|
|
CREATE_EXAMPLE(rotated_text rotated_text.cxx fltk)
|
2004-10-19 00:29:58 +04:00
|
|
|
CREATE_EXAMPLE(scroll scroll.cxx fltk)
|
|
|
|
CREATE_EXAMPLE(subwindow subwindow.cxx fltk)
|
2010-04-18 19:09:04 +04:00
|
|
|
CREATE_EXAMPLE(sudoku sudoku.cxx "fltk;fltk_images;${AUDIOLIBS}")
|
2004-10-19 00:29:58 +04:00
|
|
|
CREATE_EXAMPLE(symbols symbols.cxx fltk)
|
|
|
|
CREATE_EXAMPLE(tabs tabs.fl fltk)
|
2010-01-15 19:07:19 +03:00
|
|
|
CREATE_EXAMPLE(table table.cxx fltk)
|
2004-10-19 00:29:58 +04:00
|
|
|
CREATE_EXAMPLE(threads threads.cxx fltk)
|
|
|
|
CREATE_EXAMPLE(tile tile.cxx fltk)
|
|
|
|
CREATE_EXAMPLE(tiled_image tiled_image.cxx fltk)
|
2010-07-10 18:25:46 +04:00
|
|
|
CREATE_EXAMPLE(tree tree.fl fltk)
|
2014-09-27 03:58:05 +04:00
|
|
|
CREATE_EXAMPLE(twowin twowin.cxx fltk)
|
2010-04-06 02:33:58 +04:00
|
|
|
CREATE_EXAMPLE(utf8 utf8.cxx fltk)
|
2004-10-19 00:29:58 +04:00
|
|
|
CREATE_EXAMPLE(valuators valuators.fl fltk)
|
2009-08-31 01:15:43 +04:00
|
|
|
CREATE_EXAMPLE(unittests unittests.cxx fltk)
|
2014-09-27 03:58:05 +04:00
|
|
|
CREATE_EXAMPLE(windowfocus windowfocus.cxx fltk)
|
2004-10-19 00:29:58 +04:00
|
|
|
|
2016-02-09 04:22:51 +03:00
|
|
|
CREATE_EXAMPLE(fltk-versions ../examples/fltk-versions.cxx fltk)
|
|
|
|
|
2004-10-19 00:29:58 +04:00
|
|
|
# OpenGL demos...
|
2010-04-06 02:33:58 +04:00
|
|
|
if(OPENGL_FOUND)
|
2004-10-19 00:29:58 +04:00
|
|
|
CREATE_EXAMPLE(CubeView "CubeMain.cxx;CubeView.cxx;CubeViewUI.fl" "fltk;fltk_gl")
|
|
|
|
CREATE_EXAMPLE(cube cube.cxx "fltk;fltk_gl;${OPENGL_LIBRARIES}")
|
|
|
|
CREATE_EXAMPLE(fractals "fractals.cxx;fracviewer.cxx" "fltk;fltk_gl")
|
|
|
|
CREATE_EXAMPLE(fullscreen fullscreen.cxx "fltk;fltk_gl")
|
|
|
|
CREATE_EXAMPLE(glpuzzle glpuzzle.cxx "fltk;fltk_gl;${OPENGL_LIBRARIES}")
|
|
|
|
CREATE_EXAMPLE(gl_overlay gl_overlay.cxx "fltk;fltk_gl;${OPENGL_LIBRARIES}")
|
|
|
|
CREATE_EXAMPLE(shape shape.cxx "fltk;fltk_gl;${OPENGL_LIBRARIES}")
|
2010-04-06 02:33:58 +04:00
|
|
|
endif(OPENGL_FOUND)
|
|
|
|
|
2019-02-12 17:09:42 +03:00
|
|
|
# Cairo demo - must also be built w/o Cairo (displays a message box)
|
|
|
|
if (FLTK_HAVE_CAIRO)
|
|
|
|
CREATE_EXAMPLE(cairo_test cairo_test.cxx "fltk;fltk_cairo")
|
|
|
|
else ()
|
|
|
|
CREATE_EXAMPLE(cairo_test cairo_test.cxx fltk)
|
|
|
|
endif (FLTK_HAVE_CAIRO)
|
2015-02-11 18:15:46 +03:00
|
|
|
|
2019-01-15 03:32:26 +03:00
|
|
|
endif(NOT ANDROID)
|
2018-03-02 23:03:04 +03:00
|
|
|
|
2015-02-11 18:15:46 +03:00
|
|
|
# We need some support files for the demo programs:
|
|
|
|
|
|
|
|
# Note: this is incomplete as of 11 Feb 2015
|
|
|
|
# Todo: currently all files are copied, but some of them need configuration:
|
|
|
|
# - demo.menu: fluid can't be started (wrong path)
|
2017-02-08 05:06:52 +03:00
|
|
|
# - demo.menu: help_dialog (help_dialog.html) can't find its images (not copied)
|
2015-02-11 18:15:46 +03:00
|
|
|
# - maybe more ...
|
|
|
|
|
2016-01-31 00:00:12 +03:00
|
|
|
# prepare for a "better" test file installation path
|
|
|
|
set (TESTFILE_PATH ${EXECUTABLE_OUTPUT_PATH})
|
|
|
|
|
|
|
|
# *FIXME* *DEBUG*
|
|
|
|
# message ("test/CMakeLists.txt: EXECUTABLE_OUTPUT_PATH = '${EXECUTABLE_OUTPUT_PATH}'")
|
|
|
|
# message ("test/CMakeLists.txt: TESTFILE_PATH = '${TESTFILE_PATH}'")
|
|
|
|
|
2015-02-13 15:16:38 +03:00
|
|
|
# use a target filename to make sure the target directory gets created
|
2016-01-31 00:00:12 +03:00
|
|
|
configure_file(demo.menu ${TESTFILE_PATH}/demo.menu COPYONLY)
|
2015-02-13 15:16:38 +03:00
|
|
|
|
|
|
|
# use target directory only to avoid redundancy
|
2016-01-31 00:00:12 +03:00
|
|
|
configure_file(rgb.txt ${TESTFILE_PATH} COPYONLY)
|
2017-02-08 05:06:52 +03:00
|
|
|
configure_file(help_dialog.html ${TESTFILE_PATH} COPYONLY)
|
2016-01-31 00:00:12 +03:00
|
|
|
configure_file(browser.cxx ${TESTFILE_PATH} COPYONLY)
|
|
|
|
configure_file(editor.cxx ${TESTFILE_PATH} COPYONLY)
|
2019-12-23 16:33:24 +03:00
|
|
|
|
|
|
|
# Apple macOS creates bundles instead of executables and needs a little bit
|
|
|
|
# more help for demos to run correctly
|
2016-05-15 17:07:48 +03:00
|
|
|
if(APPLE AND NOT OPTION_APPLE_X11)
|
2019-12-23 16:33:24 +03:00
|
|
|
|
|
|
|
# make the menu structure part of the app
|
|
|
|
target_sources(demo PRIVATE demo.menu)
|
|
|
|
set_target_properties(demo PROPERTIES MACOSX_BUNDLE TRUE RESOURCE demo.menu )
|
|
|
|
|
|
|
|
# add a sample RGB file that otherwise only exists under X11
|
|
|
|
target_sources(colbrowser PRIVATE rgb.txt)
|
|
|
|
set_target_properties(colbrowser PROPERTIES MACOSX_BUNDLE TRUE RESOURCE rgb.txt )
|
|
|
|
|
|
|
|
# help_dialog displays an html file as an example
|
|
|
|
target_sources(help_dialog PRIVATE help_dialog.html)
|
|
|
|
set_target_properties(help_dialog PROPERTIES MACOSX_BUNDLE TRUE RESOURCE help_dialog.html )
|
|
|
|
|
2016-05-15 17:07:48 +03:00
|
|
|
endif(APPLE AND NOT OPTION_APPLE_X11)
|