2010-04-06 02:33:58 +04:00
|
|
|
set(EXECUTABLE_OUTPUT_PATH ${FLTK_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)
|
2010-11-30 13:34:43 +03:00
|
|
|
set(AUDIOLIBS winmm)
|
2010-04-18 19:09:04 +04:00
|
|
|
elseif(APPLE)
|
|
|
|
set(AUDIOLIBS "-framework CoreAudio")
|
|
|
|
elseif(HAVE_ALSA_ASOUNDLIB_H)
|
|
|
|
set(AUDIOLIBS -lasound)
|
|
|
|
endif(WIN32)
|
|
|
|
|
|
|
|
#######################################################################
|
2010-04-06 02:33:58 +04:00
|
|
|
macro(CREATE_EXAMPLE NAME SOURCES LIBRARIES)
|
|
|
|
set(srcs)
|
|
|
|
set(flsrcs)
|
|
|
|
foreach(src ${SOURCES})
|
|
|
|
if("${src}" MATCHES ".fl$")
|
|
|
|
list(APPEND flsrcs ${src})
|
|
|
|
else()
|
|
|
|
list(APPEND srcs ${src})
|
|
|
|
endif("${src}" MATCHES ".fl$")
|
|
|
|
endforeach(src)
|
|
|
|
|
|
|
|
if(flsrcs)
|
|
|
|
fltk_wrap_ui(${NAME} ${flsrcs})
|
|
|
|
endif(flsrcs)
|
|
|
|
|
|
|
|
add_executable(${NAME} WIN32 ${srcs} ${${NAME}_FLTK_UI_SRCS})
|
|
|
|
if(flsrcs)
|
|
|
|
add_dependencies(${NAME} ${FLTK_FLUID_EXECUTABLE})
|
|
|
|
endif(flsrcs)
|
|
|
|
target_link_libraries(${NAME} ${LIBRARIES})
|
|
|
|
|
|
|
|
# link in optional libraries
|
2011-01-06 13:24:58 +03:00
|
|
|
if(FLTK_HAVE_CAIRO)
|
2010-04-06 02:33:58 +04:00
|
|
|
target_link_libraries(${NAME} fltk_cairo)
|
2011-01-06 13:24:58 +03:00
|
|
|
endif(FLTK_HAVE_CAIRO)
|
2010-04-06 02:33:58 +04:00
|
|
|
|
|
|
|
if(USE_XFT)
|
|
|
|
target_link_libraries(${NAME} ${X11_Xft_LIB})
|
|
|
|
endif(USE_XFT)
|
|
|
|
|
|
|
|
if(HAVE_XINERAMA)
|
|
|
|
target_link_libraries(${NAME} ${X11_Xinerama_LIB})
|
|
|
|
endif(HAVE_XINERAMA)
|
|
|
|
|
|
|
|
install(TARGETS ${NAME}
|
|
|
|
DESTINATION ${PREFIX_DOC}/examples
|
|
|
|
)
|
|
|
|
endmacro(CREATE_EXAMPLE NAME SOURCES LIBRARIES)
|
|
|
|
|
2010-04-18 19:09:04 +04:00
|
|
|
#######################################################################
|
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}
|
|
|
|
)
|
|
|
|
|
2010-04-18 19:09:04 +04:00
|
|
|
#######################################################################
|
2004-10-19 00:29:58 +04:00
|
|
|
CREATE_EXAMPLE(adjuster adjuster.cxx fltk)
|
|
|
|
CREATE_EXAMPLE(arc arc.cxx fltk)
|
|
|
|
CREATE_EXAMPLE(ask ask.cxx fltk)
|
|
|
|
CREATE_EXAMPLE(bitmap bitmap.cxx fltk)
|
2010-04-18 19:09:04 +04:00
|
|
|
CREATE_EXAMPLE(blocks blocks.cxx "fltk;${AUDIOLIBS}")
|
2004-10-19 00:29:58 +04:00
|
|
|
CREATE_EXAMPLE(boxtype boxtype.cxx fltk)
|
|
|
|
CREATE_EXAMPLE(browser browser.cxx fltk)
|
|
|
|
CREATE_EXAMPLE(button button.cxx fltk)
|
|
|
|
CREATE_EXAMPLE(buttons buttons.cxx fltk)
|
|
|
|
CREATE_EXAMPLE(checkers checkers.cxx fltk)
|
|
|
|
CREATE_EXAMPLE(clock clock.cxx fltk)
|
|
|
|
CREATE_EXAMPLE(colbrowser colbrowser.cxx "fltk;fltk_forms")
|
|
|
|
CREATE_EXAMPLE(color_chooser color_chooser.cxx fltk)
|
|
|
|
CREATE_EXAMPLE(cursor cursor.cxx fltk)
|
|
|
|
CREATE_EXAMPLE(curve curve.cxx fltk)
|
|
|
|
CREATE_EXAMPLE(demo demo.cxx "fltk;fltk_forms")
|
2010-04-06 02:33:58 +04:00
|
|
|
CREATE_EXAMPLE(device device.cxx fltk)
|
2004-10-19 00:29:58 +04:00
|
|
|
CREATE_EXAMPLE(doublebuffer doublebuffer.cxx fltk)
|
|
|
|
CREATE_EXAMPLE(editor editor.cxx fltk)
|
|
|
|
CREATE_EXAMPLE(fast_slow fast_slow.fl fltk)
|
|
|
|
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)
|
|
|
|
CREATE_EXAMPLE(help help.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)
|
|
|
|
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
|
|
|
|
|
|
|
# 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)
|
|
|
|
|
2010-04-18 19:09:04 +04:00
|
|
|
# Cairo demo
|
2011-01-06 13:24:58 +03:00
|
|
|
if(FLTK_HAVE_CAIRO)
|
2010-04-18 19:09:04 +04:00
|
|
|
CREATE_EXAMPLE(cairo_test cairo_test.cxx fltk)
|
2011-01-06 13:24:58 +03:00
|
|
|
endif(FLTK_HAVE_CAIRO)
|