mirror of
https://github.com/fltk/fltk.git
synced 2026-05-10 05:27:55 +08:00
Backport CMake and related stuff from 1.4 (master)
- update formatting + documentation generation - rename help-test.html to help_dialog.html - update CMake files + Makefiles + related source files - update fluid files + dependencies
This commit is contained in:
+93
-4
@@ -1,9 +1,17 @@
|
||||
# ignore file for git - generated from subversion with:
|
||||
# git svn show-ignore
|
||||
#
|
||||
# Files to be ignored by Git (do not commit)
|
||||
#
|
||||
|
||||
*.o
|
||||
*.exe
|
||||
|
||||
# MSVC
|
||||
*.tlog
|
||||
.vs/
|
||||
|
||||
# VS Code (Visual Studio Code) Editor
|
||||
.vscode/
|
||||
|
||||
# /
|
||||
/autom4te*.cache
|
||||
/build
|
||||
@@ -27,6 +35,10 @@
|
||||
/FL/Makefile
|
||||
/FL/*.bck
|
||||
|
||||
# /cairo/
|
||||
/cairo/*.so*
|
||||
/cairo/*.dll
|
||||
|
||||
# /documentation/
|
||||
/documentation/.xvpics
|
||||
/documentation/blocks.0
|
||||
@@ -39,6 +51,7 @@
|
||||
/documentation/Doxyfile
|
||||
/documentation/fltk.0
|
||||
/documentation/fltk.3
|
||||
/documentation/src/fltk-book.tex.in
|
||||
/documentation/fltk-config.0
|
||||
/documentation/fltk-config.1
|
||||
/documentation/fltk-config.z
|
||||
@@ -68,7 +81,6 @@
|
||||
# /examples/
|
||||
/examples/*.exe
|
||||
/examples/clipboard
|
||||
/examples/fltk-versions
|
||||
/examples/howto-add_fd-and-popen
|
||||
/examples/howto-browser-with-icons
|
||||
/examples/howto-drag-and-drop
|
||||
@@ -166,6 +178,7 @@
|
||||
/src/*.sl*
|
||||
/src/*.a
|
||||
/src/*.bck
|
||||
/src/*.dll
|
||||
/src/*.sav
|
||||
/src/*.dylib
|
||||
|
||||
@@ -200,6 +213,7 @@
|
||||
/test/fast_slow.cxx
|
||||
/test/fast_slow.h
|
||||
/test/file_chooser
|
||||
/test/fltk-versions
|
||||
/test/fonts
|
||||
/test/forms
|
||||
/test/fractals
|
||||
@@ -289,5 +303,80 @@
|
||||
# /test/sudoku.app/Contents/MacOS/
|
||||
/test/sudoku.app/Contents/MacOS/sudoku
|
||||
|
||||
**/.DS_Store
|
||||
# /test/ - generated apps (macOS)
|
||||
/test/CubeView.app/
|
||||
/test/adjuster.app/
|
||||
/test/animated.app/
|
||||
/test/arc.app/
|
||||
/test/ask.app/
|
||||
/test/bitmap.app/
|
||||
/test/boxtype.app/
|
||||
/test/browser.app/
|
||||
/test/button.app/
|
||||
/test/buttons.app/
|
||||
/test/cairo_test.app/
|
||||
/test/clock.app/
|
||||
/test/colbrowser.app/
|
||||
/test/color_chooser.app/
|
||||
/test/cube.app/
|
||||
/test/cursor.app/
|
||||
/test/curve.app/
|
||||
/test/demo.app/
|
||||
/test/device.app/
|
||||
/test/doublebuffer.app/
|
||||
/test/editor.app/
|
||||
/test/fast_slow.app/
|
||||
/test/file_chooser.app/
|
||||
/test/fltk-versions.app/
|
||||
/test/fonts.app/
|
||||
/test/forms.app/
|
||||
/test/fractals.app/
|
||||
/test/fullscreen.app/
|
||||
/test/gl_overlay.app/
|
||||
/test/glpuzzle.app/
|
||||
/test/hello.app/
|
||||
/test/help.app/
|
||||
/test/icon.app/
|
||||
/test/iconize.app/
|
||||
/test/image.app/
|
||||
/test/inactive.app/
|
||||
/test/input.app/
|
||||
/test/input_choice.app/
|
||||
/test/keyboard.app/
|
||||
/test/label.app/
|
||||
/test/line_style.app/
|
||||
/test/list_visuals.app/
|
||||
/test/mandelbrot.app/
|
||||
/test/menubar.app/
|
||||
/test/message.app/
|
||||
/test/minimum.app/
|
||||
/test/native-filechooser.app/
|
||||
/test/navigation.app/
|
||||
/test/offscreen.app/
|
||||
/test/output.app/
|
||||
/test/overlay.app/
|
||||
/test/pack.app/
|
||||
/test/pixmap.app/
|
||||
/test/pixmap_browser.app/
|
||||
/test/preferences.app/
|
||||
/test/radio.app/
|
||||
/test/resize.app/
|
||||
/test/resizebox.app/
|
||||
/test/rotated_text.app/
|
||||
/test/scroll.app/
|
||||
/test/shape.app/
|
||||
/test/subwindow.app/
|
||||
/test/symbols.app/
|
||||
/test/table.app/
|
||||
/test/tabs.app/
|
||||
/test/threads.app/
|
||||
/test/tile.app/
|
||||
/test/tiled_image.app/
|
||||
/test/tree.app/
|
||||
/test/twowin.app/
|
||||
/test/unittests.app/
|
||||
/test/utf8.app/
|
||||
/test/valuators.app/
|
||||
/test/windowfocus.app/
|
||||
|
||||
**/.DS_Store
|
||||
|
||||
+31
-33
@@ -1,53 +1,51 @@
|
||||
#
|
||||
# "$Id$"
|
||||
#
|
||||
# FLTK-Functions.cmake
|
||||
# Written by Michael Surette
|
||||
#
|
||||
# Copyright 1998-2016 by Bill Spitzak and others.
|
||||
# Copyright 1998-2021 by Bill Spitzak and others.
|
||||
#
|
||||
# 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
|
||||
# https://www.fltk.org/COPYING.php
|
||||
#
|
||||
# Please report all bugs and problems on the following page:
|
||||
# Please see the following page on how to report bugs and issues:
|
||||
#
|
||||
# http://www.fltk.org/str.php
|
||||
# https://www.fltk.org/bugs.php
|
||||
#
|
||||
|
||||
#######################################################################
|
||||
# functions used by the build system and exported for the end-user
|
||||
#######################################################################
|
||||
|
||||
# USAGE: FLTK_RUN_FLUID TARGET_NAME "FLUID_SOURCE [.. FLUID_SOURCE]"
|
||||
function(FLTK_RUN_FLUID TARGET SOURCES)
|
||||
set (CXX_FILES)
|
||||
foreach(src ${SOURCES})
|
||||
if ("${src}" MATCHES "\\.fl$")
|
||||
string(REGEX REPLACE "(.*).fl" \\1 basename ${src})
|
||||
add_custom_command(
|
||||
OUTPUT "${basename}.cxx" "${basename}.h"
|
||||
COMMAND "${FLTK_FLUID_EXECUTABLE}" -c ${CMAKE_CURRENT_SOURCE_DIR}/${src}
|
||||
DEPENDS ${src}
|
||||
MAIN_DEPENDENCY ${src}
|
||||
)
|
||||
list(APPEND CXX_FILES "${basename}.cxx")
|
||||
endif ("${src}" MATCHES "\\.fl$")
|
||||
set (${TARGET} ${CXX_FILES} PARENT_SCOPE)
|
||||
endforeach(src)
|
||||
endfunction(FLTK_RUN_FLUID TARGET SOURCES)
|
||||
|
||||
function (FLTK_RUN_FLUID TARGET SOURCES)
|
||||
set (CXX_FILES)
|
||||
foreach (src ${SOURCES})
|
||||
if ("${src}" MATCHES "\\.fl$")
|
||||
string(REGEX REPLACE "(.*).fl" \\1 basename ${src})
|
||||
add_custom_command(
|
||||
OUTPUT "${basename}.cxx" "${basename}.h"
|
||||
COMMAND fluid -c ${CMAKE_CURRENT_SOURCE_DIR}/${src}
|
||||
DEPENDS ${src}
|
||||
MAIN_DEPENDENCY ${src}
|
||||
)
|
||||
list (APPEND CXX_FILES "${basename}.cxx")
|
||||
endif ("${src}" MATCHES "\\.fl$")
|
||||
endforeach ()
|
||||
set (${TARGET} ${CXX_FILES} PARENT_SCOPE)
|
||||
endfunction (FLTK_RUN_FLUID TARGET SOURCES)
|
||||
|
||||
#######################################################################
|
||||
# sets the bundle icon for OSX bundles
|
||||
function(FLTK_SET_BUNDLE_ICON TARGET ICON_PATH)
|
||||
get_filename_component(ICON_NAME "${ICON_PATH}" NAME)
|
||||
set_target_properties("${TARGET}" PROPERTIES
|
||||
MACOSX_BUNDLE_ICON_FILE "${ICON_NAME}"
|
||||
RESOURCE "${ICON_PATH}"
|
||||
)
|
||||
endfunction(FLTK_SET_BUNDLE_ICON TARGET ICON_PATH)
|
||||
|
||||
#
|
||||
# End of "$Id$".
|
||||
#
|
||||
# sets the bundle icon for OSX bundles
|
||||
|
||||
function (FLTK_SET_BUNDLE_ICON TARGET ICON_PATH)
|
||||
get_filename_component (ICON_NAME "${ICON_PATH}" NAME)
|
||||
set_target_properties ("${TARGET}" PROPERTIES
|
||||
MACOSX_BUNDLE_ICON_FILE "${ICON_NAME}"
|
||||
RESOURCE "${ICON_PATH}"
|
||||
)
|
||||
endfunction (FLTK_SET_BUNDLE_ICON TARGET ICON_PATH)
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
# - deprecated since FLTK 1.3.4
|
||||
# - will be removed in FLTK 1.4.0 or later
|
||||
|
||||
set (FLTK_VERSION @FLTK_VERSION_FULL@)
|
||||
set (FLTK_VERSION @FLTK_VERSION@)
|
||||
|
||||
include (${CMAKE_CURRENT_LIST_DIR}/FLTK-Targets.cmake)
|
||||
|
||||
@@ -36,7 +36,3 @@ if (CMAKE_CROSSCOMPILING)
|
||||
else ()
|
||||
set (FLTK_FLUID_EXECUTABLE fluid)
|
||||
endif (CMAKE_CROSSCOMPILING)
|
||||
|
||||
#
|
||||
# End of file
|
||||
#
|
||||
|
||||
@@ -13,7 +13,3 @@ message(AUTHOR_WARNING
|
||||
* or later. Please use 'include_directories(\${FLTK_INCLUDE_DIRS})' or
|
||||
* 'target_include_directories(<target> PUBLIC|PRIVATE \${FLTK_INCLUDE_DIRS})'
|
||||
* instead of 'include(\${FLTK_USE_FILE})'.")
|
||||
|
||||
#
|
||||
# End of file
|
||||
#
|
||||
|
||||
+80
-80
@@ -1,129 +1,129 @@
|
||||
#
|
||||
# "$Id$"
|
||||
#
|
||||
# Main CMakeLists.txt to build the FLTK project using CMake (www.cmake.org)
|
||||
# Written by Michael Surette
|
||||
#
|
||||
# Copyright 1998-2016 by Bill Spitzak and others.
|
||||
# Copyright 1998-2020 by Bill Spitzak and others.
|
||||
#
|
||||
# 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
|
||||
# https://www.fltk.org/COPYING.php
|
||||
#
|
||||
# Please report all bugs and problems on the following page:
|
||||
# Please see the following page on how to report bugs and issues:
|
||||
#
|
||||
# http://www.fltk.org/str.php
|
||||
# https://www.fltk.org/bugs.php
|
||||
#
|
||||
|
||||
#######################################################################
|
||||
# final config and export
|
||||
#######################################################################
|
||||
|
||||
# Set the fluid executable path
|
||||
if(CMAKE_CROSSCOMPILING)
|
||||
find_file(FLUID_PATH
|
||||
NAMES fluid fluid.exe
|
||||
PATHS ENV PATH
|
||||
NO_CMAKE_FIND_ROOT_PATH
|
||||
)
|
||||
add_executable(fluid IMPORTED)
|
||||
set(FLTK_FLUID_EXECUTABLE ${FLUID_PATH})
|
||||
set(FLUID) # no export
|
||||
set_target_properties(fluid
|
||||
PROPERTIES IMPORTED_LOCATION ${FLUID_PATH}
|
||||
)
|
||||
else()
|
||||
add_subdirectory(fluid)
|
||||
set(FLTK_FLUID_EXECUTABLE fluid)
|
||||
set(FLUID fluid) # export
|
||||
endif(CMAKE_CROSSCOMPILING)
|
||||
if (CMAKE_CROSSCOMPILING)
|
||||
find_file(FLUID_PATH
|
||||
NAMES fluid fluid.exe
|
||||
PATHS ENV PATH
|
||||
NO_CMAKE_FIND_ROOT_PATH
|
||||
)
|
||||
add_executable(fluid IMPORTED)
|
||||
set (FLTK_FLUID_EXECUTABLE ${FLUID_PATH})
|
||||
set (FLUID) # no export
|
||||
set_target_properties(fluid
|
||||
PROPERTIES IMPORTED_LOCATION ${FLUID_PATH}
|
||||
)
|
||||
else ()
|
||||
add_subdirectory(fluid)
|
||||
set (FLTK_FLUID_EXECUTABLE fluid)
|
||||
set (FLUID fluid) # export
|
||||
endif (CMAKE_CROSSCOMPILING)
|
||||
|
||||
add_subdirectory(src)
|
||||
|
||||
# generate FLTK-Targets.cmake for build directory use
|
||||
export(TARGETS ${FLUID} ${FLTK_LIBRARIES} FILE ${CMAKE_BINARY_DIR}/FLTK-Targets.cmake)
|
||||
export(TARGETS ${FLUID} ${FLTK_LIBRARIES} FILE ${CMAKE_CURRENT_BINARY_DIR}/FLTK-Targets.cmake)
|
||||
|
||||
# generate FLTK-Functions.cmake for build directory use
|
||||
configure_file(
|
||||
${FLTK_SOURCE_DIR}/CMake/FLTK-Functions.cmake
|
||||
${FLTK_BINARY_DIR}/FLTK-Functions.cmake
|
||||
COPYONLY
|
||||
)
|
||||
configure_file (
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMake/FLTK-Functions.cmake
|
||||
${CMAKE_CURRENT_BINARY_DIR}/FLTK-Functions.cmake
|
||||
COPYONLY
|
||||
)
|
||||
|
||||
# generate FLTKConfig.cmake for build directory use
|
||||
set(INCLUDE_DIRS "${FLTK_INCLUDE_DIRS}")
|
||||
set(CONFIG_PATH ${FLTK_BINARY_DIR})
|
||||
set (INCLUDE_DIRS "${FLTK_INCLUDE_DIRS}")
|
||||
set (CONFIG_PATH ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
configure_file(
|
||||
${FLTK_SOURCE_DIR}/CMake/FLTKConfig.cmake.in
|
||||
${FLTK_BINARY_DIR}/FLTKConfig.cmake
|
||||
@ONLY
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMake/FLTKConfig.cmake.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/FLTKConfig.cmake
|
||||
@ONLY
|
||||
)
|
||||
|
||||
# generate UseFLTK.cmake for build directory use
|
||||
configure_file(
|
||||
${FLTK_SOURCE_DIR}/CMake/UseFLTK.cmake.in
|
||||
${FLTK_BINARY_DIR}/UseFLTK.cmake
|
||||
@ONLY
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMake/UseFLTK.cmake.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/UseFLTK.cmake
|
||||
@ONLY
|
||||
)
|
||||
|
||||
# generate fltk-config for build directory use
|
||||
set(prefix ${FLTK_BINARY_DIR})
|
||||
set(exec_prefix "\${prefix}")
|
||||
set(includedir "${FLTK_SOURCE_DIR}")
|
||||
set(BINARY_DIR "${FLTK_BINARY_DIR}")
|
||||
set(libdir "\${exec_prefix}/lib")
|
||||
set(srcdir ".")
|
||||
set (prefix ${CMAKE_CURRENT_BINARY_DIR})
|
||||
set (exec_prefix "\${prefix}")
|
||||
set (includedir "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
set (BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
set (libdir "\${exec_prefix}/lib")
|
||||
set (srcdir ".")
|
||||
|
||||
set(LIBNAME "${libdir}/libfltk.a")
|
||||
set (LIBNAME "${libdir}/libfltk.a")
|
||||
|
||||
configure_file(
|
||||
"${FLTK_SOURCE_DIR}/fltk-config.in"
|
||||
"${FLTK_BINARY_DIR}/fltk-config"
|
||||
@ONLY
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/fltk-config.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/fltk-config"
|
||||
@ONLY
|
||||
)
|
||||
if(UNIX)
|
||||
execute_process(COMMAND chmod 755 fltk-config
|
||||
WORKING_DIRECTORY "${FLTK_BINARY_DIR}"
|
||||
)
|
||||
endif(UNIX)
|
||||
|
||||
if (UNIX)
|
||||
execute_process(COMMAND chmod 755 fltk-config
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
|
||||
)
|
||||
endif (UNIX)
|
||||
|
||||
# prepare some variables for config.h
|
||||
|
||||
if(IS_ABSOLUTE "${FLTK_DATADIR}")
|
||||
set(PREFIX_DATA "${FLTK_DATADIR}/fltk")
|
||||
else(IS_ABSOLUTE "${FLTK_DATADIR}")
|
||||
set(PREFIX_DATA "${CMAKE_INSTALL_PREFIX}/${FLTK_DATADIR}/fltk")
|
||||
endif(IS_ABSOLUTE "${FLTK_DATADIR}")
|
||||
if (IS_ABSOLUTE "${FLTK_DATADIR}")
|
||||
set (PREFIX_DATA "${FLTK_DATADIR}/fltk")
|
||||
else (IS_ABSOLUTE "${FLTK_DATADIR}")
|
||||
set (PREFIX_DATA "${CMAKE_INSTALL_PREFIX}/${FLTK_DATADIR}/fltk")
|
||||
endif (IS_ABSOLUTE "${FLTK_DATADIR}")
|
||||
|
||||
if(IS_ABSOLUTE "${FLTK_DOCDIR}")
|
||||
set(PREFIX_DOC "${FLTK_DOCDIR}/fltk")
|
||||
else(IS_ABSOLUTE "${FLTK_DOCDIR}")
|
||||
set(PREFIX_DOC "${CMAKE_INSTALL_PREFIX}/${FLTK_DOCDIR}/fltk")
|
||||
endif(IS_ABSOLUTE "${FLTK_DOCDIR}")
|
||||
if (IS_ABSOLUTE "${FLTK_DOCDIR}")
|
||||
set (PREFIX_DOC "${FLTK_DOCDIR}/fltk")
|
||||
else (IS_ABSOLUTE "${FLTK_DOCDIR}")
|
||||
set (PREFIX_DOC "${CMAKE_INSTALL_PREFIX}/${FLTK_DOCDIR}/fltk")
|
||||
endif (IS_ABSOLUTE "${FLTK_DOCDIR}")
|
||||
|
||||
set(CONFIG_H_IN configh.cmake.in)
|
||||
set(CONFIG_H config.h)
|
||||
set (CONFIG_H_IN configh.cmake.in)
|
||||
set (CONFIG_H config.h)
|
||||
|
||||
# generate config.h
|
||||
|
||||
configure_file(
|
||||
"${FLTK_SOURCE_DIR}/${CONFIG_H_IN}"
|
||||
"${FLTK_BINARY_DIR}/${CONFIG_H}"
|
||||
@ONLY
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${CONFIG_H_IN}"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_H}"
|
||||
@ONLY
|
||||
)
|
||||
|
||||
if(OPTION_CREATE_LINKS)
|
||||
# Set PREFIX_INCLUDE to the proper value.
|
||||
if(IS_ABSOLUTE ${FLTK_INCLUDEDIR})
|
||||
set(PREFIX_INCLUDE ${FLTK_INCLUDEDIR})
|
||||
else()
|
||||
set(PREFIX_INCLUDE "${CMAKE_INSTALL_PREFIX}/${FLTK_INCLUDEDIR}")
|
||||
endif(IS_ABSOLUTE ${FLTK_INCLUDEDIR})
|
||||
configure_file(
|
||||
"${FLTK_SOURCE_DIR}/CMake/install-symlinks.cmake.in"
|
||||
"${FLTK_BINARY_DIR}/install-symlinks.cmake"
|
||||
@ONLY
|
||||
)
|
||||
endif(OPTION_CREATE_LINKS)
|
||||
if (OPTION_CREATE_LINKS)
|
||||
# Set PREFIX_INCLUDE to the proper value.
|
||||
if (IS_ABSOLUTE ${FLTK_INCLUDEDIR})
|
||||
set (PREFIX_INCLUDE ${FLTK_INCLUDEDIR})
|
||||
else ()
|
||||
set (PREFIX_INCLUDE "${CMAKE_INSTALL_PREFIX}/${FLTK_INCLUDEDIR}")
|
||||
endif (IS_ABSOLUTE ${FLTK_INCLUDEDIR})
|
||||
configure_file(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/CMake/install-symlinks.cmake.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/install-symlinks.cmake"
|
||||
@ONLY
|
||||
)
|
||||
endif (OPTION_CREATE_LINKS)
|
||||
|
||||
@@ -0,0 +1,123 @@
|
||||
#
|
||||
# Macro used by the CMake build system for the Fast Light Tool Kit (FLTK).
|
||||
# Written by Michael Surette
|
||||
#
|
||||
# Copyright 1998-2020 by Bill Spitzak and others.
|
||||
#
|
||||
# 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:
|
||||
#
|
||||
# https://www.fltk.org/COPYING.php
|
||||
#
|
||||
# Please see the following page on how to report bugs and issues:
|
||||
#
|
||||
# https://www.fltk.org/bugs.php
|
||||
#
|
||||
|
||||
#######################################################################
|
||||
# FL_ADD_LIBRARY - add a static or shared library to the build
|
||||
#######################################################################
|
||||
|
||||
macro (FL_ADD_LIBRARY LIBNAME LIBTYPE LIBFILES)
|
||||
|
||||
if (${LIBTYPE} STREQUAL "SHARED")
|
||||
set (TARGET_NAME ${LIBNAME}_SHARED)
|
||||
else ()
|
||||
set (TARGET_NAME ${LIBNAME})
|
||||
endif (${LIBTYPE} STREQUAL "SHARED")
|
||||
|
||||
if (MSVC)
|
||||
set (OUTPUT_NAME_DEBUG "${LIBNAME}d")
|
||||
set (OUTPUT_NAME_RELEASE "${LIBNAME}")
|
||||
else ()
|
||||
set (OUTPUT_NAME_DEBUG "${LIBNAME}")
|
||||
set (OUTPUT_NAME_RELEASE "${LIBNAME}")
|
||||
endif (MSVC)
|
||||
|
||||
add_library(${TARGET_NAME} ${LIBTYPE} ${LIBFILES})
|
||||
|
||||
# target properties for all libraries
|
||||
|
||||
set_target_properties(${TARGET_NAME}
|
||||
PROPERTIES
|
||||
CLEAN_DIRECT_OUTPUT TRUE
|
||||
COMPILE_DEFINITIONS "FL_LIBRARY"
|
||||
)
|
||||
|
||||
# additional target properties for static libraries
|
||||
|
||||
if (${LIBTYPE} STREQUAL "STATIC")
|
||||
set_target_properties(${TARGET_NAME}
|
||||
PROPERTIES
|
||||
OUTPUT_NAME ${LIBNAME}
|
||||
OUTPUT_NAME_DEBUG ${OUTPUT_NAME_DEBUG}
|
||||
OUTPUT_NAME_RELEASE ${OUTPUT_NAME_RELEASE}
|
||||
)
|
||||
endif (${LIBTYPE} STREQUAL "STATIC")
|
||||
|
||||
# additional target properties for shared (dynamic) libraries (DLL's)
|
||||
|
||||
if (${LIBTYPE} STREQUAL "SHARED")
|
||||
set_target_properties(${TARGET_NAME}
|
||||
PROPERTIES
|
||||
VERSION ${FLTK_VERSION}
|
||||
SOVERSION ${FLTK_VERSION_MAJOR}.${FLTK_VERSION_MINOR}
|
||||
OUTPUT_NAME ${LIBNAME}
|
||||
OUTPUT_NAME_DEBUG ${OUTPUT_NAME_DEBUG}
|
||||
OUTPUT_NAME_RELEASE ${OUTPUT_NAME_RELEASE}
|
||||
)
|
||||
# MSVC only:
|
||||
if (MSVC)
|
||||
set_target_properties(${TARGET_NAME}
|
||||
PROPERTIES
|
||||
OUTPUT_NAME lib${LIBNAME}
|
||||
OUTPUT_NAME_DEBUG lib${OUTPUT_NAME_DEBUG}
|
||||
OUTPUT_NAME_RELEASE lib${OUTPUT_NAME_RELEASE}
|
||||
# PREFIX "lib" # for MSVC static/shared coexistence *DOES NOT WORK*
|
||||
)
|
||||
endif (MSVC)
|
||||
endif (${LIBTYPE} STREQUAL "SHARED")
|
||||
|
||||
# Debug library output names (optional)
|
||||
set (DEBUG_ONAME 0)
|
||||
|
||||
if (DEBUG_ONAME)
|
||||
get_target_property (XX_ONAME ${TARGET_NAME} OUTPUT_NAME)
|
||||
get_target_property (XX_ONAME_DEBUG ${TARGET_NAME} OUTPUT_NAME_DEBUG)
|
||||
get_target_property (XX_ONAME_RELEASE ${TARGET_NAME} OUTPUT_NAME_RELEASE)
|
||||
|
||||
fl_debug_var (TARGET_NAME)
|
||||
fl_debug_var (XX_ONAME)
|
||||
fl_debug_var (XX_ONAME_DEBUG)
|
||||
fl_debug_var (XX_ONAME_RELEASE)
|
||||
message (STATUS "---")
|
||||
endif (DEBUG_ONAME)
|
||||
|
||||
if (MSVC)
|
||||
if (OPTION_LARGE_FILE)
|
||||
set_target_properties(${TARGET_NAME}
|
||||
PROPERTIES
|
||||
LINK_FLAGS /LARGEADDRESSAWARE
|
||||
)
|
||||
endif (OPTION_LARGE_FILE)
|
||||
|
||||
if (${LIBTYPE} STREQUAL "SHARED")
|
||||
set_target_properties(${TARGET_NAME}
|
||||
PROPERTIES
|
||||
COMPILE_DEFINITIONS "FL_DLL"
|
||||
)
|
||||
endif (${LIBTYPE} STREQUAL "SHARED")
|
||||
endif (MSVC)
|
||||
|
||||
install (TARGETS ${TARGET_NAME}
|
||||
EXPORT FLTK-Targets
|
||||
RUNTIME DESTINATION ${FLTK_BINDIR}
|
||||
LIBRARY DESTINATION ${FLTK_LIBDIR}
|
||||
ARCHIVE DESTINATION ${FLTK_LIBDIR}
|
||||
)
|
||||
|
||||
list (APPEND FLTK_LIBRARIES "${TARGET_NAME}")
|
||||
set (FLTK_LIBRARIES ${FLTK_LIBRARIES} PARENT_SCOPE)
|
||||
|
||||
endmacro (FL_ADD_LIBRARY LIBNAME LIBTYPE LIBFILES)
|
||||
@@ -0,0 +1,164 @@
|
||||
#
|
||||
# A macro used by the CMake build system for the Fast Light Tool Kit (FLTK).
|
||||
# Written by Michael Surette
|
||||
#
|
||||
# Copyright 1998-2020 by Bill Spitzak and others.
|
||||
#
|
||||
# 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:
|
||||
#
|
||||
# https://www.fltk.org/COPYING.php
|
||||
#
|
||||
# Please see the following page on how to report bugs and issues:
|
||||
#
|
||||
# https://www.fltk.org/bugs.php
|
||||
#
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# macro CREATE_EXAMPLE - Create a test/demo (example) program
|
||||
#
|
||||
# Input:
|
||||
#
|
||||
# - NAME: program name, e.g. 'hello'
|
||||
#
|
||||
# - SOURCES: list of source files, separated by ';' (needs quotes)
|
||||
# Sources can be:
|
||||
# - .c/.cxx files, e.g. 'hello.cxx'
|
||||
# - .fl (fluid) files, e.g. 'radio.fl'
|
||||
# - .plist file (macOS), e.g. 'editor-Info.plist'
|
||||
# - .icns file (macOS Icon), e.g. 'checkers.icns'
|
||||
# - .rc file (Windows resource file, e.g. icon definition)
|
||||
#
|
||||
# Order of sources doesn't matter, multiple .cxx and .fl files are
|
||||
# supported, but only one .plist and one .icns file.
|
||||
#
|
||||
# File name (type), e.g. '.icns' matters, it is parsed internally:
|
||||
# File types .fl, .plist, and .icns are treated specifically,
|
||||
# all other file types are added to the target's source files.
|
||||
#
|
||||
# macOS specific .icns and .plist files are ignored on other platforms.
|
||||
#
|
||||
# - LIBRARIES:
|
||||
# List of libraries (CMake target names), separated by ';'. Needs
|
||||
# quotes if more than one library is needed, e.g. "fltk_gl;fltk"
|
||||
#
|
||||
# CREATE_EXAMPLE can have an optional fourth argument with a list of options
|
||||
# - the option ANDROID_OK is set if CREATE_EXAMPLE creates code for Android
|
||||
# builds in addition to the native build
|
||||
#
|
||||
################################################################################
|
||||
|
||||
macro (CREATE_EXAMPLE NAME SOURCES LIBRARIES)
|
||||
|
||||
set (srcs) # source files
|
||||
set (flsrcs) # fluid source (.fl) files
|
||||
set (TARGET_NAME ${NAME}) # CMake target name
|
||||
set (ICON_NAME) # macOS icon (max. one)
|
||||
set (PLIST) # macOS .plist file (max. one)
|
||||
set (ICON_PATH) # macOS icon resource path
|
||||
|
||||
# create macOS bundle? 0 = no, 1 = yes
|
||||
|
||||
if (APPLE AND (NOT OPTION_APPLE_X11))
|
||||
set (MAC_BUNDLE 1)
|
||||
else ()
|
||||
set (MAC_BUNDLE 0)
|
||||
endif (APPLE AND (NOT OPTION_APPLE_X11))
|
||||
|
||||
# rename target name "help" (reserved since CMake 2.8.12)
|
||||
# FIXME: not necessary in FLTK 1.4 but left for compatibility (06/2020)
|
||||
|
||||
if (${TARGET_NAME} STREQUAL "help")
|
||||
set (TARGET_NAME "test_help")
|
||||
endif (${TARGET_NAME} STREQUAL "help")
|
||||
|
||||
# filter input files for different handling (fluid, icon, plist, source)
|
||||
|
||||
foreach (src ${SOURCES})
|
||||
if ("${src}" MATCHES "\\.fl$")
|
||||
list (APPEND flsrcs ${src})
|
||||
elseif ("${src}" MATCHES "\\.icns$")
|
||||
set (ICON_NAME "${src}")
|
||||
elseif ("${src}" MATCHES "\\.plist$")
|
||||
set (PLIST "${src}")
|
||||
else ()
|
||||
list (APPEND srcs ${src})
|
||||
endif ("${src}" MATCHES "\\.fl$")
|
||||
endforeach (src)
|
||||
|
||||
# generate source files from .fl files, add output to sources
|
||||
|
||||
if (flsrcs)
|
||||
FLTK_RUN_FLUID (FLUID_SOURCES "${flsrcs}")
|
||||
list (APPEND srcs ${FLUID_SOURCES})
|
||||
unset (FLUID_SOURCES)
|
||||
endif (flsrcs)
|
||||
|
||||
# set macOS (icon) resource path if applicable
|
||||
|
||||
if (MAC_BUNDLE AND ICON_NAME)
|
||||
set (ICON_PATH "${CMAKE_CURRENT_SOURCE_DIR}/${TARGET_NAME}.app/Contents/Resources/${ICON_NAME}")
|
||||
endif (MAC_BUNDLE AND ICON_NAME)
|
||||
|
||||
##############################################################################
|
||||
# add executable target and set properties (all platforms)
|
||||
##############################################################################
|
||||
|
||||
if (MAC_BUNDLE)
|
||||
add_executable (${TARGET_NAME} MACOSX_BUNDLE ${srcs} ${ICON_PATH})
|
||||
else ()
|
||||
add_executable (${TARGET_NAME} WIN32 ${srcs} ${ICON_PATH})
|
||||
endif (MAC_BUNDLE)
|
||||
|
||||
set_target_properties (${TARGET_NAME} PROPERTIES OUTPUT_NAME ${NAME})
|
||||
target_link_libraries (${TARGET_NAME} ${LIBRARIES})
|
||||
|
||||
if (FLTK_HAVE_CAIRO)
|
||||
target_link_directories (${TARGET_NAME} PUBLIC ${PKG_CAIRO_LIBRARY_DIRS})
|
||||
endif (FLTK_HAVE_CAIRO)
|
||||
|
||||
if (ICON_PATH)
|
||||
set_target_properties (${TARGET_NAME} PROPERTIES MACOSX_BUNDLE_ICON_FILE ${ICON_NAME})
|
||||
set_target_properties (${TARGET_NAME} PROPERTIES RESOURCE ${ICON_PATH})
|
||||
endif (ICON_PATH)
|
||||
|
||||
if (PLIST)
|
||||
set_target_properties (${TARGET_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/${PLIST}")
|
||||
elseif (MAC_BUNDLE)
|
||||
set_target_properties (${TARGET_NAME} PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "${TARGET_NAME}")
|
||||
set_target_properties (${TARGET_NAME} PROPERTIES MACOSX_BUNDLE_GUI_IDENTIFIER "org.fltk.${TARGET_NAME}")
|
||||
endif (MAC_BUNDLE AND NOT PLIST)
|
||||
|
||||
##############################################################################
|
||||
# Copy macOS "bundle wrapper" (shell script) to target directory.
|
||||
# The "custom command" will be executed "POST_BUILD".
|
||||
##############################################################################
|
||||
|
||||
if (MAC_BUNDLE)
|
||||
set (WRAPPER "${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/${TARGET_NAME}")
|
||||
add_custom_command (
|
||||
TARGET ${TARGET_NAME} POST_BUILD
|
||||
COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/../CMake/macOS-bundle-wrapper.in ${WRAPPER}
|
||||
COMMAND chmod u+x,g+x,o+x ${WRAPPER}
|
||||
BYPRODUCTS ${WRAPPER}
|
||||
# COMMENT "Creating macOS bundle wrapper script ${WRAPPER}"
|
||||
VERBATIM
|
||||
)
|
||||
unset (WRAPPER)
|
||||
endif (MAC_BUNDLE)
|
||||
|
||||
######################################################################
|
||||
# Parse optional fourth argument "ANDROID_OK", see description above.
|
||||
######################################################################
|
||||
|
||||
if (${ARGC} GREATER 3)
|
||||
foreach (OPTION ${ARGV3})
|
||||
if (${OPTION} STREQUAL "ANDROID_OK" AND OPTION_CREATE_ANDROID_STUDIO_IDE)
|
||||
CREATE_ANDROID_IDE_FOR_TEST (${NAME} ${SOURCES} ${LIBRARIES})
|
||||
endif ()
|
||||
endforeach ()
|
||||
endif ()
|
||||
|
||||
endmacro (CREATE_EXAMPLE NAME SOURCES LIBRARIES)
|
||||
@@ -0,0 +1,47 @@
|
||||
#
|
||||
# Macro used by the CMake build system for the Fast Light Tool Kit (FLTK).
|
||||
# Written by Michael Surette
|
||||
#
|
||||
# Copyright 1998-2020 by Bill Spitzak and others.
|
||||
#
|
||||
# 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:
|
||||
#
|
||||
# https://www.fltk.org/COPYING.php
|
||||
#
|
||||
# Please see the following page on how to report bugs and issues:
|
||||
#
|
||||
# https://www.fltk.org/bugs.php
|
||||
#
|
||||
|
||||
#######################################################################
|
||||
# fl_debug_var - a macro to output debugging info
|
||||
#######################################################################
|
||||
#
|
||||
# This macro displays the name and value of a CMake variable.
|
||||
# The variable name is expanded with spaces to be (at least)
|
||||
# <min_len> (currently 30) characters wide for better readability.
|
||||
# VARNAME must be a string literal, e.g. WIN32 or "WIN32".
|
||||
#
|
||||
# Syntax:
|
||||
# fl_debug_var(VARNAME)
|
||||
#
|
||||
# Example:
|
||||
# fl_debug_var(WIN32)
|
||||
# fl_debug_var("UNIX")
|
||||
#
|
||||
#######################################################################
|
||||
|
||||
macro (fl_debug_var name)
|
||||
set (min_len 30)
|
||||
set (var "${name}")
|
||||
string(LENGTH "${var}" len)
|
||||
while (len LESS min_len)
|
||||
# add one space until min_len is reached
|
||||
# ** string(APPEND var " ") # requires CMake 3.4.x (otherwise loop...)
|
||||
set (var "${var} ")
|
||||
string(LENGTH "${var}" len)
|
||||
endwhile (len LESS min_len)
|
||||
message (STATUS "${var} = '${${name}}'")
|
||||
endmacro (fl_debug_var)
|
||||
@@ -1,17 +1,33 @@
|
||||
#
|
||||
# Installation script to create symlinks for the FLTK project using CMake
|
||||
#
|
||||
# Copyright 1998-2021 by Bill Spitzak and others.
|
||||
#
|
||||
# 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:
|
||||
#
|
||||
# https://www.fltk.org/COPYING.php
|
||||
#
|
||||
# Please see the following page on how to report bugs and issues:
|
||||
#
|
||||
# https://www.fltk.org/bugs.php
|
||||
|
||||
# On unix create backward compatibility symlinks
|
||||
if(NOT EXISTS $ENV{DESTDIR}@PREFIX_INCLUDE@/Fl)
|
||||
EXECUTE_PROCESS(COMMAND ln -s FL Fl
|
||||
WORKING_DIRECTORY $ENV{DESTDIR}@PREFIX_INCLUDE@
|
||||
)
|
||||
endif(NOT EXISTS $ENV{DESTDIR}@PREFIX_INCLUDE@/Fl)
|
||||
# On UNIX create backward compatibility symlinks
|
||||
if (NOT EXISTS $ENV{DESTDIR}@PREFIX_INCLUDE@/Fl)
|
||||
EXECUTE_PROCESS(
|
||||
COMMAND ln -s FL Fl
|
||||
WORKING_DIRECTORY $ENV{DESTDIR}@PREFIX_INCLUDE@
|
||||
)
|
||||
endif (NOT EXISTS $ENV{DESTDIR}@PREFIX_INCLUDE@/Fl)
|
||||
|
||||
file(GLOB FLTK_HEADER_FILES $ENV{DESTDIR}@PREFIX_INCLUDE@/FL/*.H)
|
||||
foreach(file ${FLTK_HEADER_FILES})
|
||||
GET_FILENAME_COMPONENT(nameWE ${file} NAME_WE)
|
||||
if(NOT EXISTS $ENV{DESTDIR}@PREFIX_INCLUDE@/FL/${nameWE}.h)
|
||||
EXECUTE_PROCESS(COMMAND ln -s ${nameWE}.H ${nameWE}.h
|
||||
WORKING_DIRECTORY $ENV{DESTDIR}@PREFIX_INCLUDE@/FL
|
||||
)
|
||||
endif(NOT EXISTS $ENV{DESTDIR}@PREFIX_INCLUDE@/FL/${nameWE}.h)
|
||||
endforeach(file)
|
||||
file (GLOB FLTK_HEADER_FILES $ENV{DESTDIR}@PREFIX_INCLUDE@/FL/*.H)
|
||||
foreach (file ${FLTK_HEADER_FILES})
|
||||
GET_FILENAME_COMPONENT(nameWE ${file} NAME_WE)
|
||||
if (NOT EXISTS $ENV{DESTDIR}@PREFIX_INCLUDE@/FL/${nameWE}.h)
|
||||
EXECUTE_PROCESS(
|
||||
COMMAND ln -s ${nameWE}.H ${nameWE}.h
|
||||
WORKING_DIRECTORY $ENV{DESTDIR}@PREFIX_INCLUDE@/FL
|
||||
)
|
||||
endif (NOT EXISTS $ENV{DESTDIR}@PREFIX_INCLUDE@/FL/${nameWE}.h)
|
||||
endforeach (file)
|
||||
|
||||
+71
-64
@@ -1,20 +1,18 @@
|
||||
#
|
||||
# "$Id$"
|
||||
#
|
||||
# Main CMakeLists.txt to build the FLTK project using CMake (www.cmake.org)
|
||||
# Written by Michael Surette
|
||||
#
|
||||
# Copyright 1998-2016 by Bill Spitzak and others.
|
||||
# Copyright 1998-2020 by Bill Spitzak and others.
|
||||
#
|
||||
# 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
|
||||
# https://www.fltk.org/COPYING.php
|
||||
#
|
||||
# Please report all bugs and problems on the following page:
|
||||
# Please see the following page on how to report bugs and issues:
|
||||
#
|
||||
# http://www.fltk.org/str.php
|
||||
# https://www.fltk.org/bugs.php
|
||||
#
|
||||
|
||||
#######################################################################
|
||||
@@ -27,94 +25,103 @@ configure_file(
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
||||
@ONLY
|
||||
)
|
||||
add_custom_target(uninstall
|
||||
add_custom_target (uninstall
|
||||
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
||||
)
|
||||
|
||||
install(DIRECTORY ${FLTK_SOURCE_DIR}/FL
|
||||
DESTINATION ${FLTK_INCLUDEDIR} USE_SOURCE_PERMISSIONS
|
||||
PATTERN ".svn" EXCLUDE
|
||||
install (DIRECTORY
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/FL
|
||||
DESTINATION ${FLTK_INCLUDEDIR} USE_SOURCE_PERMISSIONS
|
||||
)
|
||||
|
||||
install(DIRECTORY ${FLTK_BINARY_DIR}/FL
|
||||
DESTINATION ${FLTK_INCLUDEDIR} USE_SOURCE_PERMISSIONS
|
||||
install (DIRECTORY
|
||||
${CMAKE_CURRENT_BINARY_DIR}/FL
|
||||
DESTINATION ${FLTK_INCLUDEDIR} USE_SOURCE_PERMISSIONS
|
||||
)
|
||||
|
||||
if(OPTION_CREATE_LINKS)
|
||||
install(SCRIPT ${FLTK_BINARY_DIR}/install-symlinks.cmake)
|
||||
endif(OPTION_CREATE_LINKS)
|
||||
if (OPTION_CREATE_LINKS)
|
||||
install (SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/install-symlinks.cmake)
|
||||
endif (OPTION_CREATE_LINKS)
|
||||
|
||||
# generate FLTKConfig.cmake for installed directory use
|
||||
set(INCLUDE_DIRS ${CMAKE_INSTALL_PREFIX}/include)
|
||||
set (INCLUDE_DIRS ${CMAKE_INSTALL_PREFIX}/include)
|
||||
|
||||
set(CONFIG_PATH ${CMAKE_INSTALL_PREFIX}/${FLTK_CONFIG_PATH})
|
||||
set (CONFIG_PATH ${CMAKE_INSTALL_PREFIX}/${FLTK_CONFIG_PATH})
|
||||
|
||||
install(EXPORT FLTK-Targets
|
||||
DESTINATION ${FLTK_CONFIG_PATH}
|
||||
FILE FLTK-Targets.cmake
|
||||
install (EXPORT FLTK-Targets
|
||||
DESTINATION ${FLTK_CONFIG_PATH}
|
||||
FILE FLTK-Targets.cmake
|
||||
)
|
||||
|
||||
configure_file(
|
||||
${FLTK_SOURCE_DIR}/CMake/FLTKConfig.cmake.in
|
||||
${FLTK_BINARY_DIR}/etc/FLTKConfig.cmake
|
||||
@ONLY
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMake/FLTKConfig.cmake.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/etc/FLTKConfig.cmake
|
||||
@ONLY
|
||||
)
|
||||
|
||||
install(FILES
|
||||
${FLTK_BINARY_DIR}/etc/FLTKConfig.cmake
|
||||
${FLTK_SOURCE_DIR}/CMake/FLTK-Functions.cmake
|
||||
DESTINATION ${FLTK_CONFIG_PATH}
|
||||
install (FILES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/etc/FLTKConfig.cmake
|
||||
DESTINATION ${FLTK_CONFIG_PATH}
|
||||
)
|
||||
|
||||
install (FILES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMake/FLTK-Functions.cmake
|
||||
DESTINATION ${FLTK_CONFIG_PATH}
|
||||
)
|
||||
|
||||
configure_file(
|
||||
${FLTK_SOURCE_DIR}/CMake/UseFLTK.cmake.in
|
||||
${FLTK_BINARY_DIR}/etc/UseFLTK.cmake
|
||||
@ONLY
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMake/UseFLTK.cmake.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/etc/UseFLTK.cmake
|
||||
@ONLY
|
||||
)
|
||||
|
||||
install(FILES ${FLTK_BINARY_DIR}/etc/UseFLTK.cmake
|
||||
DESTINATION ${FLTK_CONFIG_PATH}
|
||||
# Deprecated: install UseFLTK.cmake with deprecation warnings only
|
||||
install (FILES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/etc/UseFLTK.cmake
|
||||
DESTINATION ${FLTK_CONFIG_PATH}
|
||||
)
|
||||
|
||||
# generate fltk-config
|
||||
set(prefix ${CMAKE_INSTALL_PREFIX})
|
||||
set(exec_prefix "\${prefix}")
|
||||
set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
set(BINARY_DIR)
|
||||
set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
|
||||
set(srcdir ".")
|
||||
set (prefix ${CMAKE_INSTALL_PREFIX})
|
||||
set (exec_prefix "\${prefix}")
|
||||
set (includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
set (BINARY_DIR)
|
||||
set (libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
|
||||
set (srcdir ".")
|
||||
|
||||
set(LIBNAME "${libdir}/libfltk.a")
|
||||
set (LIBNAME "${libdir}/libfltk.a")
|
||||
|
||||
configure_file(
|
||||
"${FLTK_SOURCE_DIR}/fltk-config.in"
|
||||
"${FLTK_BINARY_DIR}/bin/fltk-config"
|
||||
@ONLY
|
||||
)
|
||||
if(UNIX)
|
||||
execute_process(COMMAND chmod 755 fltk-config
|
||||
WORKING_DIRECTORY "${FLTK_BINARY_DIR}/bin"
|
||||
)
|
||||
endif(UNIX)
|
||||
|
||||
install(PROGRAMS ${FLTK_BINARY_DIR}/bin/fltk-config
|
||||
DESTINATION ${FLTK_BINDIR}
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/fltk-config.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/bin/fltk-config"
|
||||
@ONLY
|
||||
)
|
||||
|
||||
if(UNIX OR MSYS OR (MINGW AND CMAKE_CROSSCOMPILING))
|
||||
macro(INSTALL_MAN FILE LEVEL)
|
||||
install(FILES
|
||||
${FLTK_SOURCE_DIR}/documentation/src/${FILE}.man
|
||||
if (UNIX)
|
||||
execute_process (COMMAND chmod 755 fltk-config
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin"
|
||||
)
|
||||
endif (UNIX)
|
||||
|
||||
install (PROGRAMS
|
||||
${CMAKE_CURRENT_BINARY_DIR}/bin/fltk-config
|
||||
DESTINATION ${FLTK_BINDIR}
|
||||
)
|
||||
|
||||
if (UNIX OR MSYS OR (MINGW AND CMAKE_CROSSCOMPILING))
|
||||
macro(INSTALL_MAN FILE LEVEL)
|
||||
install(FILES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/documentation/src/${FILE}.man
|
||||
DESTINATION ${FLTK_MANDIR}/man${LEVEL}
|
||||
RENAME ${FILE}.${LEVEL}
|
||||
)
|
||||
endmacro(INSTALL_MAN FILE LEVEL)
|
||||
)
|
||||
endmacro (INSTALL_MAN FILE LEVEL)
|
||||
|
||||
INSTALL_MAN(fluid 1)
|
||||
INSTALL_MAN(fltk-config 1)
|
||||
INSTALL_MAN(fltk 3)
|
||||
INSTALL_MAN(blocks 6)
|
||||
INSTALL_MAN(checkers 6)
|
||||
INSTALL_MAN(sudoku 6)
|
||||
INSTALL_MAN (fluid 1)
|
||||
INSTALL_MAN (fltk-config 1)
|
||||
INSTALL_MAN (fltk 3)
|
||||
INSTALL_MAN (blocks 6)
|
||||
INSTALL_MAN (checkers 6)
|
||||
INSTALL_MAN (sudoku 6)
|
||||
|
||||
endif(UNIX OR MSYS OR (MINGW AND CMAKE_CROSSCOMPILING))
|
||||
endif (UNIX OR MSYS OR (MINGW AND CMAKE_CROSSCOMPILING))
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Run the executable of a macOS bundle for the Fast Light Tool Kit (FLTK).
|
||||
#
|
||||
# Copyright 1998-2020 by Bill Spitzak and others.
|
||||
#
|
||||
# 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:
|
||||
#
|
||||
# https://www.fltk.org/COPYING.php
|
||||
#
|
||||
# Please see the following page on how to report bugs and issues:
|
||||
#
|
||||
# https://www.fltk.org/bugs.php
|
||||
#
|
||||
#
|
||||
# Install this script side by side with the macOS bundle with the same name:
|
||||
#
|
||||
# - dir/prog.app macOS bundle (directory)
|
||||
# - dir/prog this script: runs the executable 'prog' inside the bundle
|
||||
#
|
||||
prog="`basename \"$0\"`"
|
||||
dir="`dirname \"$0\"`"
|
||||
exec "$dir/$prog.app/Contents/MacOS/$prog" "$@"
|
||||
@@ -1,134 +0,0 @@
|
||||
#
|
||||
# "$Id$"
|
||||
#
|
||||
# macros.cmake
|
||||
# Written by Michael Surette
|
||||
#
|
||||
# Copyright 1998-2016 by Bill Spitzak and others.
|
||||
#
|
||||
# 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
|
||||
#
|
||||
|
||||
#######################################################################
|
||||
# macros used by the build system
|
||||
#######################################################################
|
||||
macro(FL_ADD_LIBRARY LIBNAME LIBTYPE LIBFILES)
|
||||
|
||||
if (${LIBTYPE} STREQUAL "SHARED")
|
||||
set (LIBRARY_NAME ${LIBNAME}_SHARED)
|
||||
else ()
|
||||
set (LIBRARY_NAME ${LIBNAME})
|
||||
endif (${LIBTYPE} STREQUAL "SHARED")
|
||||
|
||||
if (MSVC)
|
||||
set (LIBRARY_NAME_DEBUG "${LIBRARY_NAME}d")
|
||||
else ()
|
||||
set (LIBRARY_NAME_DEBUG "${LIBRARY_NAME}")
|
||||
endif (MSVC)
|
||||
|
||||
add_library(${LIBRARY_NAME} ${LIBTYPE} ${LIBFILES})
|
||||
|
||||
set_target_properties(${LIBRARY_NAME}
|
||||
PROPERTIES
|
||||
OUTPUT_NAME ${LIBRARY_NAME}
|
||||
DEBUG_OUTPUT_NAME ${LIBRARY_NAME_DEBUG}
|
||||
CLEAN_DIRECT_OUTPUT TRUE
|
||||
COMPILE_DEFINITIONS "FL_LIBRARY"
|
||||
)
|
||||
|
||||
if (${LIBTYPE} STREQUAL "SHARED")
|
||||
set_target_properties(${LIBRARY_NAME}
|
||||
PROPERTIES
|
||||
VERSION ${FLTK_VERSION_FULL}
|
||||
SOVERSION ${FLTK_VERSION_MAJOR}.${FLTK_VERSION_MINOR}
|
||||
PREFIX "lib" # for MSVC static/shared coexistence
|
||||
)
|
||||
endif (${LIBTYPE} STREQUAL "SHARED")
|
||||
|
||||
if (MSVC)
|
||||
if (OPTION_LARGE_FILE)
|
||||
set_target_properties(${LIBRARYNAME}
|
||||
PROPERTIES
|
||||
LINK_FLAGS /LARGEADDRESSAWARE
|
||||
)
|
||||
endif (OPTION_LARGE_FILE)
|
||||
|
||||
if (${LIBTYPE} STREQUAL "SHARED")
|
||||
set_target_properties(${LIBRARY_NAME}
|
||||
PROPERTIES
|
||||
COMPILE_DEFINITIONS "FL_DLL"
|
||||
)
|
||||
endif (${LIBTYPE} STREQUAL "SHARED")
|
||||
endif (MSVC)
|
||||
|
||||
install(TARGETS ${LIBRARY_NAME}
|
||||
EXPORT FLTK-Targets
|
||||
RUNTIME DESTINATION ${FLTK_BINDIR}
|
||||
LIBRARY DESTINATION ${FLTK_LIBDIR}
|
||||
ARCHIVE DESTINATION ${FLTK_LIBDIR}
|
||||
)
|
||||
|
||||
list(APPEND FLTK_LIBRARIES "${LIBRARY_NAME}")
|
||||
set (FLTK_LIBRARIES ${FLTK_LIBRARIES} PARENT_SCOPE)
|
||||
|
||||
endmacro(FL_ADD_LIBRARY LIBNAME LIBTYPE LIBFILES)
|
||||
|
||||
#######################################################################
|
||||
function(CREATE_EXAMPLE NAME SOURCES LIBRARIES)
|
||||
|
||||
set (srcs) # source files
|
||||
set (flsrcs) # fluid source files
|
||||
set (icns) # mac icons
|
||||
|
||||
set (tname ${NAME}) # target name
|
||||
|
||||
# rename reserved target name "help" (CMake 2.8.12 and later)
|
||||
if (${tname} MATCHES "^help$")
|
||||
set (tname "test_help")
|
||||
endif (${tname} MATCHES "^help$")
|
||||
|
||||
foreach(src ${SOURCES})
|
||||
if ("${src}" MATCHES "\\.fl$")
|
||||
list(APPEND flsrcs ${src})
|
||||
elseif ("${src}" MATCHES "\\.icns$")
|
||||
set(icns "${src}")
|
||||
else ()
|
||||
list(APPEND srcs ${src})
|
||||
endif ("${src}" MATCHES "\\.fl$")
|
||||
endforeach(src)
|
||||
|
||||
set (FLUID_SOURCES)
|
||||
if (flsrcs)
|
||||
FLTK_RUN_FLUID(FLUID_SOURCES "${flsrcs}")
|
||||
endif (flsrcs)
|
||||
|
||||
if (APPLE AND NOT OPTION_APPLE_X11)
|
||||
add_executable(${tname} MACOSX_BUNDLE ${srcs} ${FLUID_SOURCES} ${icns})
|
||||
if (icns)
|
||||
FLTK_SET_BUNDLE_ICON(${tname} ${icns})
|
||||
endif (icns)
|
||||
else ()
|
||||
add_executable(${tname} WIN32 ${srcs} ${FLUID_SOURCES})
|
||||
endif (APPLE AND NOT OPTION_APPLE_X11)
|
||||
|
||||
set_target_properties(${tname}
|
||||
PROPERTIES OUTPUT_NAME ${NAME}
|
||||
)
|
||||
|
||||
target_link_libraries(${tname} ${LIBRARIES})
|
||||
|
||||
endfunction(CREATE_EXAMPLE NAME SOURCES LIBRARIES)
|
||||
|
||||
#######################################################################
|
||||
|
||||
#
|
||||
# End of "$Id$".
|
||||
#
|
||||
+438
-289
File diff suppressed because it is too large
Load Diff
+201
-122
@@ -1,50 +1,119 @@
|
||||
#
|
||||
# "$Id$"
|
||||
#
|
||||
# Main CMakeLists.txt to build the FLTK project using CMake (www.cmake.org)
|
||||
# Resource definitions to build the FLTK project using CMake (www.cmake.org)
|
||||
# Written by Michael Surette
|
||||
#
|
||||
# Copyright 1998-2015 by Bill Spitzak and others.
|
||||
# Copyright 1998-2021 by Bill Spitzak and others.
|
||||
#
|
||||
# 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
|
||||
# https://www.fltk.org/COPYING.php
|
||||
#
|
||||
# Please report all bugs and problems on the following page:
|
||||
# Please see the following page on how to report bugs and issues:
|
||||
#
|
||||
# http://www.fltk.org/str.php
|
||||
# https://www.fltk.org/bugs.php
|
||||
#
|
||||
|
||||
#######################################################################
|
||||
# check for headers, libraries and functions
|
||||
#######################################################################
|
||||
# headers
|
||||
find_file(HAVE_ALSA_ASOUNDLIB_H alsa/asoundlib.h)
|
||||
find_file(HAVE_DLFCN_H dlfcn.h)
|
||||
find_file(HAVE_FREETYPE_H freetype.h PATH_SUFFIXES freetype2 freetype2/freetype)
|
||||
find_file(HAVE_GL_GL_H GL/gl.h)
|
||||
find_file(HAVE_GL_GLU_H GL/glu.h)
|
||||
find_file(HAVE_LIBPNG_PNG_H libpng/png.h)
|
||||
find_file(HAVE_LOCALE_H locale.h)
|
||||
find_file(HAVE_OPENGL_GLU_H OpenGL/glu.h)
|
||||
find_file(HAVE_PNG_H png.h)
|
||||
find_file(HAVE_PTHREAD_H pthread.h)
|
||||
find_file(HAVE_STDIO_H stdio.h)
|
||||
find_file(HAVE_STRINGS_H strings.h)
|
||||
find_file(HAVE_SYS_SELECT_H sys/select.h)
|
||||
find_file(HAVE_SYS_STDTYPES_H sys/stdtypes.h)
|
||||
find_file(HAVE_X11_XREGION_H X11/Xregion.h)
|
||||
find_path(HAVE_XDBE_H Xdbe.h PATH_SUFFIXES X11/extensions extensions)
|
||||
|
||||
# If CMAKE_REQUIRED_QUIET is 1 (default) the search is mostly quiet,
|
||||
# if it is 0 (or not defined) check_include_files() is more verbose
|
||||
# and the result of the search is logged with fl_debug_var().
|
||||
# This is useful for debugging.
|
||||
|
||||
set (CMAKE_REQUIRED_QUIET 1)
|
||||
|
||||
include (CheckIncludeFiles)
|
||||
|
||||
macro (fl_find_header VAR HEADER)
|
||||
check_include_files ("${HEADER}" ${VAR})
|
||||
if (NOT CMAKE_REQUIRED_QUIET)
|
||||
fl_debug_var (${VAR})
|
||||
endif (NOT CMAKE_REQUIRED_QUIET)
|
||||
endmacro (fl_find_header)
|
||||
|
||||
#######################################################################
|
||||
# Include FindPkgConfig for later use of pkg-config
|
||||
#######################################################################
|
||||
|
||||
include (FindPkgConfig)
|
||||
|
||||
# fl_debug_var (PKG_CONFIG_FOUND)
|
||||
# fl_debug_var (PKG_CONFIG_EXECUTABLE)
|
||||
# fl_debug_var (PKG_CONFIG_VERSION_STRING)
|
||||
|
||||
#######################################################################
|
||||
# Find header files...
|
||||
#######################################################################
|
||||
|
||||
fl_find_header (HAVE_ALSA_ASOUNDLIB_H alsa/asoundlib.h)
|
||||
fl_find_header (HAVE_DLFCN_H dlfcn.h)
|
||||
fl_find_header (HAVE_GL_GLU_H GL/glu.h)
|
||||
fl_find_header (HAVE_LIBPNG_PNG_H libpng/png.h)
|
||||
fl_find_header (HAVE_LOCALE_H locale.h)
|
||||
fl_find_header (HAVE_OPENGL_GLU_H OpenGL/glu.h)
|
||||
fl_find_header (HAVE_PNG_H png.h)
|
||||
fl_find_header (HAVE_STDIO_H stdio.h)
|
||||
fl_find_header (HAVE_STRINGS_H strings.h)
|
||||
fl_find_header (HAVE_SYS_SELECT_H sys/select.h)
|
||||
fl_find_header (HAVE_SYS_STDTYPES_H sys/stdtypes.h)
|
||||
|
||||
fl_find_header (HAVE_X11_XREGION_H "X11/Xlib.h;X11/Xregion.h")
|
||||
fl_find_header (HAVE_XDBE_H "X11/Xlib.h;X11/extensions/Xdbe.h")
|
||||
|
||||
if (WIN32 AND NOT CYGWIN)
|
||||
# we don't use pthreads on Windows (except for Cygwin, see options.cmake)
|
||||
set (HAVE_PTHREAD_H 0)
|
||||
else ()
|
||||
fl_find_header (HAVE_PTHREAD_H pthread.h)
|
||||
endif (WIN32 AND NOT CYGWIN)
|
||||
|
||||
# Special case for Microsoft Visual Studio generator (MSVC):
|
||||
#
|
||||
# The header files <GL/glu.h> and <locale.h> are located in the SDK's
|
||||
# for Visual Studio. If CMake is invoked from a desktop icon or the Windows
|
||||
# menu it doesn't have the correct paths to find these header files.
|
||||
# The CMake folks recommend not to search for these files at all, because
|
||||
# they must always be there, but we do anyway.
|
||||
# If we don't find them we issue a warning and suggest to rerun CMake from
|
||||
# a "Developer Command Prompt for Visual Studio xxxx", but we fix the issue
|
||||
# by setting the *local* instance (not the cache variable) of the corresponding
|
||||
# CMake variable to '1' since we "know" the header file is available.
|
||||
#
|
||||
# If the user builds the solution, everything should run smoothly despite
|
||||
# the fact that the header files were not found.
|
||||
#
|
||||
# If the configuration is changed somehow (e.g. by editing CMakeLists.txt)
|
||||
# CMake will be rerun from within Visual Studio, find the header file, and
|
||||
# set the cache variable for the header file to its correct path. The latter is
|
||||
# only informational so you can see that (and where) the headers were found.
|
||||
#
|
||||
# Note: these cache variables can only be seen in "advanced" mode.
|
||||
|
||||
if (MSVC)
|
||||
message(STATUS "Note: The following three headers should all be found!")
|
||||
message(STATUS "HAVE_GL_GL_H = '${HAVE_GL_GL_H}'")
|
||||
message(STATUS "HAVE_GL_GLU_H = '${HAVE_GL_GLU_H}'")
|
||||
message(STATUS "HAVE_LOCALE_H = '${HAVE_LOCALE_H}'")
|
||||
message(STATUS "If one of these headers was not found, run cmake-gui ...")
|
||||
message(STATUS "... again from a Visual Studio developer command prompt!")
|
||||
set (MSVC_RERUN_MESSAGE FALSE)
|
||||
|
||||
if (NOT HAVE_GL_GLU_H)
|
||||
message (STATUS "Warning: Header file GL/glu.h was not found.")
|
||||
set (HAVE_GL_GLU_H 1)
|
||||
set (MSVC_RERUN_MESSAGE TRUE)
|
||||
endif (NOT HAVE_GL_GLU_H)
|
||||
|
||||
if (NOT HAVE_LOCALE_H)
|
||||
message (STATUS "Warning: Header file locale.h was not found.")
|
||||
set (HAVE_LOCALE_H 1)
|
||||
set (MSVC_RERUN_MESSAGE TRUE)
|
||||
endif (NOT HAVE_LOCALE_H)
|
||||
|
||||
if (MSVC_RERUN_MESSAGE)
|
||||
message (STATUS "The FLTK team recommends to rerun CMake from a")
|
||||
message (STATUS "\"Developer Command Prompt for Visual Studio xxxx\"")
|
||||
endif (MSVC_RERUN_MESSAGE)
|
||||
|
||||
unset (MSVC_RERUN_MESSAGE)
|
||||
endif (MSVC)
|
||||
|
||||
# Simulate the behavior of autoconf macro AC_HEADER_DIRENT, see:
|
||||
@@ -55,123 +124,133 @@ endif (MSVC)
|
||||
# Note: we don't check if it really defines 'DIR', but we stop processing
|
||||
# once we found the first suitable header file.
|
||||
|
||||
find_file(HAVE_DIRENT_H dirent.h)
|
||||
if(NOT HAVE_DIRENT_H)
|
||||
find_file(HAVE_SYS_NDIR_H sys/ndir.h)
|
||||
if(NOT HAVE_SYS_NDIR_H)
|
||||
find_file(HAVE_SYS_DIR_H sys/dir.h)
|
||||
if(NOT HAVE_SYS_DIR_H)
|
||||
find_file(HAVE_NDIR_H ndir.h)
|
||||
endif(NOT HAVE_SYS_DIR_H)
|
||||
endif(NOT HAVE_SYS_NDIR_H)
|
||||
endif(NOT HAVE_DIRENT_H)
|
||||
fl_find_header (HAVE_DIRENT_H dirent.h)
|
||||
|
||||
mark_as_advanced(HAVE_ALSA_ASOUNDLIB_H HAVE_DIRENT_H HAVE_DLFCN_H)
|
||||
mark_as_advanced(HAVE_FREETYPE_H HAVE_GL_GL_H HAVE_GL_GLU_H)
|
||||
mark_as_advanced(HAVE_LIBPNG_PNG_H HAVE_LOCALE_H HAVE_NDIR_H)
|
||||
mark_as_advanced(HAVE_OPENGL_GLU_H HAVE_PNG_H HAVE_PTHREAD_H)
|
||||
mark_as_advanced(HAVE_STDIO_H HAVE_STRINGS_H HAVE_SYS_DIR_H)
|
||||
mark_as_advanced(HAVE_SYS_NDIR_H HAVE_SYS_SELECT_H)
|
||||
mark_as_advanced(HAVE_SYS_STDTYPES_H HAVE_XDBE_H)
|
||||
mark_as_advanced(HAVE_X11_XREGION_H)
|
||||
if (NOT HAVE_DIRENT_H)
|
||||
fl_find_header (HAVE_SYS_NDIR_H sys/ndir.h)
|
||||
if (NOT HAVE_SYS_NDIR_H)
|
||||
fl_find_header (HAVE_SYS_DIR_H sys/dir.h)
|
||||
if (NOT HAVE_SYS_DIR_H)
|
||||
fl_find_header (HAVE_NDIR_H ndir.h)
|
||||
endif (NOT HAVE_SYS_DIR_H)
|
||||
endif (NOT HAVE_SYS_NDIR_H)
|
||||
endif (NOT HAVE_DIRENT_H)
|
||||
|
||||
mark_as_advanced (HAVE_ALSA_ASOUNDLIB_H HAVE_DIRENT_H HAVE_DLFCN_H)
|
||||
mark_as_advanced (HAVE_GL_GLU_H)
|
||||
mark_as_advanced (HAVE_LIBPNG_PNG_H HAVE_LOCALE_H HAVE_NDIR_H)
|
||||
mark_as_advanced (HAVE_OPENGL_GLU_H HAVE_PNG_H HAVE_PTHREAD_H)
|
||||
mark_as_advanced (HAVE_STDIO_H HAVE_STRINGS_H HAVE_SYS_DIR_H)
|
||||
mark_as_advanced (HAVE_SYS_NDIR_H HAVE_SYS_SELECT_H)
|
||||
mark_as_advanced (HAVE_SYS_STDTYPES_H HAVE_XDBE_H)
|
||||
mark_as_advanced (HAVE_X11_XREGION_H)
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
# The following code is used to find the include path for freetype
|
||||
# headers to be able to #include <ft2build.h> in Xft.h.
|
||||
|
||||
# where to find freetype headers
|
||||
find_path(FREETYPE_PATH freetype.h PATH_SUFFIXES freetype2)
|
||||
find_path(FREETYPE_PATH freetype/freetype.h PATH_SUFFIXES freetype2)
|
||||
if(FREETYPE_PATH)
|
||||
include_directories(${FREETYPE_PATH})
|
||||
endif(FREETYPE_PATH)
|
||||
mark_as_advanced(FREETYPE_PATH)
|
||||
|
||||
find_path (FREETYPE_PATH freetype.h PATH_SUFFIXES freetype2)
|
||||
find_path (FREETYPE_PATH freetype/freetype.h PATH_SUFFIXES freetype2)
|
||||
|
||||
if (FREETYPE_PATH)
|
||||
include_directories (${FREETYPE_PATH})
|
||||
endif (FREETYPE_PATH)
|
||||
|
||||
mark_as_advanced (FREETYPE_PATH)
|
||||
|
||||
#######################################################################
|
||||
# libraries
|
||||
find_library(LIB_CAIRO cairo)
|
||||
find_library(LIB_dl dl)
|
||||
find_library(LIB_fontconfig fontconfig)
|
||||
find_library(LIB_freetype freetype)
|
||||
find_library(LIB_GL GL)
|
||||
find_library(LIB_MesaGL MesaGL)
|
||||
find_library(LIB_jpeg jpeg)
|
||||
find_library(LIB_png png)
|
||||
find_library(LIB_zlib z)
|
||||
find_library (LIB_dl dl)
|
||||
if ((NOT APPLE) OR OPTION_APPLE_X11)
|
||||
find_library (LIB_fontconfig fontconfig)
|
||||
endif ((NOT APPLE) OR OPTION_APPLE_X11)
|
||||
find_library (LIB_freetype freetype)
|
||||
find_library (LIB_GL GL)
|
||||
find_library (LIB_MesaGL MesaGL)
|
||||
find_library (LIB_GLEW GLEW)
|
||||
find_library (LIB_jpeg jpeg)
|
||||
find_library (LIB_png png)
|
||||
find_library (LIB_zlib z)
|
||||
|
||||
mark_as_advanced(LIB_CAIRO LIB_dl LIB_fontconfig LIB_freetype)
|
||||
mark_as_advanced(LIB_GL LIB_MesaGL)
|
||||
mark_as_advanced(LIB_jpeg LIB_png LIB_zlib)
|
||||
mark_as_advanced (LIB_dl LIB_fontconfig LIB_freetype)
|
||||
mark_as_advanced (LIB_GL LIB_MesaGL LIB_GLEW)
|
||||
mark_as_advanced (LIB_jpeg LIB_png LIB_zlib)
|
||||
|
||||
#######################################################################
|
||||
# functions
|
||||
include(CheckFunctionExists)
|
||||
include (CheckFunctionExists)
|
||||
|
||||
# save CMAKE_REQUIRED_LIBRARIES (is this really necessary ?)
|
||||
if(DEFINED CMAKE_REQUIRED_LIBRARIES)
|
||||
set(SAVED_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
|
||||
else(DEFINED CMAKE_REQUIRED_LIBRARIES)
|
||||
unset(SAVED_REQUIRED_LIBRARIES)
|
||||
endif(DEFINED CMAKE_REQUIRED_LIBRARIES)
|
||||
set(CMAKE_REQUIRED_LIBRARIES)
|
||||
if (DEFINED CMAKE_REQUIRED_LIBRARIES)
|
||||
set (SAVED_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
|
||||
else (DEFINED CMAKE_REQUIRED_LIBRARIES)
|
||||
unset (SAVED_REQUIRED_LIBRARIES)
|
||||
endif (DEFINED CMAKE_REQUIRED_LIBRARIES)
|
||||
set (CMAKE_REQUIRED_LIBRARIES)
|
||||
|
||||
if(HAVE_DLFCN_H)
|
||||
set(HAVE_DLFCN_H 1)
|
||||
endif(HAVE_DLFCN_H)
|
||||
if (HAVE_DLFCN_H)
|
||||
set (HAVE_DLFCN_H 1)
|
||||
endif (HAVE_DLFCN_H)
|
||||
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_DL_LIBS})
|
||||
CHECK_FUNCTION_EXISTS(dlsym HAVE_DLSYM)
|
||||
set(CMAKE_REQUIRED_LIBRARIES)
|
||||
set (CMAKE_REQUIRED_LIBRARIES ${CMAKE_DL_LIBS})
|
||||
CHECK_FUNCTION_EXISTS (dlsym HAVE_DLSYM)
|
||||
set (CMAKE_REQUIRED_LIBRARIES)
|
||||
|
||||
CHECK_FUNCTION_EXISTS(localeconv HAVE_LOCALECONV)
|
||||
CHECK_FUNCTION_EXISTS (localeconv HAVE_LOCALECONV)
|
||||
|
||||
if(LIB_png)
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${LIB_png})
|
||||
CHECK_FUNCTION_EXISTS(png_get_valid HAVE_PNG_GET_VALID)
|
||||
CHECK_FUNCTION_EXISTS(png_set_tRNS_to_alpha HAVE_PNG_SET_TRNS_TO_ALPHA)
|
||||
set(CMAKE_REQUIRED_LIBRARIES)
|
||||
endif(LIB_png)
|
||||
if (LIB_png)
|
||||
set (CMAKE_REQUIRED_LIBRARIES ${LIB_png})
|
||||
CHECK_FUNCTION_EXISTS (png_get_valid HAVE_PNG_GET_VALID)
|
||||
CHECK_FUNCTION_EXISTS (png_set_tRNS_to_alpha HAVE_PNG_SET_TRNS_TO_ALPHA)
|
||||
set (CMAKE_REQUIRED_LIBRARIES)
|
||||
endif (LIB_png)
|
||||
|
||||
CHECK_FUNCTION_EXISTS(scandir HAVE_SCANDIR)
|
||||
CHECK_FUNCTION_EXISTS(snprintf HAVE_SNPRINTF)
|
||||
CHECK_FUNCTION_EXISTS (scandir HAVE_SCANDIR)
|
||||
CHECK_FUNCTION_EXISTS (snprintf HAVE_SNPRINTF)
|
||||
|
||||
# not really true but we convert strcasecmp calls to _stricmp calls in flstring.h
|
||||
if(MSVC)
|
||||
set(HAVE_STRCASECMP 1)
|
||||
endif(MSVC)
|
||||
if (MSVC)
|
||||
set (HAVE_STRCASECMP 1)
|
||||
endif (MSVC)
|
||||
|
||||
CHECK_FUNCTION_EXISTS(strcasecmp HAVE_STRCASECMP)
|
||||
CHECK_FUNCTION_EXISTS (strcasecmp HAVE_STRCASECMP)
|
||||
|
||||
CHECK_FUNCTION_EXISTS(strlcat HAVE_STRLCAT)
|
||||
CHECK_FUNCTION_EXISTS(strlcpy HAVE_STRLCPY)
|
||||
CHECK_FUNCTION_EXISTS(vsnprintf HAVE_VSNPRINTF)
|
||||
CHECK_FUNCTION_EXISTS (strlcat HAVE_STRLCAT)
|
||||
CHECK_FUNCTION_EXISTS (strlcpy HAVE_STRLCPY)
|
||||
CHECK_FUNCTION_EXISTS (vsnprintf HAVE_VSNPRINTF)
|
||||
|
||||
if(HAVE_SCANDIR AND NOT HAVE_SCANDIR_POSIX)
|
||||
set(MSG "POSIX compatible scandir")
|
||||
message(STATUS "Looking for ${MSG}")
|
||||
if (HAVE_SCANDIR AND NOT HAVE_SCANDIR_POSIX)
|
||||
set (MSG "POSIX compatible scandir")
|
||||
message (STATUS "Looking for ${MSG}")
|
||||
try_compile(V
|
||||
${FLTK_BINARY_DIR}
|
||||
${FLTK_SOURCE_DIR}/CMake/posixScandir.cxx
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMake/posixScandir.cxx
|
||||
)
|
||||
if(V)
|
||||
message(STATUS "${MSG} - found")
|
||||
set(HAVE_SCANDIR_POSIX 1 CACHE INTERNAL "")
|
||||
if (V)
|
||||
message (STATUS "${MSG} - found")
|
||||
set (HAVE_SCANDIR_POSIX 1 CACHE INTERNAL "")
|
||||
else()
|
||||
message(STATUS "${MSG} - not found")
|
||||
set(HAVE_SCANDIR_POSIX HAVE_SCANDIR_POSIX-NOTFOUND)
|
||||
endif(V)
|
||||
endif(HAVE_SCANDIR AND NOT HAVE_SCANDIR_POSIX)
|
||||
mark_as_advanced(HAVE_SCANDIR_POSIX)
|
||||
message (STATUS "${MSG} - not found")
|
||||
set (HAVE_SCANDIR_POSIX HAVE_SCANDIR_POSIX-NOTFOUND)
|
||||
endif (V)
|
||||
endif (HAVE_SCANDIR AND NOT HAVE_SCANDIR_POSIX)
|
||||
mark_as_advanced (HAVE_SCANDIR_POSIX)
|
||||
|
||||
# restore CMAKE_REQUIRED_LIBRARIES (is this really necessary ?)
|
||||
if(DEFINED SAVED_REQUIRED_LIBRARIES)
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${SAVED_REQUIRED_LIBRARIES})
|
||||
unset(SAVED_REQUIRED_LIBRARIES)
|
||||
if (DEFINED SAVED_REQUIRED_LIBRARIES)
|
||||
set (CMAKE_REQUIRED_LIBRARIES ${SAVED_REQUIRED_LIBRARIES})
|
||||
unset (SAVED_REQUIRED_LIBRARIES)
|
||||
else(DEFINED SAVED_REQUIRED_LIBRARIES)
|
||||
unset(CMAKE_REQUIRED_LIBRARIES)
|
||||
endif(DEFINED SAVED_REQUIRED_LIBRARIES)
|
||||
unset (CMAKE_REQUIRED_LIBRARIES)
|
||||
endif (DEFINED SAVED_REQUIRED_LIBRARIES)
|
||||
|
||||
#######################################################################
|
||||
# packages
|
||||
|
||||
# Doxygen: necessary for HTML and PDF docs
|
||||
find_package(Doxygen)
|
||||
find_package (Doxygen)
|
||||
|
||||
# LaTex: necessary for PDF docs (note: FindLATEX doesn't return LATEX_FOUND)
|
||||
|
||||
@@ -180,16 +259,16 @@ find_package(Doxygen)
|
||||
|
||||
set (LATEX_FOUND)
|
||||
if (DOXYGEN_FOUND)
|
||||
find_package(LATEX)
|
||||
find_package (LATEX)
|
||||
if (LATEX_COMPILER AND NOT LATEX_FOUND)
|
||||
set(LATEX_FOUND YES)
|
||||
set (LATEX_FOUND YES)
|
||||
endif (LATEX_COMPILER AND NOT LATEX_FOUND)
|
||||
endif (DOXYGEN_FOUND)
|
||||
|
||||
# message("Doxygen found : ${DOXYGEN_FOUND}")
|
||||
# message("LaTex found : ${LATEX_FOUND}")
|
||||
# message("LaTex Compiler : ${LATEX_COMPILER}")
|
||||
# message ("Doxygen found : ${DOXYGEN_FOUND}")
|
||||
# message ("LaTex found : ${LATEX_FOUND}")
|
||||
# message ("LaTex Compiler : ${LATEX_COMPILER}")
|
||||
|
||||
#
|
||||
# End of "$Id$".
|
||||
#
|
||||
# Cleanup: unset local variables
|
||||
|
||||
unset (CMAKE_REQUIRED_QUIET)
|
||||
|
||||
+90
-113
@@ -1,132 +1,109 @@
|
||||
#
|
||||
# "$Id$"
|
||||
#
|
||||
# CMakeLists.txt to build the FLTK project using CMake (www.cmake.org)
|
||||
# Written by Michael Surette
|
||||
#
|
||||
# Copyright 1998-2017 by Bill Spitzak and others.
|
||||
# Copyright 1998-2020 by Bill Spitzak and others.
|
||||
#
|
||||
# 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
|
||||
# https://www.fltk.org/COPYING.php
|
||||
#
|
||||
# Please report all bugs and problems on the following page:
|
||||
# Please see the following page on how to report bugs and issues:
|
||||
#
|
||||
# http://www.fltk.org/str.php
|
||||
# https://www.fltk.org/bugs.php
|
||||
#
|
||||
|
||||
#######################################################################
|
||||
# basic setup
|
||||
#######################################################################
|
||||
# The FLTK version
|
||||
set(FLTK_VERSION_MAJOR "1")
|
||||
set(FLTK_VERSION_MINOR "3")
|
||||
set(FLTK_VERSION_PATCH "6")
|
||||
set(FLTK_VERSION "${FLTK_VERSION_MAJOR}.${FLTK_VERSION_MINOR}")
|
||||
set(FLTK_VERSION_FULL "${FLTK_VERSION}.${FLTK_VERSION_PATCH}")
|
||||
|
||||
set(EXECUTABLE_OUTPUT_PATH ${FLTK_BINARY_DIR}/bin)
|
||||
set(LIBRARY_OUTPUT_PATH ${FLTK_BINARY_DIR}/lib)
|
||||
set(ARCHIVE_OUTPUT_PATH ${FLTK_BINARY_DIR}/lib)
|
||||
set (EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/bin)
|
||||
set (LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/lib)
|
||||
set (ARCHIVE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/lib)
|
||||
|
||||
# Search for modules in the FLTK source dir first
|
||||
set(CMAKE_MODULE_PATH "${FLTK_SOURCE_DIR}/CMake")
|
||||
set (CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake")
|
||||
|
||||
set(FLTK_INCLUDE_DIRS ${FLTK_BINARY_DIR} ${FLTK_SOURCE_DIR})
|
||||
include_directories(${FLTK_INCLUDE_DIRS})
|
||||
set (FLTK_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
include_directories (${FLTK_INCLUDE_DIRS})
|
||||
|
||||
# Setup install locations
|
||||
if(CMAKE_VERSION VERSION_GREATER 2.8.4)
|
||||
# Use GNUInstallDirs if available.
|
||||
include(GNUInstallDirs)
|
||||
else()
|
||||
# Else set reasonable defaults.
|
||||
set(CMAKE_INSTALL_BINDIR bin)
|
||||
set(CMAKE_INSTALL_LIBDIR lib)
|
||||
set(CMAKE_INSTALL_INCLUDEDIR include)
|
||||
set(CMAKE_INSTALL_DATADIR share)
|
||||
set(CMAKE_INSTALL_MANDIR share/man)
|
||||
endif(CMAKE_VERSION VERSION_GREATER 2.8.4)
|
||||
# Remember root of FLTK source directory in case we're in a subdirectory.
|
||||
# Used for instance to find the source directory for doxygen docs
|
||||
set (FLTK_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
set(FLTK_BINDIR ${CMAKE_INSTALL_BINDIR} CACHE PATH
|
||||
"Binary install path relative to CMAKE_INSTALL_PREFIX unless set to an absolute path.")
|
||||
set(FLTK_LIBDIR ${CMAKE_INSTALL_LIBDIR} CACHE PATH
|
||||
"Library install path relative to CMAKE_INSTALL_PREFIX unless set to an absolute path.")
|
||||
set(FLTK_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR} CACHE PATH
|
||||
"Public header install path relative to CMAKE_INSTALL_PREFIX unless set to an absolute path.")
|
||||
set(FLTK_DATADIR ${CMAKE_INSTALL_DATADIR} CACHE PATH
|
||||
"Non-arch data install path relative to CMAKE_INSTALL_PREFIX unless set to an absolute path.")
|
||||
set(FLTK_MANDIR ${CMAKE_INSTALL_MANDIR} CACHE PATH
|
||||
"Manual install path relative to CMAKE_INSTALL_PREFIX unless set to an absolute path.")
|
||||
set(FLTK_DOCDIR ${CMAKE_INSTALL_DATADIR}/doc CACHE PATH
|
||||
"Non-arch doc install path relative to CMAKE_INSTALL_PREFIX unless set to an absolute path.")
|
||||
# Setup install locations (requires CMake 2.8.4)
|
||||
|
||||
include(GNUInstallDirs)
|
||||
|
||||
|
||||
set (FLTK_BINDIR ${CMAKE_INSTALL_BINDIR} CACHE PATH
|
||||
"Binary install path relative to CMAKE_INSTALL_PREFIX unless set to an absolute path.")
|
||||
set (FLTK_LIBDIR ${CMAKE_INSTALL_LIBDIR} CACHE PATH
|
||||
"Library install path relative to CMAKE_INSTALL_PREFIX unless set to an absolute path.")
|
||||
set (FLTK_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR} CACHE PATH
|
||||
"Public header install path relative to CMAKE_INSTALL_PREFIX unless set to an absolute path.")
|
||||
set (FLTK_DATADIR ${CMAKE_INSTALL_DATADIR} CACHE PATH
|
||||
"Non-arch data install path relative to CMAKE_INSTALL_PREFIX unless set to an absolute path.")
|
||||
set (FLTK_MANDIR ${CMAKE_INSTALL_MANDIR} CACHE PATH
|
||||
"Manual install path relative to CMAKE_INSTALL_PREFIX unless set to an absolute path.")
|
||||
set (FLTK_DOCDIR ${CMAKE_INSTALL_DATADIR}/doc CACHE PATH
|
||||
"Non-arch doc install path relative to CMAKE_INSTALL_PREFIX unless set to an absolute path.")
|
||||
|
||||
|
||||
#######################################################################
|
||||
# platform dependent information
|
||||
#######################################################################
|
||||
|
||||
# The following part is probably wrong but does no harm.
|
||||
# This will be removed in FLTK 1.4.0. AlbrechtS, Dec 28, 2017.
|
||||
# fix no WIN32 defined issue
|
||||
if(NOT WIN32)
|
||||
if(_WIN32)
|
||||
set(WIN32 _WIN32)
|
||||
elseif(__WIN32__)
|
||||
set(WIN32 __WIN32__)
|
||||
endif(_WIN32)
|
||||
endif(NOT WIN32)
|
||||
|
||||
# set where config files go
|
||||
if(WIN32 AND NOT CYGWIN)
|
||||
set(FLTK_CONFIG_PATH CMake)
|
||||
elseif(APPLE AND NOT OPTION_APPLE_X11)
|
||||
set(FLTK_CONFIG_PATH FLTK/.framework/Resources/CMake)
|
||||
else()
|
||||
set(FLTK_CONFIG_PATH ${FLTK_DATADIR}/fltk)
|
||||
endif(WIN32 AND NOT CYGWIN)
|
||||
if (WIN32 AND NOT CYGWIN)
|
||||
set (FLTK_CONFIG_PATH CMake)
|
||||
elseif (APPLE AND NOT OPTION_APPLE_X11)
|
||||
set (FLTK_CONFIG_PATH FLTK.framework/Resources/CMake)
|
||||
else ()
|
||||
set (FLTK_CONFIG_PATH ${FLTK_DATADIR}/fltk)
|
||||
endif (WIN32 AND NOT CYGWIN)
|
||||
|
||||
include(TestBigEndian)
|
||||
TEST_BIG_ENDIAN(WORDS_BIGENDIAN)
|
||||
|
||||
if(APPLE)
|
||||
set(HAVE_STRCASECMP 1)
|
||||
set(HAVE_DIRENT_H 1)
|
||||
set(HAVE_SNPRINTF 1)
|
||||
set(HAVE_VSNPRINTF 1)
|
||||
set(HAVE_SCANDIR 1)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated")
|
||||
if(OPTION_APPLE_X11)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -U__APPLE__")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -U__APPLE__")
|
||||
if(${CMAKE_SYSTEM_VERSION} VERSION_GREATER 16.9.0)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_LIBCPP_HAS_THREAD_API_PTHREAD")
|
||||
endif(${CMAKE_SYSTEM_VERSION} VERSION_GREATER 16.9.0)
|
||||
else()
|
||||
set(__APPLE_QUARTZ__ 1)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework Cocoa")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -framework Cocoa")
|
||||
endif(OPTION_APPLE_X11)
|
||||
endif(APPLE)
|
||||
if (APPLE)
|
||||
set (HAVE_STRCASECMP 1)
|
||||
set (HAVE_DIRENT_H 1)
|
||||
set (HAVE_SNPRINTF 1)
|
||||
set (HAVE_VSNPRINTF 1)
|
||||
set (HAVE_SCANDIR 1)
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated")
|
||||
if (OPTION_APPLE_X11)
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -U__APPLE__")
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -U__APPLE__")
|
||||
if (NOT(${CMAKE_SYSTEM_VERSION} VERSION_LESS 17.0.0)) # a.k.a. macOS version ≥ 10.13
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_LIBCPP_HAS_THREAD_API_PTHREAD")
|
||||
endif (NOT(${CMAKE_SYSTEM_VERSION} VERSION_LESS 17.0.0))
|
||||
else ()
|
||||
set (__APPLE_QUARTZ__ 1)
|
||||
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework Cocoa")
|
||||
set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -framework Cocoa")
|
||||
endif (OPTION_APPLE_X11)
|
||||
endif (APPLE)
|
||||
|
||||
if(WIN32)
|
||||
add_definitions(-DWIN32)
|
||||
if(MSVC)
|
||||
add_definitions(-DWIN32_LEAN_AND_MEAN)
|
||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
||||
######## from ide/VisualC2010/config.h
|
||||
set(BORDER_WIDTH 2)
|
||||
########
|
||||
endif(MSVC)
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL GNU)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-subsystem,windows")
|
||||
endif(CMAKE_C_COMPILER_ID STREQUAL GNU)
|
||||
if(MINGW AND EXISTS /mingw)
|
||||
list(APPEND CMAKE_PREFIX_PATH /mingw)
|
||||
endif(MINGW AND EXISTS /mingw)
|
||||
endif(WIN32)
|
||||
if (WIN32)
|
||||
# we do no longer define WIN32 or _WIN32 (in FLTK 1.4.0 and later)
|
||||
# ... but *must* define WIN32 in FLTK 1.3.x
|
||||
add_definitions (-DWIN32)
|
||||
if (MSVC)
|
||||
add_definitions (-DWIN32_LEAN_AND_MEAN)
|
||||
add_definitions (-D_CRT_SECURE_NO_WARNINGS)
|
||||
set (BORDER_WIDTH 2)
|
||||
endif (MSVC)
|
||||
if (CMAKE_C_COMPILER_ID STREQUAL GNU)
|
||||
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-subsystem,windows")
|
||||
endif (CMAKE_C_COMPILER_ID STREQUAL GNU)
|
||||
if (MINGW AND EXISTS /mingw)
|
||||
list(APPEND CMAKE_PREFIX_PATH /mingw)
|
||||
endif (MINGW AND EXISTS /mingw)
|
||||
endif (WIN32)
|
||||
|
||||
#######################################################################
|
||||
# size of ints
|
||||
@@ -135,24 +112,24 @@ include(CheckTypeSize)
|
||||
CHECK_TYPE_SIZE(short SIZEOF_SHORT)
|
||||
CHECK_TYPE_SIZE(int SIZEOF_INT)
|
||||
CHECK_TYPE_SIZE(long SIZEOF_LONG)
|
||||
CHECK_TYPE_SIZE("long long" HAVE_LONG_LONG)
|
||||
CHECK_TYPE_SIZE("long long" HAVE_LONG_LONG)
|
||||
|
||||
if(${SIZEOF_SHORT} MATCHES "^2$")
|
||||
set(U16 "unsigned short")
|
||||
endif(${SIZEOF_SHORT} MATCHES "^2$")
|
||||
if (${SIZEOF_SHORT} MATCHES "^2$")
|
||||
set (U16 "unsigned short")
|
||||
endif (${SIZEOF_SHORT} MATCHES "^2$")
|
||||
|
||||
if(${SIZEOF_INT} MATCHES "^4$")
|
||||
set(U32 "unsigned")
|
||||
else()
|
||||
if(${SIZEOF_LONG} MATCHES "^4$")
|
||||
set(U32 "unsigned long")
|
||||
endif(${SIZEOF_LONG} MATCHES "^4$")
|
||||
endif(${SIZEOF_INT} MATCHES "^4$")
|
||||
if (${SIZEOF_INT} MATCHES "^4$")
|
||||
set (U32 "unsigned")
|
||||
else ()
|
||||
if (${SIZEOF_LONG} MATCHES "^4$")
|
||||
set (U32 "unsigned long")
|
||||
endif (${SIZEOF_LONG} MATCHES "^4$")
|
||||
endif (${SIZEOF_INT} MATCHES "^4$")
|
||||
|
||||
if(${SIZEOF_INT} MATCHES "^8$")
|
||||
set(U64 "unsigned")
|
||||
else()
|
||||
if(${SIZEOF_LONG} MATCHES "^8$")
|
||||
set(U64 "unsigned long")
|
||||
endif(${SIZEOF_LONG} MATCHES "^8$")
|
||||
endif(${SIZEOF_INT} MATCHES "^8$")
|
||||
if (${SIZEOF_INT} MATCHES "^8$")
|
||||
set (U64 "unsigned")
|
||||
else ()
|
||||
if (${SIZEOF_LONG} MATCHES "^8$")
|
||||
set (U64 "unsigned long")
|
||||
endif (${SIZEOF_LONG} MATCHES "^8$")
|
||||
endif (${SIZEOF_INT} MATCHES "^8$")
|
||||
|
||||
+127
-49
@@ -1,81 +1,159 @@
|
||||
#
|
||||
# "$Id$"
|
||||
#
|
||||
# This file sets variables for common use in export.cmake and install.cmake
|
||||
# Written by Michael Surette
|
||||
#
|
||||
# Copyright 1998-2015 by Bill Spitzak and others.
|
||||
# Copyright 1998-2020 by Bill Spitzak and others.
|
||||
#
|
||||
# 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
|
||||
# https://www.fltk.org/COPYING.php
|
||||
#
|
||||
# Please report all bugs and problems on the following page:
|
||||
# Please see the following page on how to report bugs and issues:
|
||||
#
|
||||
# http://www.fltk.org/str.php
|
||||
# https://www.fltk.org/bugs.php
|
||||
#
|
||||
|
||||
#######################################################################
|
||||
set(FL_MAJOR_VERSION ${FLTK_VERSION_MAJOR})
|
||||
set(FL_MINOR_VERSION ${FLTK_VERSION_MINOR})
|
||||
set(FL_PATCH_VERSION ${FLTK_VERSION_PATCH})
|
||||
|
||||
set (DEBUG_VARIABLES_CMAKE 0)
|
||||
if (DEBUG_VARIABLES_CMAKE)
|
||||
message (STATUS "[** variables.cmake **]")
|
||||
fl_debug_var (HAVE_DLSYM)
|
||||
fl_debug_var (CMAKE_DL_LIBS)
|
||||
fl_debug_var (CMAKE_EXE_LINKER_FLAGS)
|
||||
fl_debug_var (LDFLAGS)
|
||||
fl_debug_var (LIBS)
|
||||
fl_debug_var (GLLIBS)
|
||||
fl_debug_var (IMAGELIBS)
|
||||
fl_debug_var (STATICIMAGELIBS)
|
||||
fl_debug_var (FLTK_LDLIBS)
|
||||
fl_debug_var (LIB_jpeg)
|
||||
fl_debug_var (LIB_png)
|
||||
fl_debug_var (LIB_zlib)
|
||||
endif (DEBUG_VARIABLES_CMAKE)
|
||||
|
||||
#######################################################################
|
||||
# add several libraries (STR #3011)
|
||||
# FIXME: libraries may need reordering, and this version does not yet
|
||||
# correctly support static linking and local zlib, png, and jpeg libs.
|
||||
# add several libraries
|
||||
# FIXME: libraries may need reordering.
|
||||
# FIXME: check fontconfig conditions (only if Xft is used or ...)
|
||||
|
||||
if(LIB_fontconfig)
|
||||
list(APPEND FLTK_LDLIBS -lfontconfig)
|
||||
endif(LIB_fontconfig)
|
||||
if (WIN32)
|
||||
list (APPEND FLTK_LDLIBS -lole32 -luuid -lcomctl32 -lws2_32)
|
||||
elseif (APPLE AND NOT OPTION_APPLE_X11)
|
||||
list (APPEND FLTK_LDLIBS "-framework Cocoa")
|
||||
else ()
|
||||
list (APPEND FLTK_LDLIBS -lm)
|
||||
endif (WIN32)
|
||||
|
||||
if(HAVE_DLSYM)
|
||||
list(APPEND FLTK_LDLIBS -ldl)
|
||||
endif(HAVE_DLSYM)
|
||||
if (LIB_fontconfig)
|
||||
list(APPEND FLTK_LDLIBS -lfontconfig)
|
||||
endif (LIB_fontconfig)
|
||||
|
||||
if(LIB_png)
|
||||
list(APPEND IMAGELIBS -lpng)
|
||||
endif(LIB_png)
|
||||
|
||||
if(LIB_zlib)
|
||||
list(APPEND IMAGELIBS -lz)
|
||||
endif(LIB_zlib)
|
||||
|
||||
if(LIB_jpeg)
|
||||
list(APPEND IMAGELIBS -ljpeg)
|
||||
endif(LIB_jpeg)
|
||||
|
||||
string(REPLACE ";" " " IMAGELIBS "${IMAGELIBS}")
|
||||
set(STATICIMAGELIBS "${IMAGELIBS}")
|
||||
# add "-ldl" or whatever is necessary according to CMake (CMAKE_DL_LIBS)
|
||||
if (HAVE_DLSYM)
|
||||
foreach (LIB ${CMAKE_DL_LIBS})
|
||||
list (APPEND FLTK_LDLIBS "-l${LIB}")
|
||||
endforeach ()
|
||||
endif (HAVE_DLSYM)
|
||||
|
||||
#######################################################################
|
||||
set(CC ${CMAKE_C_COMPILER})
|
||||
set(CXX ${CMAKE_CXX_COMPILER})
|
||||
# Set variables for fltk-config (generated from fltk-config.in)
|
||||
#######################################################################
|
||||
|
||||
set(ARCHFLAGS ${OPTION_ARCHFLAGS})
|
||||
# Variables in fltk-config.in (@VAR@) are used in configure(.ac)
|
||||
# and in CMake so their names and usage must be synchronized.
|
||||
# CMake generates two instances of fltk-config, one that can be used
|
||||
# directly in the build tree (see export.cmake) and one that is copied
|
||||
# to the installation directory (see install.cmake). Common variables
|
||||
# should be set here, whereas variables with different values should
|
||||
# be set in install.cmake or export.cmake, respectively.
|
||||
|
||||
if (WIN32)
|
||||
set (LDFLAGS "${CMAKE_EXE_LINKER_FLAGS} -mwindows")
|
||||
endif ()
|
||||
|
||||
set (IMAGELIBS)
|
||||
set (STATICIMAGELIBS)
|
||||
|
||||
if (FLTK_BUILTIN_JPEG_FOUND)
|
||||
list (APPEND IMAGELIBS -lfltk_jpeg)
|
||||
list (APPEND STATICIMAGELIBS \$libdir/libfltk_jpeg.a)
|
||||
else ()
|
||||
if (LIB_jpeg)
|
||||
list (APPEND IMAGELIBS -ljpeg)
|
||||
list (APPEND STATICIMAGELIBS -ljpeg)
|
||||
endif (LIB_jpeg)
|
||||
endif (FLTK_BUILTIN_JPEG_FOUND)
|
||||
|
||||
if (FLTK_BUILTIN_PNG_FOUND)
|
||||
list (APPEND IMAGELIBS -lfltk_png)
|
||||
list (APPEND STATICIMAGELIBS \$libdir/libfltk_png.a)
|
||||
else ()
|
||||
if (LIB_png)
|
||||
list (APPEND IMAGELIBS -lpng)
|
||||
list (APPEND STATICIMAGELIBS -lpng)
|
||||
endif (LIB_png)
|
||||
endif (FLTK_BUILTIN_PNG_FOUND)
|
||||
|
||||
if (FLTK_BUILTIN_ZLIB_FOUND)
|
||||
list (APPEND IMAGELIBS -lfltk_z)
|
||||
list (APPEND STATICIMAGELIBS \$libdir/libfltk_z.a)
|
||||
else ()
|
||||
if (LIB_zlib)
|
||||
list (APPEND IMAGELIBS -lz)
|
||||
list (APPEND STATICIMAGELIBS -lz)
|
||||
endif (LIB_zlib)
|
||||
endif (FLTK_BUILTIN_ZLIB_FOUND)
|
||||
|
||||
string (REPLACE ";" " " IMAGELIBS "${IMAGELIBS}")
|
||||
string (REPLACE ";" " " STATICIMAGELIBS "${STATICIMAGELIBS}")
|
||||
|
||||
#######################################################################
|
||||
set (CC ${CMAKE_C_COMPILER})
|
||||
set (CXX ${CMAKE_CXX_COMPILER})
|
||||
|
||||
set (ARCHFLAGS ${OPTION_ARCHFLAGS})
|
||||
|
||||
string(TOUPPER "${CMAKE_BUILD_TYPE}" BUILD_UPPER)
|
||||
if(${BUILD_UPPER})
|
||||
set(CFLAGS "${CMAKE_C_FLAGS_${BUILD_UPPER}} ${CFLAGS}")
|
||||
endif(${BUILD_UPPER})
|
||||
if (${BUILD_UPPER})
|
||||
set (CFLAGS "${CMAKE_C_FLAGS_${BUILD_UPPER}} ${CFLAGS}")
|
||||
endif (${BUILD_UPPER})
|
||||
|
||||
set(CFLAGS "${OPTION_OPTIM} ${CMAKE_C_FLAGS} ${CFLAGS}")
|
||||
foreach(arg ${FLTK_CFLAGS})
|
||||
set(CFLAGS "${CFLAGS} ${arg}")
|
||||
endforeach(arg ${FLTK_CFLAGS})
|
||||
set (CFLAGS "${OPTION_OPTIM} ${CMAKE_C_FLAGS} ${CFLAGS}")
|
||||
foreach (arg ${FLTK_CFLAGS})
|
||||
set (CFLAGS "${CFLAGS} ${arg}")
|
||||
endforeach (arg ${FLTK_CFLAGS})
|
||||
|
||||
set(CXXFLAGS ${CFLAGS})
|
||||
set (CXXFLAGS "${CFLAGS}")
|
||||
|
||||
foreach(arg ${FLTK_LDLIBS})
|
||||
set(LINK_LIBS "${LINK_LIBS} ${arg}")
|
||||
endforeach(arg ${FLTK_LDLIBS})
|
||||
foreach (arg ${FLTK_LDLIBS})
|
||||
set (LINK_LIBS "${LINK_LIBS} ${arg}")
|
||||
endforeach (arg ${FLTK_LDLIBS})
|
||||
|
||||
set(LIBS ${LINK_LIBS})
|
||||
set (LIBS "${LINK_LIBS}")
|
||||
|
||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "AIX")
|
||||
set(SHAREDSUFFIX "_s")
|
||||
set (SHAREDSUFFIX "_s")
|
||||
else ()
|
||||
set(SHAREDSUFFIX "")
|
||||
set (SHAREDSUFFIX "")
|
||||
endif (${CMAKE_SYSTEM_NAME} STREQUAL "AIX")
|
||||
|
||||
if (DEBUG_VARIABLES_CMAKE)
|
||||
message (STATUS "") # empty line
|
||||
fl_debug_var (HAVE_DLSYM)
|
||||
fl_debug_var (CMAKE_DL_LIBS)
|
||||
fl_debug_var (CMAKE_EXE_LINKER_FLAGS)
|
||||
fl_debug_var (LDFLAGS)
|
||||
fl_debug_var (LIBS)
|
||||
fl_debug_var (GLLIBS)
|
||||
fl_debug_var (IMAGELIBS)
|
||||
fl_debug_var (STATICIMAGELIBS)
|
||||
fl_debug_var (FLTK_LDLIBS)
|
||||
fl_debug_var (LIB_jpeg)
|
||||
fl_debug_var (LIB_png)
|
||||
fl_debug_var (LIB_zlib)
|
||||
message (STATUS "[** end of variables.cmake **]")
|
||||
endif (DEBUG_VARIABLES_CMAKE)
|
||||
unset (DEBUG_VARIABLES_CMAKE)
|
||||
|
||||
+126
-31
@@ -1,49 +1,109 @@
|
||||
#
|
||||
# "$Id$"
|
||||
#
|
||||
# Main CMakeLists.txt to build the FLTK project using CMake (www.cmake.org)
|
||||
# Written by Michael Surette
|
||||
#
|
||||
# Copyright 1998-2016 by Bill Spitzak and others.
|
||||
# Copyright 1998-2021 by Bill Spitzak and others.
|
||||
#
|
||||
# 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
|
||||
# https://www.fltk.org/COPYING.php
|
||||
#
|
||||
# Please report all bugs and problems on the following page:
|
||||
# Please see the following page on how to report bugs and issues:
|
||||
#
|
||||
# http://www.fltk.org/str.php
|
||||
# https://www.fltk.org/bugs.php
|
||||
#
|
||||
|
||||
# Prevent annoying warning under Cygwin; this must be before project().
|
||||
# Remove when CMake >= 2.8.4 is required
|
||||
set(CMAKE_LEGACY_CYGWIN_WIN32 0)
|
||||
|
||||
project(FLTK)
|
||||
cmake_minimum_required(VERSION 2.6.3)
|
||||
|
||||
#######################################################################
|
||||
# define some functions and macros
|
||||
# set CMake minimum version (must be before `project()`
|
||||
#######################################################################
|
||||
include(CMake/FLTK-Functions.cmake)
|
||||
include(CMake/macros.cmake)
|
||||
|
||||
# Note: previous (1.3.5) minimum version
|
||||
# cmake_minimum_required (VERSION 2.6.3)
|
||||
|
||||
# Note: minimum CMake version required by GNUInstallDirs
|
||||
# cmake_minimum_required (VERSION 2.8.4)
|
||||
|
||||
# Minimum CMake version required by FLTK 1.4 (06/2020, work in progress)
|
||||
cmake_minimum_required (VERSION 3.2.3 FATAL_ERROR)
|
||||
|
||||
#######################################################################
|
||||
|
||||
# Use "legacy mode" of FindOpenGL (avoid CMake developer warning).
|
||||
# Note: we're using FindOpenGL with `OPENGL_LIBRARIES` and not (yet)
|
||||
# the `OpenGL::GL` target. This may be changed in the future.
|
||||
# See https://cmake.org/cmake/help/latest/policy/CMP0072.html
|
||||
# Update Feb 28, 2021: To avoid a warning about "OLD" policies we set
|
||||
# OpenGL_GL_PREFERENCE directly to "LEGACY" (other option: "GLVND").
|
||||
|
||||
# if (POLICY CMP0072)
|
||||
# cmake_policy (SET CMP0072 OLD)
|
||||
# endif ()
|
||||
|
||||
set (OpenGL_GL_PREFERENCE LEGACY)
|
||||
|
||||
#######################################################################
|
||||
# define the FLTK project and version
|
||||
#######################################################################
|
||||
|
||||
project (FLTK VERSION 1.3.6)
|
||||
|
||||
#######################################################################
|
||||
# include macro definitions of generally used macros
|
||||
#######################################################################
|
||||
|
||||
include (CMake/fl_debug_var.cmake)
|
||||
include (CMake/fl_add_library.cmake)
|
||||
|
||||
if (false)
|
||||
fl_debug_var (FLTK_VERSION_MAJOR)
|
||||
fl_debug_var (FLTK_VERSION_MINOR)
|
||||
fl_debug_var (FLTK_VERSION_PATCH)
|
||||
fl_debug_var (FLTK_VERSION)
|
||||
endif (false)
|
||||
|
||||
#######################################################################
|
||||
# basic setup
|
||||
#######################################################################
|
||||
include(CMake/setup.cmake)
|
||||
include (CMake/setup.cmake)
|
||||
|
||||
#######################################################################
|
||||
# check for headers, libraries and functions
|
||||
#######################################################################
|
||||
include(CMake/resources.cmake)
|
||||
include (CMake/resources.cmake)
|
||||
|
||||
#######################################################################
|
||||
# options
|
||||
#######################################################################
|
||||
include(CMake/options.cmake)
|
||||
include (CMake/options.cmake)
|
||||
|
||||
#######################################################################
|
||||
# print (debug) several build variables and options
|
||||
#######################################################################
|
||||
|
||||
set (debug_build 0) # set to 1 to show debug info
|
||||
|
||||
if (debug_build)
|
||||
message ("")
|
||||
message (STATUS "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt: set debug_build to 0 to disable the following info:")
|
||||
fl_debug_var (WIN32)
|
||||
fl_debug_var (MINGW)
|
||||
fl_debug_var (CYGWIN)
|
||||
fl_debug_var (MSVC)
|
||||
fl_debug_var (UNIX)
|
||||
fl_debug_var (APPLE)
|
||||
fl_debug_var (ANDROID)
|
||||
fl_debug_var (CMAKE_BUILD_TYPE)
|
||||
fl_debug_var (CMAKE_SIZEOF_VOID_P)
|
||||
fl_debug_var (OPTION_OPTIM)
|
||||
fl_debug_var (CMAKE_C_FLAGS)
|
||||
fl_debug_var (CMAKE_CXX_FLAGS)
|
||||
fl_debug_var (CMAKE_EXE_LINKER_FLAGS)
|
||||
message (STATUS "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt: end of debug_build info.")
|
||||
endif (debug_build)
|
||||
|
||||
unset (debug_build)
|
||||
|
||||
#######################################################################
|
||||
# variables shared by export and install
|
||||
@@ -51,27 +111,62 @@ include(CMake/options.cmake)
|
||||
# install.cmake creates these files for an installed FLTK
|
||||
# these two would only differ in paths, so common variables are set here
|
||||
#######################################################################
|
||||
include(CMake/variables.cmake)
|
||||
include (CMake/variables.cmake)
|
||||
|
||||
#######################################################################
|
||||
# final config and export
|
||||
#######################################################################
|
||||
include(CMake/export.cmake)
|
||||
include (CMake/export.cmake)
|
||||
|
||||
configure_file(
|
||||
${FLTK_SOURCE_DIR}/abi-version.cmake.in
|
||||
${FLTK_BINARY_DIR}/FL/abi-version.h
|
||||
@ONLY
|
||||
)
|
||||
configure_file (
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/abi-version.cmake.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/FL/abi-version.h
|
||||
@ONLY
|
||||
)
|
||||
|
||||
#######################################################################
|
||||
# build examples - these have to be built after fluid is built/imported
|
||||
# options to build test/demo and example programs
|
||||
#######################################################################
|
||||
if(OPTION_BUILD_EXAMPLES)
|
||||
add_subdirectory(test)
|
||||
endif(OPTION_BUILD_EXAMPLES)
|
||||
|
||||
if (FLTK_BUILD_TEST)
|
||||
add_subdirectory (test)
|
||||
endif (FLTK_BUILD_TEST)
|
||||
|
||||
if (FLTK_BUILD_EXAMPLES)
|
||||
add_subdirectory (examples)
|
||||
endif (FLTK_BUILD_EXAMPLES)
|
||||
|
||||
#######################################################################
|
||||
# installation
|
||||
#######################################################################
|
||||
include(CMake/install.cmake)
|
||||
include (CMake/install.cmake)
|
||||
|
||||
#######################################################################
|
||||
# Output Configuration Summary
|
||||
#######################################################################
|
||||
|
||||
include (FeatureSummary)
|
||||
|
||||
message ("")
|
||||
feature_summary (WHAT ALL DESCRIPTION "Configuration Summary --\n")
|
||||
|
||||
message (STATUS "Static libraries will be written to ${CMAKE_CURRENT_BINARY_DIR}/lib")
|
||||
|
||||
if (OPTION_BUILD_SHARED_LIBS)
|
||||
message (STATUS "Shared libraries will be written to ${CMAKE_CURRENT_BINARY_DIR}/lib")
|
||||
else ()
|
||||
message (STATUS "Shared libraries will not be built (set OPTION_BUILD_SHARED_LIBS=ON to build)")
|
||||
endif ()
|
||||
|
||||
if (FLTK_BUILD_TEST)
|
||||
message (STATUS "Test programs will be written to ${CMAKE_CURRENT_BINARY_DIR}/bin/test")
|
||||
endif ()
|
||||
|
||||
if (FLTK_BUILD_EXAMPLES)
|
||||
message (STATUS "Example programs will be written to ${CMAKE_CURRENT_BINARY_DIR}/bin/examples")
|
||||
else ()
|
||||
message (STATUS "Example programs will not be built (set FLTK_BUILD_EXAMPLES=ON to build)")
|
||||
endif ()
|
||||
|
||||
message ("")
|
||||
message (STATUS "End of Configuration Summary --\n")
|
||||
|
||||
+3
-3
@@ -9,15 +9,15 @@ SET (DROP_LOCATION "/cgi-bin/HTTPUploadDartFile.cgi")
|
||||
SET (TRIGGER_SITE "http://${DROP_SITE}/cgi-bin/Submit-Fltk-TestingResults.pl")
|
||||
|
||||
# Project Home Page
|
||||
SET (PROJECT_URL "http://www.fltk.org")
|
||||
SET (PROJECT_URL "https://www.fltk.org")
|
||||
|
||||
# Dart server configuration
|
||||
# Dart server configuration
|
||||
SET (ROLLUP_URL "http://${DROP_SITE}/cgi-bin/fltk-rollup-dashboard.sh")
|
||||
SET (CVS_WEB_URL "http://cvs.sourceforge.net/viewcvs.py/fltk/fltk/")
|
||||
SET (CVS_WEB_CVSROOT "fltk")
|
||||
|
||||
SET (USE_GNATS "On")
|
||||
SET (GNATS_WEB_URL "http://www.fltk.org/str.php")
|
||||
SET (GNATS_WEB_URL "https://www.fltk.org/bugs.php")
|
||||
|
||||
# Continuous email delivery variables
|
||||
SET (CONTINUOUS_FROM "fltk-dashboard@public.kitware.com")
|
||||
|
||||
+5
-12
@@ -1,19 +1,17 @@
|
||||
#
|
||||
# "$Id$"
|
||||
# Header Makefile for the Fast Light Tool Kit (FLTK).
|
||||
#
|
||||
# Header makefile for the Fast Light Tool Kit (FLTK).
|
||||
#
|
||||
# Copyright 1998-2010 by Bill Spitzak and others.
|
||||
# Copyright 1998-2021 by Bill Spitzak and others.
|
||||
#
|
||||
# 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
|
||||
# https://www.fltk.org/COPYING.php
|
||||
#
|
||||
# Please report all bugs and problems on the following page:
|
||||
# Please see the following page on how to report bugs and issues:
|
||||
#
|
||||
# http://www.fltk.org/str.php
|
||||
# https://www.fltk.org/bugs.php
|
||||
#
|
||||
|
||||
include ../makeinclude
|
||||
@@ -47,8 +45,3 @@ uninstall:
|
||||
echo "Uninstalling include files..."
|
||||
$(RMDIR) $(DESTDIR)$(includedir)/FL
|
||||
@HLINKS@ $(RM) $(DESTDIR)$(includedir)/Fl
|
||||
|
||||
|
||||
#
|
||||
# End of "$Id$".
|
||||
#
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
#
|
||||
# "$Id$"
|
||||
# Top-level Makefile for the Fast Light Tool Kit (FLTK).
|
||||
#
|
||||
# Top-level makefile for the Fast Light Tool Kit (FLTK).
|
||||
#
|
||||
# Copyright 1998-2010 by Bill Spitzak and others.
|
||||
# Copyright 1998-2021 by Bill Spitzak and others.
|
||||
#
|
||||
# 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
|
||||
# https://www.fltk.org/COPYING.php
|
||||
#
|
||||
# Please report all bugs and problems on the following page:
|
||||
# Please see the following page on how to report bugs and issues:
|
||||
#
|
||||
# http://www.fltk.org/str.php
|
||||
# https://www.fltk.org/bugs.php
|
||||
#
|
||||
|
||||
include makeinclude
|
||||
@@ -80,6 +78,8 @@ distclean: clean
|
||||
$(RM) test/`basename $$file .fl`.cxx; \
|
||||
$(RM) test/`basename $$file .fl`.h; \
|
||||
done
|
||||
$(RM) -rf autom4te.cache/
|
||||
$(RM) configure
|
||||
|
||||
fltk-config: configure configh.in fltk-config.in
|
||||
if test -f config.status; then \
|
||||
@@ -129,8 +129,3 @@ clang:
|
||||
scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) clean all
|
||||
clang-changes:
|
||||
scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) all
|
||||
|
||||
|
||||
#
|
||||
# End of "$Id$".
|
||||
#
|
||||
|
||||
+227
-62
@@ -5,17 +5,19 @@ README.CMake.txt - Building and using FLTK with CMake
|
||||
CONTENTS
|
||||
==========
|
||||
|
||||
1 Introduction to CMake
|
||||
2 Using CMake to Build FLTK
|
||||
1 Introduction to CMake
|
||||
2 Using CMake to Build FLTK
|
||||
2.1 Prerequisites
|
||||
2.2 Options
|
||||
2.3 Building under Linux with Unix Makefiles
|
||||
2.4 Building under Windows with MinGW using Makefiles
|
||||
2.5 Crosscompiling
|
||||
3 Using CMake with FLTK
|
||||
2.4 Building under Windows with Visual Studio
|
||||
2.5 Building under Windows with MinGW using Makefiles
|
||||
2.6 Building under MacOS with Xcode
|
||||
2.7 Crosscompiling
|
||||
3 Using CMake with FLTK
|
||||
3.1 Library Names
|
||||
3.2 Using Fluid Files
|
||||
4 Document History
|
||||
4 Document History
|
||||
|
||||
|
||||
1. INTRODUCTION TO CMAKE
|
||||
@@ -59,7 +61,7 @@ More information on CMake can be found on its web site http://www.cmake.org.
|
||||
--------------------
|
||||
|
||||
The prerequisites for building FLTK with CMake are staightforward:
|
||||
CMake 2.6.3 or later and a recent FLTK 1.3 release, snapshot, or subversion
|
||||
CMake 3.2.3 or later and a recent FLTK 1.3 release, snapshot, or Git
|
||||
download (working copy). Installation of CMake is covered on its web site.
|
||||
|
||||
This howto will cover building FLTK with the default options using CMake
|
||||
@@ -93,54 +95,59 @@ CMAKE_INSTALL_PREFIX
|
||||
The following are the FLTK specific options. Platform specific options
|
||||
are ignored on other platforms.
|
||||
|
||||
OPTION_OPTIM
|
||||
Extra optimization flags.
|
||||
OPTION_OPTIM - default EMPTY
|
||||
Extra optimization flags for the C and C++ compilers, for instance
|
||||
"-Wall -Wno-deprecated-declarations".
|
||||
|
||||
OPTION_ARCHFLAGS
|
||||
OPTION_ARCHFLAGS - default EMPTY
|
||||
Extra architecture flags.
|
||||
|
||||
OPTION_APPLE_X11 - default OFF
|
||||
In case you want to use X11 on OSX.
|
||||
In case you want to use X11 on macOS.
|
||||
Use this only if you know what you do, and if you have installed X11.
|
||||
|
||||
OPTION_USE_POLL - default OFF
|
||||
Don't use this one either.
|
||||
Don't use this one, it is deprecated.
|
||||
|
||||
OPTION_BUILD_SHARED_LIBS - default OFF
|
||||
Normally FLTK is built as static libraries which makes more portable
|
||||
binaries. If you want to use shared libraries, this will build them too.
|
||||
|
||||
OPTION_BUILD_EXAMPLES - default ON
|
||||
Builds the many fine example programs.
|
||||
FLTK_BUILD_TEST - default ON
|
||||
Builds the test and demo programs in the 'test' directory.
|
||||
|
||||
FLTK_BUILD_EXAMPLES - default OFF
|
||||
Builds the example programs in the 'examples' directory.
|
||||
|
||||
OPTION_CAIRO - default OFF
|
||||
Enables libcairo support
|
||||
Enables libcairo support - see README.Cairo.txt.
|
||||
|
||||
OPTION_CAIROEXT - default OFF
|
||||
Enables extended libcairo support
|
||||
Enables extended libcairo support - see README.Cairo.txt.
|
||||
|
||||
OPTION_USE_GL - default ON
|
||||
Enables OpenGL support
|
||||
Enables OpenGL support.
|
||||
|
||||
OPTION_USE_THREADS - default ON
|
||||
Enables multithreaded support
|
||||
Enables multithreaded support.
|
||||
|
||||
OPTION_LARGE_FILE - default ON
|
||||
Enables large file (>2G) support
|
||||
Enables large file (>2G) support.
|
||||
|
||||
OPTION_USE_SYSTEM_LIBJPEG - default ON
|
||||
OPTION_USE_SYSTEM_ZLIB - default ON
|
||||
OPTION_USE_SYSTEM_LIBPNG - default ON
|
||||
FLTK has built in jpeg, zlib, and png libraries. These let you use
|
||||
system libraries instead, unless CMake can't find them. If you set
|
||||
FLTK has built in jpeg, zlib, and png libraries. These options let you
|
||||
use system libraries instead, unless CMake can't find them. If you set
|
||||
any of these options to OFF, then the built in library will be used.
|
||||
|
||||
OPTION_USE_XINERAMA - default ON
|
||||
OPTION_USE_XFT - default ON
|
||||
OPTION_USE_XDBE - default ON
|
||||
OPTION_USE_XCURSOR - default ON
|
||||
OPTION_USE_XRENDER - default ON
|
||||
These are X11 extended libraries.
|
||||
OPTION_USE_XFT - default ON
|
||||
OPTION_USE_XDBE - default ON
|
||||
OPTION_USE_XCURSOR - default ON
|
||||
OPTION_USE_XRENDER - default ON
|
||||
These are X11 extended libraries. These libs are used if found on the
|
||||
build system unless the respective option is turned off.
|
||||
|
||||
OPTION_ABI_VERSION - default EMPTY
|
||||
Use a numeric value corresponding to the FLTK ABI version you want to
|
||||
@@ -152,10 +159,26 @@ OPTION_ABI_VERSION - default EMPTY
|
||||
ABI version to select.
|
||||
|
||||
|
||||
Documentation options: these options are only available if `doxygen' is
|
||||
installed and found by CMake. PDF related options require also `latex'.
|
||||
|
||||
OPTION_BUILD_HTML_DOCUMENTATION - default ON
|
||||
OPTION_BUILD_PDF_DOCUMENTATION - default ON
|
||||
These options can be used to switch HTML documentation generation with
|
||||
doxygen on. The build targets ('html', 'pdf', or 'docs') need still to
|
||||
be executed explicitly.
|
||||
|
||||
OPTION_INSTALL_HTML_DOCUMENTATION - default OFF
|
||||
OPTION_INSTALL_PDF_DOCUMENTATION - default OFF
|
||||
If these options are ON then the HTML and/or PDF docs get installed
|
||||
when the 'install' target is executed, e.g. with `make install'. You
|
||||
need to select above options OPTION_BUILD_*_DOCUMENTATION as well.
|
||||
|
||||
|
||||
2.3 Building under Linux with Unix Makefiles
|
||||
-----------------------------------------------
|
||||
|
||||
After untaring the FLTK source, go to the root of the FLTK tree and type
|
||||
After unpacking the FLTK source, go to the root of the FLTK tree and type
|
||||
the following.
|
||||
|
||||
mkdir build
|
||||
@@ -164,6 +187,9 @@ the following.
|
||||
make
|
||||
sudo make install (optional)
|
||||
|
||||
IMPORTANT: The trailing ".." on the cmake command must be specified
|
||||
(it is NOT an ellipsis). ^^^^^^^^^^^^^^^^^
|
||||
|
||||
This will build and install a default configuration FLTK.
|
||||
|
||||
Some flags can be changed during the 'make' command, such as:
|
||||
@@ -173,19 +199,88 @@ Some flags can be changed during the 'make' command, such as:
|
||||
..which builds in verbose mode, so you can see all the compile/link commands.
|
||||
|
||||
Hint: if you intend to build several different versions of FLTK, e.g. a Debug
|
||||
and a Release version, or multiple libraries with different ABI versions,
|
||||
then use subdirectories in the build directory, like this:
|
||||
and a Release version, or multiple libraries with different ABI versions or
|
||||
options, then use subdirectories in the build directory, like this:
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
mkdir Debug
|
||||
cd Debug
|
||||
cmake ../..
|
||||
cmake -D 'CMAKE_BUILD_TYPE=Debug' ../..
|
||||
make
|
||||
sudo make install (optional)
|
||||
|
||||
|
||||
2.4 Building under Windows with MinGW using Makefiles
|
||||
2.4 Building under Windows with Visual Studio
|
||||
------------------------------------------------
|
||||
|
||||
Building with CMake under Visual Studio requires the CMake generator with
|
||||
the -G command line switch, or the generator can be selected interactively
|
||||
in the GUI (cmake-gui).
|
||||
|
||||
2.4.1 Visual Studio 7 / .NET
|
||||
------------------------------
|
||||
|
||||
1) Open a "Visual Studio .NET command prompt" window, e.g.
|
||||
|
||||
Start > All Programs > Microsoft Visual Studio .NET >
|
||||
Visual Studio .NET Tools > Command Prompt
|
||||
|
||||
2) In the DOS window created above, change the current directory
|
||||
to where you've extracted an fltk distribution tar file (or
|
||||
snapshot tar file), and run the following commands:
|
||||
|
||||
cd C:\fltk-1.3.x <-- change to your FLTK directory
|
||||
mkdir build <-- create an empty directory
|
||||
cd build
|
||||
cmake -G "Visual Studio 7" -D CMAKE_BUILD_TYPE=Release ..
|
||||
|
||||
IMPORTANT: The trailing ".." on the cmake command must be specified
|
||||
(it is NOT an ellipsis). ^^^^^^^^^^^^^^^^^
|
||||
|
||||
This will create the file FLTK.sln in the current 'build' directory.
|
||||
|
||||
3) Open Visual Studio 7, and choose File -> Open -> Project,
|
||||
and pick the "FLTK.sln" created by step #2 in the 'build' directory.
|
||||
|
||||
(Or, if only one version of the Visual Studio compiler is installed,
|
||||
you can just run from DOS: .\FLTK.sln)
|
||||
|
||||
4) Make sure the pulldown menu has either "Release" or "Debug" selected
|
||||
in the "Solution Configurations" pulldown menu.
|
||||
|
||||
5) In the "Solution Explorer", right click on:
|
||||
|
||||
Solution 'FLTK' (## projects)
|
||||
|
||||
..and in the popup menu, choose "Build Solution"
|
||||
|
||||
5) That's it, that should build FLTK.
|
||||
|
||||
The test programs (*.exe) can be found in e.g.
|
||||
|
||||
Release: C:\fltk-1.3.x\build\bin\examples\release\*.exe
|
||||
Debug: C:\fltk-1.3.x\build\bin\examples\debug\*.exe
|
||||
|
||||
..and the FLTK include files (*.H & *.h) your own apps can
|
||||
compile with can be found in:
|
||||
|
||||
Release & Debug: C:\fltk-1.3.x\build\FL
|
||||
*and* [1] in: C:\fltk-1.3.x\FL
|
||||
|
||||
..and the FLTK library files (*.lib) which your own apps can
|
||||
link with can be found in:
|
||||
|
||||
Release: C:\fltk-1.3.x\build\lib\release\*.lib
|
||||
Debug: C:\fltk-1.3.x\build\lib\debug\*.lib
|
||||
|
||||
[1] If you want to build your own FLTK application directly using
|
||||
the build directories (i.e. without "installation") you need
|
||||
to include both the build tree (first) and then the FLTK source
|
||||
tree in the compiler's header search list.
|
||||
|
||||
|
||||
2.5 Building under Windows with MinGW using Makefiles
|
||||
--------------------------------------------------------
|
||||
|
||||
Building with CMake under MinGW requires you to specify the CMake Generator
|
||||
@@ -203,40 +298,101 @@ use your MinGW PATH to find the compilers and build tools. Example:
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -G "Unix Makefiles" ..
|
||||
cmake -G "Unix Makefiles" -D 'CMAKE_BUILD_TYPE=Debug' ..
|
||||
|
||||
Note the path to FLTK ".." in the last command line. Depending on where you
|
||||
installed CMake you may need to adjust the path's in the alias commands.
|
||||
|
||||
|
||||
2.5 Crosscompiling
|
||||
2.6 Building under MacOS with Xcode
|
||||
------------------------------------
|
||||
|
||||
Building with CMake under Xcode requires the CMake generator
|
||||
with the -G command line switch. This step need to be done only once. If any
|
||||
of the cmake related files are updated, Xcode will rerun cmake for you.
|
||||
|
||||
1) Open the MacOS Terminal
|
||||
|
||||
2) Change to the directory containing the FLTK project. For example:
|
||||
> cd ~/dev/fltk-1.3.x
|
||||
|
||||
3) Create a build directory
|
||||
> mkdir build
|
||||
> cd build
|
||||
|
||||
4) If you plan different build versions, it is useful to create another
|
||||
subdirectory level
|
||||
> mkdir Xcode
|
||||
> cd Xcode
|
||||
|
||||
5) Let CMake create the required IDE files
|
||||
> cmake -G Xcode ../..
|
||||
This step should end in the message:
|
||||
-- Build files have been written to: .../dev/fltk-1.3.x/build/Xcode
|
||||
|
||||
5a) To build the Release version of FLTK, use
|
||||
> cmake -G Xcode -D CMAKE_BUILD_TYPE=Release ../..
|
||||
|
||||
5b) To create all included libraries instead of using those that come
|
||||
with MacOS, use:
|
||||
> cmake -G Xcode -D OPTION_USE_SYSTEM_LIBJPEG=Off \
|
||||
-D OPTION_USE_SYSTEM_ZLIB=Off \
|
||||
-D OPTION_USE_SYSTEM_LIBPNG=Off \
|
||||
../..
|
||||
|
||||
6) Launch Xcode from the Finder or from the Terminal:
|
||||
> open ./FLTK.xcodeproj
|
||||
When Xcode starts, it asks if it should "Autocreate Schemes". Click on
|
||||
"Automatically Create Schemes" to confirm.
|
||||
|
||||
7) To build and test FLTK, select the scheme "ALL_BUILD" and hit Cmd-B to
|
||||
build. Then select the scheme "demo" and hit Cmd-R to run the FLTK Demo.
|
||||
|
||||
8) The interactive user interface tool "Fluid" will be located in
|
||||
build/Xcode/bin/Debug. The example apps are in .../bin/examples/Debug.
|
||||
Static libraries are in .../lib/Debug/
|
||||
|
||||
9) The "install" Scheme currently fails because it is run with user permission.
|
||||
|
||||
|
||||
2.7 Crosscompiling
|
||||
---------------------
|
||||
|
||||
Once you have a crosscompiler going, to use CMake to build FLTK you need
|
||||
two more things. You need a toolchain file which tells CMake where your
|
||||
build tools are. The CMake website is a good source of information on
|
||||
this file. Here's mine for MinGW under Linux.
|
||||
this file. Here's one for MinGW (64-bit) under Linux.
|
||||
|
||||
----
|
||||
# CMake Toolchain File for MinGW-w64 (64-bit) Cross Compilation
|
||||
|
||||
# the name of the target operating system
|
||||
set(CMAKE_SYSTEM_NAME Windows)
|
||||
|
||||
# which tools to use
|
||||
set(CMAKE_C_COMPILER /usr/bin/i486-mingw32-gcc)
|
||||
set(CMAKE_CXX_COMPILER /usr/bin/i486-mingw32-g++)
|
||||
set(CMAKE_C_COMPILER /usr/bin/x86_64-w64-mingw32-gcc)
|
||||
set(CMAKE_CXX_COMPILER /usr/bin/x86_64-w64-mingw32-g++)
|
||||
set(CMAKE_RC_COMPILER /usr/bin/x86_64-w64-mingw32-windres)
|
||||
|
||||
# here is where the target environment located
|
||||
set(CMAKE_FIND_ROOT_PATH /usr/i486-mingw32)
|
||||
set(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32)
|
||||
|
||||
# adjust the default behavior of the FIND_XXX() commands:
|
||||
|
||||
# adjust the default behaviour of the FIND_XXX() commands:
|
||||
# search programs in the host environment
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
# search headers and libraries in the target environment,
|
||||
|
||||
# search headers and libraries in the target environment
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
|
||||
set(CMAKE_INSTALL_PREFIX ${CMAKE_FIND_ROOT_PATH}/usr CACHE FILEPATH
|
||||
"install path prefix")
|
||||
|
||||
# initialize required linker flags
|
||||
set(CMAKE_EXE_LINKER_FLAGS_INIT "-static-libgcc -static-libstdc++")
|
||||
|
||||
# end of toolchain file
|
||||
----
|
||||
|
||||
Not too tough. The other thing you need is a native installation of FLTK
|
||||
@@ -251,9 +407,14 @@ So, again from the FLTK tree root.
|
||||
make
|
||||
sudo make install
|
||||
|
||||
This will create a default configuration FLTK suitable for mingw/msys and
|
||||
install it in the /usr/i486-mingw32/usr tree.
|
||||
IMPORTANT: The trailing ".." on the cmake command must be specified
|
||||
(it is NOT an ellipsis). ^^^^^^^^^^^^^^^^^
|
||||
|
||||
This will create a default configuration FLTK suitable for mingw/msys and
|
||||
install it in the /usr/x86_64-w64-mingw32/usr tree.
|
||||
|
||||
Note: replace 'x86_64-w64-mingw32' with your cross toolchain location as
|
||||
required.
|
||||
|
||||
|
||||
3. Using CMake with FLTK
|
||||
@@ -273,7 +434,7 @@ Here is a basic CMakeLists.txt file using FLTK.
|
||||
|
||||
------
|
||||
|
||||
cmake_minimum_required(VERSION 2.6.3)
|
||||
cmake_minimum_required(VERSION 3.2.3)
|
||||
|
||||
project(hello)
|
||||
|
||||
@@ -290,10 +451,12 @@ set(FLTK_DIR /path/to/fltk)
|
||||
|
||||
find_package(FLTK REQUIRED NO_MODULE)
|
||||
|
||||
include_directories(${FLTK_INCLUDE_DIRS})
|
||||
add_executable(hello WIN32 MACOSX_BUNDLE hello.cxx)
|
||||
if (APPLE)
|
||||
target_link_libraries(hello "-framework cocoa")
|
||||
endif (APPLE)
|
||||
|
||||
add_executable(hello WIN32 hello.cxx)
|
||||
# target_include_directories(hello PUBLIC ${FLTK_INCLUDE_DIRS})
|
||||
target_include_directories(hello PUBLIC ${FLTK_INCLUDE_DIRS})
|
||||
|
||||
target_link_libraries(hello fltk)
|
||||
|
||||
@@ -306,20 +469,20 @@ means that it is an error if it's not found. NO_MODULE tells it to search
|
||||
only for the FLTKConfig file, not using the FindFLTK.cmake supplied with
|
||||
CMake, which doesn't work with this version of FLTK.
|
||||
|
||||
Once the package is found the CMake variable FLTK_INCLUDE_DIRS is defined
|
||||
which can be used to add the FLTK include directories to the definitions
|
||||
used to compile your program. In older CMake versions you may need to use
|
||||
`include_directories()` as shown above. In more recent CMake versions you
|
||||
can use the (commented) `target_include_directories()` command. The latter
|
||||
should be preferred (YMMV, see the CMake docs).
|
||||
|
||||
The WIN32 in the add_executable tells your Windows compiler that this is
|
||||
a Windows GUI app. It is ignored on other platforms and should always be
|
||||
The "WIN32 MACOSX_BUNDLE" in the add_executable tells this is
|
||||
a GUI app. It is ignored on other platforms and should always be
|
||||
present with FLTK GUI programs for better portability.
|
||||
|
||||
Note: the variable ${FLTK_USE_FILE} used to include another file in
|
||||
previous FLTK versions is deprecated since FLTK 1.3.4 and will be removed
|
||||
in FLTK 1.4.0.
|
||||
Once the package is found the CMake variable FLTK_INCLUDE_DIRS is defined
|
||||
which can be used to add the FLTK include directories to the definitions
|
||||
used to compile your program using the `target_include_directories()` command.
|
||||
|
||||
The target_link_libraries() command is used to specify all necessary FLTK
|
||||
libraries. Thus, you may have to add fltk_images, fltk_gl, etc…
|
||||
|
||||
Note: the variable FLTK_USE_FILE used to include another file in
|
||||
previous FLTK versions was deprecated since FLTK 1.3.4 and will be
|
||||
removed in FLTK 1.4.0 or a later version.
|
||||
|
||||
|
||||
3.1 Library Names
|
||||
@@ -363,8 +526,8 @@ include_directories(${FLTK_INCLUDE_DIRS})
|
||||
|
||||
#run fluid -c to generate CubeViewUI.cxx and CubeViewUI.h files
|
||||
add_custom_command(
|
||||
OUTPUT "CubeViewUI.cxx" "CubeViewUI.h"
|
||||
COMMAND fluid -c ${CMAKE_CURRENT_SOURCE_DIR}/CubeViewUI.fl
|
||||
OUTPUT "CubeViewUI.cxx" "CubeViewUI.h"
|
||||
COMMAND fluid -c ${CMAKE_CURRENT_SOURCE_DIR}/CubeViewUI.fl
|
||||
)
|
||||
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
@@ -375,9 +538,9 @@ add_executable(CubeView WIN32 CubeMain.cxx CubeView.cxx CubeViewUI.cxx)
|
||||
target_link_libraries(CubeView fltk fltk_gl)
|
||||
---
|
||||
|
||||
You can repeat the add_custom_command for each fluid file or if you have
|
||||
a large number of them see the CMake/macros.cmake function FLTK_RUN_FLUID
|
||||
for an example of how to run it in a loop.
|
||||
You can repeat the add_custom_command for each fluid file or if you
|
||||
have a large number of them see the CMake/FLTK-Functions.cmake function
|
||||
FLTK_RUN_FLUID for an example of how to run it in a loop.
|
||||
|
||||
The two lines
|
||||
|
||||
@@ -399,3 +562,5 @@ Feb 23 2014 - msurette: updated to reflect changes to the CMake files
|
||||
Apr 07 2015 - AlbrechtS: update use example and more docs
|
||||
Jan 31 2016 - msurette: custom command instead of fltk_wrap_ui
|
||||
Nov 01 2016 - AlbrechtS: remove deprecated FLTK_USE_FILE, add MinGW build
|
||||
Jul 05 2017 - matt: added instructions for MacOS and Xcode
|
||||
Dec 29 2018 - AlbrechtS: add documentation option descriptions
|
||||
|
||||
+9
-10
@@ -1,19 +1,18 @@
|
||||
#
|
||||
# "$Id: Makefile 5667 2007-02-07 02:35:44Z mike $"
|
||||
#
|
||||
# CAIRO library makefile for the Fast Light Toolkit (FLTK).
|
||||
#
|
||||
# Copyright 1997-2009 by Easy Software Products.
|
||||
# Copyright 2010-2021 by Bill Spitzak and others.
|
||||
#
|
||||
# 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
|
||||
# https://www.fltk.org/COPYING.php
|
||||
#
|
||||
# Please report all bugs and problems on the following page:
|
||||
# Please see the following page on how to report bugs and issues:
|
||||
#
|
||||
# http://www.fltk.org/str.php
|
||||
# https://www.fltk.org/bugs.php
|
||||
#
|
||||
|
||||
# Note: see ../configure.in and/or ../makeinclude for definition of
|
||||
@@ -165,10 +164,10 @@ uninstall:
|
||||
$(CAIROOBJECTS): ../makeinclude
|
||||
|
||||
depend: $(CAIROCPPFILES)
|
||||
makedepend -Y -I.. -f makedepend $(CAIROCPPFILES)
|
||||
makedepend -Y -I.. -f makedepend -w 20 $(CAIROCPPFILES)
|
||||
echo "# DO NOT DELETE THIS LINE -- make depend depends on it." > makedepend.tmp
|
||||
echo "" >> makedepend.tmp
|
||||
grep '^[a-zA-Z]' makedepend | ( LC_ALL=C sort -u -f >> makedepend.tmp; )
|
||||
mv makedepend.tmp makedepend
|
||||
|
||||
include makedepend
|
||||
|
||||
#
|
||||
# End of "$Id: Makefile 5667 2007-02-07 02:35:44Z mike $".
|
||||
#
|
||||
|
||||
+15
-6
@@ -1,7 +1,16 @@
|
||||
# DO NOT DELETE
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
Fl_Cairo.o: ../config.h ../FL/Fl.H ../FL/Fl_Export.H ../FL/Fl_Cairo.H
|
||||
Fl_Cairo.o: ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
|
||||
Fl_Cairo.o: ../FL/Enumerations.H ../FL/abi-version.h ../FL/x.H
|
||||
Fl_Cairo.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
|
||||
Fl_Cairo.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Window.H
|
||||
Fl_Cairo.o: ../config.h
|
||||
Fl_Cairo.o: ../FL/abi-version.h
|
||||
Fl_Cairo.o: ../FL/Enumerations.H
|
||||
Fl_Cairo.o: ../FL/Fl.H
|
||||
Fl_Cairo.o: ../FL/Fl_Bitmap.H
|
||||
Fl_Cairo.o: ../FL/Fl_Cairo.H
|
||||
Fl_Cairo.o: ../FL/Fl_Export.H
|
||||
Fl_Cairo.o: ../FL/Fl_Group.H
|
||||
Fl_Cairo.o: ../FL/Fl_Image.H
|
||||
Fl_Cairo.o: ../FL/fl_types.h
|
||||
Fl_Cairo.o: ../FL/fl_utf8.h
|
||||
Fl_Cairo.o: ../FL/Fl_Widget.H
|
||||
Fl_Cairo.o: ../FL/Fl_Window.H
|
||||
Fl_Cairo.o: ../FL/x.H
|
||||
|
||||
+5
-11
@@ -1,20 +1,18 @@
|
||||
/* @CONFIG_H@. Generated from @CONFIG_H_IN@ by CMake. */
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Configuration file for the Fast Light Tool Kit (FLTK).
|
||||
*
|
||||
* Copyright 1998-2016 by Bill Spitzak and others.
|
||||
* Copyright 1998-2021 by Bill Spitzak and others.
|
||||
*
|
||||
* 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
|
||||
* https://www.fltk.org/COPYING.php
|
||||
*
|
||||
* Please report all bugs and problems on the following page:
|
||||
* Please see the following page on how to report bugs and issues:
|
||||
*
|
||||
* http://www.fltk.org/str.php
|
||||
* https://www.fltk.org/bugs.php
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -86,7 +84,7 @@
|
||||
/*
|
||||
* USE_XFT
|
||||
*
|
||||
* Use the new Xft library to draw anti-aliased text.
|
||||
* Use the Xft library to draw anti-aliased text.
|
||||
*/
|
||||
|
||||
#cmakedefine01 USE_XFT
|
||||
@@ -335,7 +333,3 @@
|
||||
|
||||
#cmakedefine01 HAVE_DLFCN_H
|
||||
#cmakedefine01 HAVE_DLSYM
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
|
||||
+20
-9
@@ -380,6 +380,16 @@ else
|
||||
LINKSHARED="$LINKFLTKCAIRO ../lib/libfltk_images.a ../lib/libfltk_forms.a ../lib/libfltk.a"
|
||||
fi
|
||||
|
||||
dnl Define the fluid executable used when building the test programs.
|
||||
dnl In a native build we use the fluid executable created during the build,
|
||||
dnl in a cross-compilation we use `fluid' which must exist on the build system
|
||||
dnl and must be in the PATH, i.e. executable as 'fluid' (w/o $EXEEXT).
|
||||
if test "$fltk_cross_compiling" = "yes"; then
|
||||
FLUID_BUILD="fluid"
|
||||
else
|
||||
FLUID_BUILD="../fluid/fluid$EXEEXT"
|
||||
fi
|
||||
|
||||
AC_SUBST(DSOCOMMAND)
|
||||
AC_SUBST(DSOFLAGS)
|
||||
AC_SUBST(DSOLINK)
|
||||
@@ -391,6 +401,7 @@ AC_SUBST(CAIRODSONAME)
|
||||
AC_SUBST(SHAREDSUFFIX)
|
||||
AC_SUBST(LINKSHARED)
|
||||
AC_SUBST(FLUID)
|
||||
AC_SUBST(FLUID_BUILD)
|
||||
|
||||
AC_ARG_ENABLE(threads, [ --enable-threads enable multi-threading support [[default=yes]]])
|
||||
|
||||
@@ -857,10 +868,10 @@ case $host_os_gui in
|
||||
if test x$enable_gl != xno; then
|
||||
AC_CHECK_HEADER(GL/gl.h,
|
||||
AC_DEFINE(HAVE_GL)
|
||||
GLLIB="-lopengl32")
|
||||
GLLIBS="-lopengl32")
|
||||
AC_CHECK_HEADER(GL/glu.h,
|
||||
AC_DEFINE(HAVE_GL_GLU_H)
|
||||
GLLIB="-lglu32 $GLLIB")
|
||||
GLLIBS="-lglu32 $GLLIBS")
|
||||
else
|
||||
LINKFLTKGL=""
|
||||
GLLIBNAME=""
|
||||
@@ -898,7 +909,7 @@ case $host_os_gui in
|
||||
if test x$enable_gl != xno; then
|
||||
AC_DEFINE(HAVE_GL)
|
||||
AC_DEFINE(HAVE_GL_GLU_H)
|
||||
GLLIB="-framework OpenGL"
|
||||
GLLIBS="-framework OpenGL"
|
||||
else
|
||||
LINKFLTKGL=""
|
||||
GLLIBNAME=""
|
||||
@@ -949,17 +960,17 @@ case $host_os_gui in
|
||||
fi
|
||||
|
||||
dnl Check for OpenGL unless disabled...
|
||||
GLLIB=
|
||||
GLLIBS=
|
||||
|
||||
if test x$enable_gl != xno; then
|
||||
AC_SEARCH_LIBS(dlopen, dl)
|
||||
AC_CHECK_HEADER(GL/gl.h,
|
||||
AC_CHECK_LIB(GL, glXMakeCurrent,
|
||||
[AC_DEFINE(HAVE_GL)
|
||||
GLLIB="-lGL"],
|
||||
GLLIBS="-lGL"],
|
||||
AC_CHECK_LIB(MesaGL, glXMakeCurrent,
|
||||
[AC_DEFINE(HAVE_GL)
|
||||
GLLIB="-lMesaGL"],,
|
||||
GLLIBS="-lMesaGL"],,
|
||||
[-lm]),
|
||||
[-lm])
|
||||
AC_CHECK_LIB(GL, glXGetProcAddressARB,
|
||||
@@ -968,10 +979,10 @@ case $host_os_gui in
|
||||
AC_CHECK_HEADER(GL/glu.h,
|
||||
AC_DEFINE(HAVE_GL_GLU_H)
|
||||
if test x$ac_cv_lib_GL_glXMakeCurrent = xyes; then
|
||||
GLLIB="-lGLU $GLLIB"
|
||||
GLLIBS="-lGLU $GLLIBS"
|
||||
fi
|
||||
if test x$ac_cv_lib_MesaGL_glXMakeCurrent = xyes; then
|
||||
GLLIB="-lMesaGLU $GLLIB"
|
||||
GLLIBS="-lMesaGLU $GLLIBS"
|
||||
fi
|
||||
)
|
||||
|
||||
@@ -1149,7 +1160,7 @@ case $host_os_gui in
|
||||
esac
|
||||
|
||||
AC_SUBST(GLDEMOS)
|
||||
AC_SUBST(GLLIB)
|
||||
AC_SUBST(GLLIBS)
|
||||
AC_SUBST(HLINKS)
|
||||
AC_SUBST(OSX_ONLY)
|
||||
AC_SUBST(THREADS)
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
#
|
||||
# "$Id$"
|
||||
#
|
||||
# CMakeLists.txt to build docs for the FLTK project using CMake (www.cmake.org)
|
||||
#
|
||||
# Copyright 1998-2015 by Bill Spitzak and others.
|
||||
# Copyright 1998-2021 by Bill Spitzak and others.
|
||||
#
|
||||
# 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
|
||||
# https://www.fltk.org/COPYING.php
|
||||
#
|
||||
# Please report all bugs and problems on the following page:
|
||||
# Please see the following page on how to report bugs and issues:
|
||||
#
|
||||
# http://www.fltk.org/str.php
|
||||
# https://www.fltk.org/bugs.php
|
||||
#
|
||||
|
||||
set (DOCS)
|
||||
@@ -22,33 +20,37 @@ set (DOCS)
|
||||
# build html documentation
|
||||
#--------------------------
|
||||
|
||||
if(OPTION_BUILD_HTML_DOCUMENTATION)
|
||||
if (OPTION_BUILD_HTML_DOCUMENTATION)
|
||||
|
||||
list(APPEND DOCS html)
|
||||
list (APPEND DOCS html)
|
||||
|
||||
# generate Doxygen file "Doxyfile"
|
||||
# generate Doxygen file "Doxyfile"
|
||||
|
||||
set(GENERATE_HTML YES)
|
||||
set(GENERATE_LATEX NO)
|
||||
set(LATEX_HEADER "")
|
||||
set (GENERATE_HTML YES)
|
||||
set (GENERATE_LATEX NO)
|
||||
set (LATEX_HEADER "")
|
||||
|
||||
configure_file(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
|
||||
@ONLY
|
||||
)
|
||||
configure_file (
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
|
||||
@ONLY
|
||||
)
|
||||
|
||||
# generate html docs
|
||||
configure_file (
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/tiny.png
|
||||
${CMAKE_CURRENT_BINARY_DIR}/html/tiny.png
|
||||
COPYONLY
|
||||
)
|
||||
|
||||
add_custom_target(html
|
||||
# ALL
|
||||
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
COMMENT "Generating HTML documentation" VERBATIM
|
||||
DEPENDS fltk
|
||||
)
|
||||
# generate html docs
|
||||
|
||||
endif(OPTION_BUILD_HTML_DOCUMENTATION)
|
||||
add_custom_target (html
|
||||
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
COMMENT "Generating HTML documentation" VERBATIM
|
||||
)
|
||||
|
||||
endif (OPTION_BUILD_HTML_DOCUMENTATION)
|
||||
|
||||
#--------------------------
|
||||
# build pdf documentation
|
||||
@@ -56,53 +58,56 @@ endif(OPTION_BUILD_HTML_DOCUMENTATION)
|
||||
|
||||
if (OPTION_BUILD_PDF_DOCUMENTATION)
|
||||
|
||||
list(APPEND DOCS pdf)
|
||||
list (APPEND DOCS pdf)
|
||||
|
||||
# generate Doxygen file "Doxybook"
|
||||
# generate Doxygen file "Doxybook"
|
||||
|
||||
set(GENERATE_HTML NO)
|
||||
set(GENERATE_LATEX YES)
|
||||
set(LATEX_HEADER "${CMAKE_CURRENT_BINARY_DIR}/fltk-book.tex")
|
||||
set (GENERATE_HTML NO)
|
||||
set (GENERATE_LATEX YES)
|
||||
set (LATEX_HEADER "${CMAKE_CURRENT_BINARY_DIR}/fltk-book.tex")
|
||||
|
||||
configure_file(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/Doxybook
|
||||
@ONLY
|
||||
)
|
||||
# strip potential " (Git-hash)" from the original version
|
||||
string (REGEX REPLACE " .*$" "" DOXY_VERSION ${DOXYGEN_VERSION})
|
||||
|
||||
# generate LaTeX header fltk-book.tex
|
||||
execute_process (COMMAND date +%Y
|
||||
OUTPUT_VARIABLE YEAR
|
||||
)
|
||||
|
||||
set(FL_VERSION ${FLTK_VERSION_FULL})
|
||||
set(DOXY_VERSION ${DOXYGEN_VERSION})
|
||||
execute_process(COMMAND date +%Y
|
||||
OUTPUT_VARIABLE YEAR
|
||||
)
|
||||
configure_file (
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/Doxybook
|
||||
@ONLY
|
||||
)
|
||||
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/fltk-book.tex.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/fltk-book.tex
|
||||
@ONLY
|
||||
)
|
||||
# generate LaTeX title fltk-title.tex
|
||||
|
||||
# generate fltk.pdf
|
||||
configure_file (
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/fltk-title.tex.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/fltk-title.tex
|
||||
@ONLY
|
||||
)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/fltk.pdf
|
||||
COMMAND ${DOXYGEN_EXECUTABLE} Doxybook
|
||||
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/make_pdf
|
||||
COMMAND cp -f latex/refman.pdf fltk.pdf
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
COMMENT "Generating PDF documentation" VERBATIM
|
||||
DEPENDS fltk
|
||||
)
|
||||
# generate fltk.pdf
|
||||
|
||||
# add target 'pdf'
|
||||
add_custom_command (
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/fltk.pdf
|
||||
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/make_header
|
||||
${CMAKE_CURRENT_BINARY_DIR}/fltk-title.tex
|
||||
${CMAKE_CURRENT_BINARY_DIR}/fltk-book.tex
|
||||
COMMAND ${DOXYGEN_EXECUTABLE} Doxybook
|
||||
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/make_pdf
|
||||
COMMAND cp -f latex/refman.pdf fltk.pdf
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
COMMENT "Generating PDF documentation" VERBATIM
|
||||
)
|
||||
|
||||
add_custom_target(pdf
|
||||
# ALL
|
||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/fltk.pdf
|
||||
)
|
||||
# add target 'pdf'
|
||||
|
||||
endif(OPTION_BUILD_PDF_DOCUMENTATION)
|
||||
add_custom_target (pdf
|
||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/fltk.pdf
|
||||
)
|
||||
|
||||
endif (OPTION_BUILD_PDF_DOCUMENTATION)
|
||||
|
||||
#----------------------------------
|
||||
# add target 'docs' for all docs
|
||||
@@ -110,10 +115,9 @@ endif(OPTION_BUILD_PDF_DOCUMENTATION)
|
||||
|
||||
if (DOCS)
|
||||
|
||||
add_custom_target(docs
|
||||
# ALL
|
||||
DEPENDS ${DOCS}
|
||||
)
|
||||
add_custom_target (docs
|
||||
DEPENDS ${DOCS}
|
||||
)
|
||||
|
||||
endif (DOCS)
|
||||
|
||||
@@ -121,18 +125,18 @@ endif (DOCS)
|
||||
# install html + pdf documentation
|
||||
#----------------------------------
|
||||
|
||||
if(OPTION_INSTALL_HTML_DOCUMENTATION AND OPTION_BUILD_HTML_DOCUMENTATION)
|
||||
if (OPTION_INSTALL_HTML_DOCUMENTATION AND OPTION_BUILD_HTML_DOCUMENTATION)
|
||||
|
||||
install(DIRECTORY ${CMAKE_BINARY_DIR}/documentation/html
|
||||
DESTINATION ${FLTK_DATADIR}/doc/fltk
|
||||
)
|
||||
install (DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html
|
||||
DESTINATION ${FLTK_DATADIR}/doc/fltk
|
||||
)
|
||||
|
||||
endif(OPTION_INSTALL_HTML_DOCUMENTATION AND OPTION_BUILD_HTML_DOCUMENTATION)
|
||||
endif (OPTION_INSTALL_HTML_DOCUMENTATION AND OPTION_BUILD_HTML_DOCUMENTATION)
|
||||
|
||||
if(OPTION_INSTALL_PDF_DOCUMENTATION AND OPTION_BUILD_PDF_DOCUMENTATION)
|
||||
if (OPTION_INSTALL_PDF_DOCUMENTATION AND OPTION_BUILD_PDF_DOCUMENTATION)
|
||||
|
||||
install(FILES ${CMAKE_BINARY_DIR}/documentation/fltk.pdf
|
||||
DESTINATION ${FLTK_DATADIR}/doc/fltk/
|
||||
)
|
||||
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/fltk.pdf
|
||||
DESTINATION ${FLTK_DATADIR}/doc/fltk/
|
||||
)
|
||||
|
||||
endif(OPTION_INSTALL_PDF_DOCUMENTATION AND OPTION_BUILD_PDF_DOCUMENTATION)
|
||||
endif (OPTION_INSTALL_PDF_DOCUMENTATION AND OPTION_BUILD_PDF_DOCUMENTATION)
|
||||
|
||||
+16
-12
@@ -25,7 +25,7 @@ DOXYFILE_ENCODING = UTF-8
|
||||
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
|
||||
# by quotes) that should identify the project.
|
||||
|
||||
PROJECT_NAME = "FLTK @FL_VERSION@"
|
||||
PROJECT_NAME = "FLTK @FLTK_VERSION@"
|
||||
|
||||
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
|
||||
# This could be handy for archiving the generated documentation or
|
||||
@@ -565,9 +565,9 @@ INPUT += @CMAKE_CURRENT_SOURCE_DIR@/src/opengl.dox
|
||||
INPUT += @CMAKE_CURRENT_SOURCE_DIR@/src/fluid.dox
|
||||
INPUT += @CMAKE_CURRENT_SOURCE_DIR@/src/advanced.dox
|
||||
INPUT += @CMAKE_CURRENT_SOURCE_DIR@/src/unicode.dox
|
||||
INPUT += @CMAKE_SOURCE_DIR@/FL
|
||||
INPUT += @CMAKE_SOURCE_DIR@/src
|
||||
INPUT += @CMAKE_SOURCE_DIR@/cairo
|
||||
INPUT += @FLTK_SOURCE_DIR@/FL
|
||||
INPUT += @FLTK_SOURCE_DIR@/src
|
||||
INPUT += @FLTK_SOURCE_DIR@/cairo
|
||||
INPUT += @CMAKE_CURRENT_SOURCE_DIR@/src/enumerations.dox
|
||||
INPUT += @CMAKE_CURRENT_SOURCE_DIR@/src/glut.dox
|
||||
INPUT += @CMAKE_CURRENT_SOURCE_DIR@/src/forms.dox
|
||||
@@ -578,7 +578,7 @@ INPUT += @CMAKE_CURRENT_SOURCE_DIR@/src/development.dox
|
||||
INPUT += @CMAKE_CURRENT_SOURCE_DIR@/src/license.dox
|
||||
INPUT += @CMAKE_CURRENT_SOURCE_DIR@/src/examples.dox
|
||||
INPUT += @CMAKE_CURRENT_SOURCE_DIR@/src/faq.dox
|
||||
INPUT += @CMAKE_SOURCE_DIR@/src/Fl_Sys_Menu_Bar.mm
|
||||
INPUT += @FLTK_SOURCE_DIR@/src/Fl_Sys_Menu_Bar.mm
|
||||
|
||||
# This tag can be used to specify the character encoding of the source files
|
||||
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
|
||||
@@ -611,9 +611,9 @@ RECURSIVE = YES
|
||||
# excluded from the INPUT source files. This way you can easily exclude a
|
||||
# subdirectory from a directory tree whose root is specified with the INPUT tag.
|
||||
|
||||
EXCLUDE = @CMAKE_SOURCE_DIR@/src/fl_font_win32.cxx
|
||||
EXCLUDE += @CMAKE_SOURCE_DIR@/src/fl_font_mac.cxx
|
||||
EXCLUDE += @CMAKE_SOURCE_DIR@/src/aimm.h
|
||||
EXCLUDE = @FLTK_SOURCE_DIR@/src/aimm.h
|
||||
EXCLUDE += @FLTK_SOURCE_DIR@/src/fl_font_mac.cxx
|
||||
EXCLUDE += @FLTK_SOURCE_DIR@/src/fl_font_win32.cxx
|
||||
|
||||
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
|
||||
# directories that are symbolic links (a Unix filesystem feature) are excluded
|
||||
@@ -641,7 +641,8 @@ EXCLUDE_SYMBOLS =
|
||||
# directories that contain example code fragments that are included (see
|
||||
# the \include command).
|
||||
|
||||
EXAMPLE_PATH = ../test
|
||||
EXAMPLE_PATH = @CMAKE_CURRENT_SOURCE_DIR@/../test \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../examples
|
||||
|
||||
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
|
||||
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
|
||||
@@ -1001,7 +1002,7 @@ COMPACT_LATEX = NO
|
||||
# by the printer. Possible values are: a4, a4wide, letter, legal and
|
||||
# executive. If left blank a4wide will be used.
|
||||
|
||||
PAPER_TYPE = a4wide
|
||||
PAPER_TYPE = a4
|
||||
|
||||
# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
|
||||
# packages that should be included in the LaTeX output.
|
||||
@@ -1243,6 +1244,7 @@ INCLUDE_FILE_PATTERNS =
|
||||
# instead of the = operator.
|
||||
|
||||
PREDEFINED = FL_DOXYGEN \
|
||||
FL_ABI_VERSION=99999 \
|
||||
FLTK_ABI_VERSION=99999 \
|
||||
FLTK_HAVE_CAIRO \
|
||||
HAVE_GL \
|
||||
@@ -1306,7 +1308,8 @@ EXTERNAL_GROUPS = YES
|
||||
# The PERL_PATH should be the absolute path and name of the perl script
|
||||
# interpreter (i.e. the result of `which perl').
|
||||
|
||||
# PERL_PATH = /usr/bin/perl
|
||||
#** obsolete as of Doxygen 1.8.16 (use default for older versions)
|
||||
#** PERL_PATH = /usr/bin/perl
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the dot tool
|
||||
@@ -1328,7 +1331,8 @@ CLASS_DIAGRAMS = YES
|
||||
# the mscgen tool resides. If left empty the tool is assumed to be found in the
|
||||
# default search path.
|
||||
|
||||
# MSCGEN_PATH =
|
||||
#** obsolete as of Doxygen 1.8.16, not used by FLTK anyway
|
||||
#** MSCGEN_PATH =
|
||||
|
||||
# If set to YES, the inheritance and collaboration graphs will hide
|
||||
# inheritance and usage relations if the target is undocumented
|
||||
|
||||
+15
-16
@@ -1,19 +1,17 @@
|
||||
#
|
||||
# "$Id$"
|
||||
#
|
||||
# Makefile for the Fast Light Tool Kit (FLTK) documentation.
|
||||
#
|
||||
# Copyright 1998-2015 by Bill Spitzak and others.
|
||||
# Copyright 1998-2020 by Bill Spitzak and others.
|
||||
#
|
||||
# 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
|
||||
# https://www.fltk.org/COPYING.php
|
||||
#
|
||||
# Please report all bugs and problems on the following page:
|
||||
# Please see the following page on how to report bugs and issues:
|
||||
#
|
||||
# http://www.fltk.org/str.php
|
||||
# https://www.fltk.org/bugs.php
|
||||
#
|
||||
|
||||
# Get configuration stuff...
|
||||
@@ -68,7 +66,7 @@ dist: docs
|
||||
|
||||
clean:
|
||||
$(RM) Doxyfile Doxybook
|
||||
$(RM) fltk.pdf refman.pdf src/fltk-book.tex
|
||||
$(RM) fltk.pdf refman.pdf src/fltk-book.tex src/fltk-book.tex.in
|
||||
$(RMDIR) html latex
|
||||
$(RM) *~ *.bck *.bak *.log
|
||||
$(RM) $(MANPAGES) $(SRC_DOCDIR)/*.0
|
||||
@@ -134,22 +132,22 @@ uninstall-linux uninstall-osx:
|
||||
|
||||
Doxyfile: Doxyfile.in
|
||||
echo "Generating Doxyfile ..."
|
||||
sed -e's,@FL_VERSION@,$(FL_VERSION),' \
|
||||
sed -e's,@FLTK_VERSION@,$(FLTK_VERSION),' \
|
||||
-e's,@GENERATE_HTML@,YES,' \
|
||||
-e's,@GENERATE_LATEX@,NO,' \
|
||||
-e's, @LATEX_HEADER@,,' \
|
||||
-e's,@CMAKE_CURRENT_SOURCE_DIR@/,,' \
|
||||
-e's,@CMAKE_SOURCE_DIR@/,../,' \
|
||||
-e's,@FLTK_SOURCE_DIR@/,../,' \
|
||||
< $< > $@
|
||||
|
||||
Doxybook: Doxyfile.in
|
||||
echo "Generating Doxybook ..."
|
||||
sed -e's,@FL_VERSION@,$(FL_VERSION),' \
|
||||
sed -e's,@FLTK_VERSION@,$(FLTK_VERSION),' \
|
||||
-e's,@GENERATE_HTML@,NO,' \
|
||||
-e's,@GENERATE_LATEX@,YES,' \
|
||||
-e's,@LATEX_HEADER@,src/fltk-book.tex,' \
|
||||
-e's,@CMAKE_CURRENT_SOURCE_DIR@/,,' \
|
||||
-e's,@CMAKE_SOURCE_DIR@/,../,' \
|
||||
-e's,@FLTK_SOURCE_DIR@/,../,' \
|
||||
< $< > $@
|
||||
|
||||
# The HTML files are generated using doxygen, and this needs
|
||||
@@ -182,13 +180,14 @@ refman.pdf: $(HTMLFILES) Doxybook src/fltk-book.tex
|
||||
./make_pdf
|
||||
|
||||
src/fltk-book.tex: src/fltk-book.tex.in
|
||||
DOXY_VERSION=`$(DOXYDOC) --version`; \
|
||||
echo "Generating $@ ..."
|
||||
DOXY_VERSION=`$(DOXYDOC) --version|cut -f1 -d' '`; \
|
||||
YEAR=`date +%Y`; \
|
||||
sed -e"s/@YEAR@/$$YEAR/g" \
|
||||
-e"s/@FL_VERSION@/$(FL_VERSION)/g" \
|
||||
-e"s/@FLTK_VERSION@/$(FLTK_VERSION)/g" \
|
||||
-e"s/@DOXY_VERSION@/$$DOXY_VERSION/g" \
|
||||
< $< > $@
|
||||
|
||||
#
|
||||
# End of "$Id$".
|
||||
#
|
||||
src/fltk-book.tex.in: src/fltk-title.tex.in
|
||||
echo "Generating $@ ..."
|
||||
./make_header src/fltk-title.tex.in src/fltk-book.tex.in
|
||||
|
||||
Executable
+58
@@ -0,0 +1,58 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Create a new LaTeX header file for doxygen PDF docs
|
||||
#
|
||||
# Note: this LaTeX file depends on Doxygen and LaTeX versions, resp.
|
||||
# and needs therefore to be created with current Doxygen and LaTeX
|
||||
# versions on the build system.
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
# $ sh make_header input-file output-file
|
||||
#
|
||||
# where 'input-file' is the pure (LaTeX) title page (template)
|
||||
# and 'output-file' is the generated (LaTeX) title page (template)
|
||||
# to be used by `make' or `cmake` to generate the final LaTeX page
|
||||
# header (combined doxygen template + FLTK title page).
|
||||
#
|
||||
#=======================================================================
|
||||
# This script requires a posix shell and uses the following commands:
|
||||
# cat, rm and sed and (obviously) doxygen
|
||||
#=======================================================================
|
||||
|
||||
# input and output file names
|
||||
FLTK_HEAD="$1"
|
||||
DOXY_HEAD="$2"
|
||||
# temp file
|
||||
DOXY_TEMP="doxy-header.tex.$$"
|
||||
|
||||
if test x$FLTK_HEAD = x; then
|
||||
echo "usage: $0 fltk-header-file output-file"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test x$DOXY_HEAD = x; then
|
||||
echo "usage: $0 fltk-header-file output-file"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Create the doxygen LaTeX header template and replace the LaTeX
|
||||
# code between (and including) the lines containing
|
||||
# - 'begin{titlepage}' and
|
||||
# - 'end{titlepage}'
|
||||
# with our PDF document title page (LaTeX code) and write the
|
||||
# result to $DOXY_HEAD.
|
||||
|
||||
doxygen -w latex $DOXY_TEMP /dev/null /dev/null
|
||||
|
||||
# combine three parts of these files to the output file
|
||||
# using '( ... ) > $DOXY_HEAD' to write (concatenate)
|
||||
# all three parts to one file
|
||||
|
||||
( sed -e'/begin{titlepage}/,$d' < $DOXY_TEMP
|
||||
cat $FLTK_HEAD
|
||||
sed -e'1,/end{titlepage}/d' < $DOXY_TEMP
|
||||
) > $DOXY_HEAD
|
||||
|
||||
# cleanup
|
||||
rm -f $DOXY_TEMP
|
||||
+4
-10
@@ -1,20 +1,18 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
# Makefile helper script for the Fast Light Tool Kit (FLTK) documentation.
|
||||
#
|
||||
# Copyright 1998-2015 by Bill Spitzak and others.
|
||||
# Copyright 1998-2020 by Bill Spitzak and others.
|
||||
#
|
||||
# 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
|
||||
# https://www.fltk.org/COPYING.php
|
||||
#
|
||||
# Please report all bugs and problems on the following page:
|
||||
# Please see the following page on how to report bugs and issues:
|
||||
#
|
||||
# http://www.fltk.org/str.php
|
||||
# https://www.fltk.org/bugs.php
|
||||
#
|
||||
|
||||
# This script generates latex/refman.pdf after doxygen has been executed.
|
||||
@@ -41,7 +39,3 @@
|
||||
latex_count=`expr $latex_count - 1`
|
||||
done
|
||||
cd ..) > pdfall.log 2>&1
|
||||
|
||||
#
|
||||
# End of "$Id$".
|
||||
#
|
||||
|
||||
@@ -1,161 +0,0 @@
|
||||
% Latex header for FLTK generated by doxygen 1.8.13
|
||||
\batchmode
|
||||
\documentclass[twoside]{book}
|
||||
|
||||
% Packages required by doxygen
|
||||
\usepackage{fixltx2e}
|
||||
\usepackage{calc}
|
||||
\usepackage{doxygen}
|
||||
\usepackage[export]{adjustbox} % also loads graphicx
|
||||
\usepackage{graphicx}
|
||||
\usepackage[utf8]{inputenc}
|
||||
\usepackage{makeidx}
|
||||
\usepackage{multicol}
|
||||
\usepackage{multirow}
|
||||
\PassOptionsToPackage{warn}{textcomp}
|
||||
\usepackage{textcomp}
|
||||
\usepackage[nointegrals]{wasysym}
|
||||
\usepackage[table]{xcolor}
|
||||
|
||||
% Font selection
|
||||
\usepackage[T1]{fontenc}
|
||||
\usepackage[scaled=.90]{helvet}
|
||||
\usepackage{courier}
|
||||
\usepackage{amssymb}
|
||||
\usepackage{sectsty}
|
||||
\renewcommand{\familydefault}{\sfdefault}
|
||||
\allsectionsfont{%
|
||||
\fontseries{bc}\selectfont%
|
||||
\color{darkgray}%
|
||||
}
|
||||
\renewcommand{\DoxyLabelFont}{%
|
||||
\fontseries{bc}\selectfont%
|
||||
\color{darkgray}%
|
||||
}
|
||||
\newcommand{\+}{\discretionary{\mbox{\scriptsize$\hookleftarrow$}}{}{}}
|
||||
|
||||
% Page & text layout
|
||||
\usepackage{geometry}
|
||||
\geometry{%
|
||||
a4paper,%
|
||||
top=2.5cm,%
|
||||
bottom=2.5cm,%
|
||||
left=2.5cm,%
|
||||
right=2.5cm%
|
||||
}
|
||||
\tolerance=750
|
||||
\hfuzz=15pt
|
||||
\hbadness=750
|
||||
\setlength{\emergencystretch}{15pt}
|
||||
\setlength{\parindent}{0cm}
|
||||
\setlength{\parskip}{3ex plus 2ex minus 2ex}
|
||||
\makeatletter
|
||||
\renewcommand{\paragraph}{%
|
||||
\@startsection{paragraph}{4}{0ex}{-1.0ex}{1.0ex}{%
|
||||
\normalfont\normalsize\bfseries\SS@parafont%
|
||||
}%
|
||||
}
|
||||
\renewcommand{\subparagraph}{%
|
||||
\@startsection{subparagraph}{5}{0ex}{-1.0ex}{1.0ex}{%
|
||||
\normalfont\normalsize\bfseries\SS@subparafont%
|
||||
}%
|
||||
}
|
||||
\makeatother
|
||||
|
||||
% Headers & footers
|
||||
\usepackage{fancyhdr}
|
||||
\pagestyle{fancyplain}
|
||||
\fancyhead[LE]{\fancyplain{}{\bfseries\thepage}}
|
||||
\fancyhead[CE]{\fancyplain{}{}}
|
||||
\fancyhead[RE]{\fancyplain{}{\bfseries\leftmark}}
|
||||
\fancyhead[LO]{\fancyplain{}{\bfseries\rightmark}}
|
||||
\fancyhead[CO]{\fancyplain{}{}}
|
||||
\fancyhead[RO]{\fancyplain{}{\bfseries\thepage}}
|
||||
\fancyfoot[LE]{\fancyplain{}{}}
|
||||
\fancyfoot[CE]{\fancyplain{}{}}
|
||||
\fancyfoot[RE]{\fancyplain{}{\bfseries\scriptsize Generated by Doxygen }}
|
||||
\fancyfoot[LO]{\fancyplain{}{\bfseries\scriptsize Generated by Doxygen }}
|
||||
\fancyfoot[CO]{\fancyplain{}{}}
|
||||
\fancyfoot[RO]{\fancyplain{}{}}
|
||||
\renewcommand{\footrulewidth}{0.4pt}
|
||||
\renewcommand{\chaptermark}[1]{%
|
||||
\markboth{#1}{}%
|
||||
}
|
||||
\renewcommand{\sectionmark}[1]{%
|
||||
\markright{\thesection\ #1}%
|
||||
}
|
||||
|
||||
% Indices & bibliography
|
||||
\usepackage{natbib}
|
||||
\usepackage[titles]{tocloft}
|
||||
\setcounter{tocdepth}{3}
|
||||
\setcounter{secnumdepth}{5}
|
||||
\makeindex
|
||||
|
||||
% Hyperlinks (required, but should be loaded last)
|
||||
\usepackage{ifpdf}
|
||||
\ifpdf
|
||||
\usepackage[pdftex,pagebackref=true]{hyperref}
|
||||
\else
|
||||
\usepackage[ps2pdf,pagebackref=true]{hyperref}
|
||||
\fi
|
||||
\hypersetup{%
|
||||
colorlinks=true,%
|
||||
linkcolor=blue,%
|
||||
citecolor=blue,%
|
||||
unicode%
|
||||
}
|
||||
|
||||
% Custom commands
|
||||
\newcommand{\clearemptydoublepage}{%
|
||||
\newpage{\pagestyle{empty}\cleardoublepage}%
|
||||
}
|
||||
|
||||
\usepackage{caption}
|
||||
\captionsetup{labelsep=space,justification=centering,font={bf},singlelinecheck=off,skip=4pt,position=top}
|
||||
|
||||
%===== C O N T E N T S =====
|
||||
|
||||
\begin{document}
|
||||
|
||||
% Titlepage & ToC
|
||||
\hypersetup{pageanchor=false,
|
||||
bookmarksnumbered=true,
|
||||
pdfencoding=unicode
|
||||
}
|
||||
\pagenumbering{alph}
|
||||
\begin{titlepage}
|
||||
\vspace*{5cm}
|
||||
\begin{center}%
|
||||
{\Huge FLTK @FL_VERSION@ Programming Manual}\\
|
||||
\vspace*{2cm}
|
||||
\begin{DoxyImageNoCaption}
|
||||
\mbox{\includegraphics[width=6cm]{FL200.png}}
|
||||
\end{DoxyImageNoCaption}\\
|
||||
\vspace*{2cm}
|
||||
{\Large
|
||||
Revision 9 by F. Costantini, D. Gibson, M. Melcher, \\
|
||||
A. Schlosser, B. Spitzak, and M. Sweet.}\\
|
||||
\vspace*{1.5cm}
|
||||
{\large Copyright 1998-@YEAR@ by Bill Spitzak and others.}\\
|
||||
\vspace*{0.75cm}
|
||||
{\small
|
||||
This software and manual are provided under the terms of the GNU Library General Public License.}\\
|
||||
{\small
|
||||
Permission is granted to reproduce this manual or any portion for any purpose,}\\
|
||||
{\small
|
||||
provided this copyright and permission notice are preserved.}\\
|
||||
\vspace*{2.5cm}
|
||||
{\large Generated by Doxygen @DOXY_VERSION@}\\
|
||||
\vspace*{0.5cm}
|
||||
\today{}\\
|
||||
\end{center}
|
||||
\end{titlepage}
|
||||
\clearemptydoublepage
|
||||
\pagenumbering{roman}
|
||||
\tableofcontents
|
||||
\clearemptydoublepage
|
||||
\pagenumbering{arabic}
|
||||
\hypersetup{pageanchor=true}
|
||||
|
||||
%--- Begin generated contents ---
|
||||
@@ -0,0 +1,33 @@
|
||||
%
|
||||
% FLTK PDF documentation title page (LaTeX)
|
||||
%
|
||||
\begin{titlepage}
|
||||
\vspace*{5cm}
|
||||
\begin{center}%
|
||||
{\Huge FLTK @FLTK_VERSION@ Programming Manual}\\
|
||||
\vspace*{2cm}
|
||||
\begin{DoxyImageNoCaption}
|
||||
\mbox{\includegraphics[width=6cm]{FL200.png}}
|
||||
\end{DoxyImageNoCaption}\\
|
||||
\vspace*{2cm}
|
||||
{\Large
|
||||
Revision 9.6 by F. Costantini, D. Gibson, M. Melcher, \\
|
||||
A. Schlosser, B. Spitzak, and M. Sweet.}\\
|
||||
\vspace*{1.5cm}
|
||||
{\large Copyright 1998-@YEAR@ by Bill Spitzak and others.}\\
|
||||
\vspace*{0.75cm}
|
||||
{\small
|
||||
This software and manual are provided under the terms of the GNU Library General Public License.}\\
|
||||
{\small
|
||||
Permission is granted to reproduce this manual or any portion for any purpose,}\\
|
||||
{\small
|
||||
provided this copyright and permission notice are preserved.}\\
|
||||
\vspace*{2.5cm}
|
||||
{\large Generated by Doxygen @DOXY_VERSION@}\\
|
||||
\vspace*{0.5cm}
|
||||
\today{}\\
|
||||
\end{center}
|
||||
\end{titlepage}
|
||||
%
|
||||
% end of FLTK PDF documentation title page (LaTeX)
|
||||
%
|
||||
@@ -10,7 +10,7 @@
|
||||
<TD><CENTER>
|
||||
<B>FLTK 1.3.6 Programming Manual</B>
|
||||
|
||||
Revision 9 by F. Costantini, D. Gibson, M. Melcher,
|
||||
Revision 9.6 by F. Costantini, D. Gibson, M. Melcher,
|
||||
A. Schlosser, B. Spitzak and M. Sweet.
|
||||
|
||||
Copyright 1998-2021 by Bill Spitzak and others.
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
#
|
||||
# CMakeLists.txt used to build example apps by the CMake build system
|
||||
#
|
||||
# Copyright 2020-2021 by Bill Spitzak and others.
|
||||
#
|
||||
# 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:
|
||||
#
|
||||
# https://www.fltk.org/COPYING.php
|
||||
#
|
||||
# Please see the following page on how to report bugs and issues:
|
||||
#
|
||||
# https://www.fltk.org/bugs.php
|
||||
#
|
||||
################################################################################
|
||||
|
||||
include (../CMake/fl_create_example.cmake)
|
||||
|
||||
set (EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/../bin/examples)
|
||||
file (MAKE_DIRECTORY ${EXECUTABLE_OUTPUT_PATH})
|
||||
|
||||
################################################################################
|
||||
|
||||
# create separate lists of all source (.cxx) files
|
||||
# depending on the required FLTK and system libraries
|
||||
|
||||
############################################################
|
||||
# simple examples w/o extra libs
|
||||
############################################################
|
||||
|
||||
set (SIMPLE_SOURCES
|
||||
howto-add_fd-and-popen
|
||||
howto-browser-with-icons
|
||||
howto-drag-and-drop
|
||||
howto-parse-args
|
||||
howto-text-over-image-button
|
||||
menubar-add
|
||||
nativefilechooser-simple-app
|
||||
progress-simple
|
||||
shapedwindow
|
||||
table-as-container
|
||||
table-simple
|
||||
table-sort
|
||||
table-spreadsheet
|
||||
table-spreadsheet-with-keyboard-nav
|
||||
table-with-keynav
|
||||
tabs-simple
|
||||
textdisplay-with-colors
|
||||
texteditor-simple
|
||||
tree-as-container
|
||||
tree-custom-draw-items
|
||||
tree-custom-sort
|
||||
tree-of-tables
|
||||
tree-simple
|
||||
wizard-simple
|
||||
)
|
||||
|
||||
############################################################
|
||||
# examples requiring fltk_images
|
||||
############################################################
|
||||
|
||||
set (IMAGE_SOURCES
|
||||
clipboard
|
||||
)
|
||||
|
||||
############################################################
|
||||
# examples requiring OpenGL + libGLEW
|
||||
############################################################
|
||||
|
||||
set (OPENGL_SOURCES
|
||||
OpenGL3-glut-test
|
||||
OpenGL3test
|
||||
)
|
||||
|
||||
############################################################
|
||||
# create simple example programs
|
||||
############################################################
|
||||
|
||||
foreach (src ${SIMPLE_SOURCES})
|
||||
CREATE_EXAMPLE (${src} ${src}.cxx fltk)
|
||||
endforeach (src)
|
||||
|
||||
############################################################
|
||||
# create example programs with fltk_images library
|
||||
############################################################
|
||||
|
||||
foreach (src ${IMAGE_SOURCES})
|
||||
CREATE_EXAMPLE (${src} ${src}.cxx "fltk_images;fltk")
|
||||
endforeach (src)
|
||||
|
||||
############################################################
|
||||
# create example programs with OpenGL + libGLEW
|
||||
############################################################
|
||||
|
||||
# Note: macOS does not need libGLEW
|
||||
|
||||
if (APPLE AND (NOT OPTION_APPLE_X11))
|
||||
if (NOT LIB_GLEW)
|
||||
set (LIB_GLEW TRUE)
|
||||
endif ()
|
||||
set (REQUIRED_LIBS fltk_gl fltk ${OPENGL_LIBRARIES})
|
||||
else ()
|
||||
set (REQUIRED_LIBS fltk_gl fltk ${OPENGL_LIBRARIES} GLEW)
|
||||
endif ()
|
||||
|
||||
if (OPENGL_FOUND AND LIB_GLEW)
|
||||
foreach (src ${OPENGL_SOURCES})
|
||||
CREATE_EXAMPLE (${src} ${src}.cxx "${REQUIRED_LIBS}")
|
||||
endforeach (src)
|
||||
else ()
|
||||
message (STATUS
|
||||
"OpenGL or libGLEW not present: OpenGL example programs will not be built.")
|
||||
fl_debug_var (OPENGL_FOUND)
|
||||
fl_debug_var (LIB_GLEW)
|
||||
message ("")
|
||||
endif (OPENGL_FOUND AND LIB_GLEW)
|
||||
|
||||
unset (REQUIRED_LIBS)
|
||||
+1
-3
@@ -6,7 +6,6 @@ SHELL = /bin/sh
|
||||
|
||||
# Executables
|
||||
ALL = clipboard$(EXEEXT) \
|
||||
fltk-versions$(EXEEXT) \
|
||||
howto-add_fd-and-popen$(EXEEXT) \
|
||||
howto-browser-with-icons$(EXEEXT) \
|
||||
howto-drag-and-drop$(EXEEXT) \
|
||||
@@ -25,11 +24,11 @@ ALL = clipboard$(EXEEXT) \
|
||||
tabs-simple$(EXEEXT) \
|
||||
textdisplay-with-colors$(EXEEXT) \
|
||||
texteditor-simple$(EXEEXT) \
|
||||
tree-simple$(EXEEXT) \
|
||||
tree-as-container$(EXEEXT) \
|
||||
tree-custom-draw-items$(EXEEXT) \
|
||||
tree-custom-sort$(EXEEXT) \
|
||||
tree-of-tables$(EXEEXT) \
|
||||
tree-simple$(EXEEXT) \
|
||||
wizard-simple$(EXEEXT)
|
||||
|
||||
# default target -- build everything
|
||||
@@ -40,4 +39,3 @@ clean:
|
||||
$(RM) $(ALL)
|
||||
$(RM) *.o
|
||||
$(RM) core
|
||||
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
# on your system. Common examples:
|
||||
#
|
||||
# FLTKCONFIG = /usr/local/bin/fltk-config
|
||||
# FLTKCONFIG = /usr/local/src/fltk-1.3.x-svn/fltk-config
|
||||
# FLTKCONFIG = /usr/local/src/fltk-1.3.x/fltk-config
|
||||
# FLTKCONFIG = ../build/fltk-config # if ../build == CMake build directory
|
||||
#
|
||||
# Set .SILENT in your Makefile if you want 'quieter' builds.
|
||||
#
|
||||
@@ -32,4 +33,4 @@ LINKFLTK_ALL = $(shell $(FLTKCONFIG) --use-images --use-gl --ldstaticflags)
|
||||
# HOW TO LINK
|
||||
.o$(EXEEXT):
|
||||
@echo "*** Linking $@..."
|
||||
$(CXX) $< $(LINKFLTK_ALL) -o $@
|
||||
$(CXX) $< $(LINKFLTK) $(LINKFLTK_IMG) -o $@
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
//
|
||||
// "$Id$"
|
||||
//
|
||||
// Tiny OpenGL v3 + glut demo program for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
// Copyright 1998-2015 by Bill Spitzak and others.
|
||||
// Copyright 1998-2021 by Bill Spitzak and others.
|
||||
//
|
||||
// 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
|
||||
// https://www.fltk.org/COPYING.php
|
||||
//
|
||||
// Please report all bugs and problems on the following page:
|
||||
// Please see the following page on how to report bugs and issues:
|
||||
//
|
||||
// http://www.fltk.org/str.php
|
||||
// https://www.fltk.org/bugs.php
|
||||
//
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -21,7 +19,7 @@
|
||||
# define GL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED 1
|
||||
# include <OpenGL/gl3.h> // defines OpenGL 3.0+ functions
|
||||
#else
|
||||
# if defined(WIN32)
|
||||
# if defined(_WIN32)
|
||||
# define GLEW_STATIC 1
|
||||
# endif
|
||||
# include <GL/glew.h>
|
||||
@@ -32,13 +30,13 @@
|
||||
// Globals
|
||||
// Real programs don't use globals :-D
|
||||
// Data would normally be read from files
|
||||
GLfloat vertices[] = { -1.0f,0.0f,0.0f,
|
||||
GLfloat vertices[] = { -1.0f,0.0f,0.0f,
|
||||
0.0f,1.0f,0.0f,
|
||||
0.0f,0.0f,0.0f };
|
||||
GLfloat colours[] = { 1.0f, 0.0f, 0.0f,
|
||||
GLfloat colours[] = { 1.0f, 0.0f, 0.0f,
|
||||
0.0f, 1.0f, 0.0f,
|
||||
0.0f, 0.0f, 1.0f };
|
||||
GLfloat vertices2[] = { 0.0f,0.0f,0.0f,
|
||||
GLfloat vertices2[] = { 0.0f,0.0f,0.0f,
|
||||
0.0f,-1.0f,0.0f,
|
||||
1.0f,0.0f,0.0f };
|
||||
|
||||
@@ -52,7 +50,7 @@ void printShaderInfoLog(GLint shader)
|
||||
{
|
||||
int infoLogLen = 0;
|
||||
GLchar *infoLog;
|
||||
|
||||
|
||||
glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &infoLogLen);
|
||||
if (infoLogLen > 0)
|
||||
{
|
||||
@@ -68,35 +66,35 @@ void printShaderInfoLog(GLint shader)
|
||||
void init(void)
|
||||
{
|
||||
// Would load objects from file here - but using globals in this example
|
||||
|
||||
|
||||
// Allocate Vertex Array Objects
|
||||
glGenVertexArrays(2, &vertexArrayObjID[0]);
|
||||
// Setup first Vertex Array Object
|
||||
glBindVertexArray(vertexArrayObjID[0]);
|
||||
glGenBuffers(2, vertexBufferObjID);
|
||||
|
||||
|
||||
// VBO for vertex data
|
||||
glBindBuffer(GL_ARRAY_BUFFER, vertexBufferObjID[0]);
|
||||
glBufferData(GL_ARRAY_BUFFER, 9*sizeof(GLfloat), vertices, GL_STATIC_DRAW);
|
||||
glVertexAttribPointer((GLuint)0, 3, GL_FLOAT, GL_FALSE, 0, 0);
|
||||
glEnableVertexAttribArray(0);
|
||||
|
||||
|
||||
// VBO for colour data
|
||||
glBindBuffer(GL_ARRAY_BUFFER, vertexBufferObjID[1]);
|
||||
glBufferData(GL_ARRAY_BUFFER, 9*sizeof(GLfloat), colours, GL_STATIC_DRAW);
|
||||
glVertexAttribPointer((GLuint)1, 3, GL_FLOAT, GL_FALSE, 0, 0);
|
||||
glEnableVertexAttribArray(1);
|
||||
|
||||
|
||||
// Setup second Vertex Array Object
|
||||
glBindVertexArray(vertexArrayObjID[1]);
|
||||
glGenBuffers(1, &vertexBufferObjID[2]);
|
||||
|
||||
|
||||
// VBO for vertex data
|
||||
glBindBuffer(GL_ARRAY_BUFFER, vertexBufferObjID[2]);
|
||||
glBufferData(GL_ARRAY_BUFFER, 9*sizeof(GLfloat), vertices2, GL_STATIC_DRAW);
|
||||
glVertexAttribPointer((GLuint)0, 3, GL_FLOAT, GL_FALSE, 0, 0);
|
||||
glEnableVertexAttribArray(0);
|
||||
|
||||
|
||||
glBindVertexArray(0);
|
||||
}
|
||||
|
||||
@@ -105,17 +103,17 @@ void initShaders(void)
|
||||
{
|
||||
GLuint p, f, v;
|
||||
glClearColor (1.0, 1.0, 1.0, 0.0);
|
||||
|
||||
|
||||
v = glCreateShader(GL_VERTEX_SHADER);
|
||||
f = glCreateShader(GL_FRAGMENT_SHADER);
|
||||
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define SHADING_LANG_VERS "140"
|
||||
#else
|
||||
#define SHADING_LANG_VERS "130"
|
||||
#endif
|
||||
// load shaders
|
||||
const char *vv = "#version "SHADING_LANG_VERS"\n\
|
||||
const char *vv = "#version " SHADING_LANG_VERS "\n\
|
||||
in vec3 in_Position;\
|
||||
in vec3 in_Color;\
|
||||
out vec3 ex_Color;\
|
||||
@@ -124,8 +122,8 @@ void initShaders(void)
|
||||
ex_Color = in_Color;\
|
||||
gl_Position = vec4(in_Position, 1.0);\
|
||||
}";
|
||||
|
||||
const char *ff = "#version "SHADING_LANG_VERS"\n\
|
||||
|
||||
const char *ff = "#version " SHADING_LANG_VERS "\n\
|
||||
precision highp float;\
|
||||
in vec3 ex_Color;\
|
||||
out vec4 out_Color;\
|
||||
@@ -133,12 +131,12 @@ void initShaders(void)
|
||||
{\
|
||||
out_Color = vec4(ex_Color,1.0);\
|
||||
}";
|
||||
|
||||
|
||||
glShaderSource(v, 1, &vv,NULL);
|
||||
glShaderSource(f, 1, &ff,NULL);
|
||||
|
||||
|
||||
GLint compiled;
|
||||
|
||||
|
||||
glCompileShader(v);
|
||||
glGetShaderiv(v, GL_COMPILE_STATUS, &compiled);
|
||||
if (!compiled)
|
||||
@@ -146,7 +144,7 @@ void initShaders(void)
|
||||
fprintf(stderr, "Vertex shader not compiled.\n");
|
||||
printShaderInfoLog(v);
|
||||
}
|
||||
|
||||
|
||||
glCompileShader(f);
|
||||
glGetShaderiv(f, GL_COMPILE_STATUS, &compiled);
|
||||
if (!compiled)
|
||||
@@ -154,9 +152,9 @@ void initShaders(void)
|
||||
fprintf(stderr, "Fragment shader not compiled.\n");
|
||||
printShaderInfoLog(f);
|
||||
}
|
||||
|
||||
|
||||
p = glCreateProgram();
|
||||
|
||||
|
||||
glAttachShader(p,v);
|
||||
glAttachShader(p,f);
|
||||
glBindAttribLocation(p,0, "in_Position");
|
||||
@@ -180,22 +178,23 @@ void display(void)
|
||||
{
|
||||
// clear the screen
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
glBindVertexArray(vertexArrayObjID[0]); // First VAO
|
||||
glDrawArrays(GL_TRIANGLES, 0, 3); // draw first object
|
||||
|
||||
glBindVertexArray(vertexArrayObjID[1]); // select second VAO
|
||||
|
||||
glBindVertexArray(vertexArrayObjID[0]); // First VAO
|
||||
glDrawArrays(GL_TRIANGLES, 0, 3); // draw first object
|
||||
|
||||
glBindVertexArray(vertexArrayObjID[1]); // select second VAO
|
||||
glVertexAttrib3f((GLuint)1, 1.0, 0.0, 0.0); // set constant color attribute
|
||||
glDrawArrays(GL_TRIANGLES, 0, 3); // draw second object
|
||||
glDrawArrays(GL_TRIANGLES, 0, 3); // draw second object
|
||||
}
|
||||
|
||||
const int fullscreen = 0; // TEST (set to 1 to enable fullscreen mode)
|
||||
|
||||
int main (int argc, char* argv[])
|
||||
{
|
||||
Fl::use_high_res_GL(true);
|
||||
glutInit(&argc, argv);
|
||||
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | FL_OPENGL3);
|
||||
glutInitWindowSize(400,400);
|
||||
glutInitWindowSize(400, 400);
|
||||
glutCreateWindow("Triangle Test");
|
||||
#ifndef __APPLE__
|
||||
GLenum err = glewInit(); // defines pters to functions of OpenGL V 1.2 and above
|
||||
@@ -213,10 +212,7 @@ int main (int argc, char* argv[])
|
||||
initShaders();
|
||||
init();
|
||||
glutDisplayFunc(display);
|
||||
if (fullscreen) Fl::first_window()->fullscreen();
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
||||
|
||||
//
|
||||
// End of "$Id$".
|
||||
//
|
||||
|
||||
+87
-55
@@ -1,78 +1,110 @@
|
||||
#
|
||||
# "$Id$"
|
||||
#
|
||||
# CMakeLists.txt to build fluid for the FLTK project using CMake (www.cmake.org)
|
||||
#
|
||||
# Copyright 1998-2016 by Bill Spitzak and others.
|
||||
# Copyright 1998-2021 by Bill Spitzak and others.
|
||||
#
|
||||
# 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
|
||||
# https://www.fltk.org/COPYING.php
|
||||
#
|
||||
# Please report all bugs and problems on the following page:
|
||||
# Please see the following page on how to report bugs and issues:
|
||||
#
|
||||
# http://www.fltk.org/str.php
|
||||
# https://www.fltk.org/bugs.php
|
||||
#
|
||||
|
||||
set(CPPFILES
|
||||
CodeEditor.cxx
|
||||
Fl_Function_Type.cxx
|
||||
Fl_Group_Type.cxx
|
||||
Fl_Menu_Type.cxx
|
||||
Fl_Type.cxx
|
||||
ExternalCodeEditor_UNIX.cxx
|
||||
ExternalCodeEditor_WIN32.cxx
|
||||
Fl_Widget_Type.cxx
|
||||
Fl_Window_Type.cxx
|
||||
Fluid_Image.cxx
|
||||
about_panel.cxx
|
||||
align_widget.cxx
|
||||
alignment_panel.cxx
|
||||
code.cxx
|
||||
factory.cxx
|
||||
file.cxx
|
||||
fluid.cxx
|
||||
function_panel.cxx
|
||||
template_panel.cxx
|
||||
undo.cxx
|
||||
widget_panel.cxx
|
||||
set (CPPFILES
|
||||
CodeEditor.cxx
|
||||
Fl_Function_Type.cxx
|
||||
Fl_Group_Type.cxx
|
||||
Fl_Menu_Type.cxx
|
||||
Fl_Type.cxx
|
||||
Fl_Widget_Type.cxx
|
||||
Fl_Window_Type.cxx
|
||||
Fluid_Image.cxx
|
||||
about_panel.cxx
|
||||
align_widget.cxx
|
||||
alignment_panel.cxx
|
||||
code.cxx
|
||||
factory.cxx
|
||||
file.cxx
|
||||
fluid.cxx
|
||||
function_panel.cxx
|
||||
template_panel.cxx
|
||||
undo.cxx
|
||||
widget_panel.cxx
|
||||
)
|
||||
|
||||
if(APPLE AND NOT OPTION_APPLE_X11)
|
||||
set(FLUID_ICON "${CMAKE_CURRENT_SOURCE_DIR}/fluid.app/Contents/Resources/fluid.icns")
|
||||
add_executable(fluid MACOSX_BUNDLE ${CPPFILES} "${FLUID_ICON}")
|
||||
FLTK_SET_BUNDLE_ICON(fluid "${FLUID_ICON}")
|
||||
else()
|
||||
add_executable(fluid WIN32 ${CPPFILES})
|
||||
endif(APPLE AND NOT OPTION_APPLE_X11)
|
||||
# ExternalCodeEditor: platform specific files
|
||||
|
||||
target_link_libraries(fluid fltk fltk_images fltk_forms)
|
||||
if (WIN32)
|
||||
list (APPEND CPPFILES ExternalCodeEditor_WIN32.cxx)
|
||||
else ()
|
||||
list (APPEND CPPFILES ExternalCodeEditor_UNIX.cxx)
|
||||
endif (WIN32)
|
||||
|
||||
if (APPLE AND (NOT OPTION_APPLE_X11))
|
||||
set (ICON_NAME fluid.icns)
|
||||
set (ICON_PATH "${PROJECT_SOURCE_DIR}/fluid/fluid.app/Contents/Resources/${ICON_NAME}")
|
||||
add_executable (fluid MACOSX_BUNDLE ${CPPFILES} ${ICON_PATH})
|
||||
|
||||
# create macOS bundle wrapper script
|
||||
|
||||
set (WRAPPER "${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/fluid")
|
||||
add_custom_command (
|
||||
TARGET fluid POST_BUILD
|
||||
COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/../CMake/macOS-bundle-wrapper.in ${WRAPPER}
|
||||
COMMAND chmod u+x,g+x,o+x ${WRAPPER}
|
||||
BYPRODUCTS ${WRAPPER}
|
||||
# COMMENT "Creating macOS bundle wrapper script ${WRAPPER}"
|
||||
VERBATIM
|
||||
)
|
||||
unset (WRAPPER)
|
||||
|
||||
else ()
|
||||
add_executable (fluid WIN32 ${CPPFILES})
|
||||
endif (APPLE AND (NOT OPTION_APPLE_X11))
|
||||
|
||||
target_link_libraries (fluid fltk fltk_images fltk_forms)
|
||||
if (FLTK_HAVE_CAIRO)
|
||||
target_link_directories (fluid PUBLIC ${PKG_CAIRO_LIBRARY_DIRS})
|
||||
endif (FLTK_HAVE_CAIRO)
|
||||
|
||||
# install fluid
|
||||
|
||||
install(TARGETS fluid
|
||||
if (APPLE AND (NOT OPTION_APPLE_X11))
|
||||
# create bundle
|
||||
set_target_properties (fluid PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${PROJECT_SOURCE_DIR}/fluid/fluid.app/Contents/Info.plist")
|
||||
set_target_properties (fluid PROPERTIES MACOSX_BUNDLE_ICON_FILE ${ICON_NAME})
|
||||
set_target_properties (fluid PROPERTIES RESOURCE ${ICON_PATH})
|
||||
# install
|
||||
install (TARGETS fluid DESTINATION ${FLTK_BINDIR})
|
||||
else()
|
||||
install (TARGETS fluid
|
||||
EXPORT FLTK-Targets
|
||||
DESTINATION ${FLTK_BINDIR}
|
||||
)
|
||||
RUNTIME DESTINATION ${FLTK_BINDIR}
|
||||
LIBRARY DESTINATION ${FLTK_LIBDIR}
|
||||
ARCHIVE DESTINATION ${FLTK_LIBDIR}
|
||||
)
|
||||
endif (APPLE AND (NOT OPTION_APPLE_X11))
|
||||
|
||||
# install desktop files
|
||||
|
||||
if(UNIX)
|
||||
install(FILES fluid.desktop
|
||||
DESTINATION ${FLTK_DATADIR}/applications
|
||||
)
|
||||
# Install mime-type file. x-fluid.desktop method is deprecated.
|
||||
install(FILES fluid.xml
|
||||
DESTINATION ${FLTK_DATADIR}/mime/packages
|
||||
)
|
||||
if (UNIX)
|
||||
install (FILES fluid.desktop
|
||||
DESTINATION ${FLTK_DATADIR}/applications
|
||||
)
|
||||
# Install mime-type file (x-fluid.desktop method is deprecated)
|
||||
install (FILES fluid.xml
|
||||
DESTINATION ${FLTK_DATADIR}/mime/packages
|
||||
)
|
||||
|
||||
# Install desktop icons.
|
||||
foreach(icon 32 48 64 128)
|
||||
install(FILES icons/fluid-${icon}.png
|
||||
DESTINATION ${FLTK_DATADIR}/icons/hicolor/${icon}x${icon}/apps
|
||||
RENAME fluid.png
|
||||
)
|
||||
endforeach()
|
||||
endif(UNIX)
|
||||
# Install desktop icons
|
||||
foreach (icon 32 48 64 128)
|
||||
install (FILES icons/fluid-${icon}.png
|
||||
DESTINATION ${FLTK_DATADIR}/icons/hicolor/${icon}x${icon}/apps
|
||||
RENAME fluid.png
|
||||
)
|
||||
endforeach()
|
||||
endif (UNIX)
|
||||
|
||||
+25
-27
@@ -1,21 +1,21 @@
|
||||
#
|
||||
# "$Id$"
|
||||
# FLUID Makefile for the Fast Light Tool Kit (FLTK).
|
||||
#
|
||||
# FLUID makefile for the Fast Light Tool Kit (FLTK).
|
||||
#
|
||||
# Copyright 1998-2016 by Bill Spitzak and others.
|
||||
# Copyright 1998-2020 by Bill Spitzak and others.
|
||||
#
|
||||
# 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
|
||||
# https://www.fltk.org/COPYING.php
|
||||
#
|
||||
# Please report all bugs and problems on the following page:
|
||||
# Please see the following page on how to report bugs and issues:
|
||||
#
|
||||
# http://www.fltk.org/str.php
|
||||
# https://www.fltk.org/bugs.php
|
||||
#
|
||||
|
||||
include ../makeinclude
|
||||
|
||||
CPPFILES = \
|
||||
CodeEditor.cxx \
|
||||
ExternalCodeEditor_UNIX.cxx \
|
||||
@@ -43,14 +43,12 @@ CPPFILES = \
|
||||
|
||||
OBJECTS = $(CPPFILES:.cxx=.o)
|
||||
|
||||
include ../makeinclude
|
||||
|
||||
all: $(FLUID) fluid$(EXEEXT)
|
||||
|
||||
fluid$(EXEEXT): $(OBJECTS) $(LIBNAME) $(FLLIBNAME) \
|
||||
$(IMGLIBNAME)
|
||||
echo Linking $@...
|
||||
$(CXX) $(ARCHFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $(OBJECTS) $(LINKFLTKFORMS) $(LINKFLTKIMG) $(LDLIBS)
|
||||
$(CXX) $(ARCHFLAGS) $(CXXFLAGS) -o $@ $(OBJECTS) $(LINKFLTKFORMS) $(LINKFLTKIMG) $(LDFLAGS) $(LDLIBS)
|
||||
$(OSX_ONLY) $(RM) -r -f fluid.app/Contents/MacOS
|
||||
$(OSX_ONLY) mkdir fluid.app/Contents/MacOS
|
||||
$(OSX_ONLY) $(INSTALL_BIN) fluid fluid.app/Contents/MacOS
|
||||
@@ -58,7 +56,7 @@ fluid$(EXEEXT): $(OBJECTS) $(LIBNAME) $(FLLIBNAME) \
|
||||
fluid-shared$(EXEEXT): $(OBJECTS) ../src/$(DSONAME) ../src/$(FLDSONAME) \
|
||||
../src/$(IMGDSONAME)
|
||||
echo Linking $@...
|
||||
$(CXX) $(ARCHFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $(OBJECTS) $(LINKSHARED) $(LDLIBS)
|
||||
$(CXX) $(ARCHFLAGS) $(CXXFLAGS) -o $@ $(OBJECTS) $(LINKSHARED) $(LDFLAGS) $(LDLIBS)
|
||||
|
||||
clean:
|
||||
-$(RM) *.o core.* *~ *.bck *.bak
|
||||
@@ -66,7 +64,11 @@ clean:
|
||||
-$(RM) fluid.app/Contents/MacOS/fluid$(EXEEXT)
|
||||
|
||||
depend: $(CPPFILES)
|
||||
makedepend -Y -I.. -f makedepend $(CPPFILES)
|
||||
makedepend -Y -I.. -f makedepend -w 20 $(CPPFILES)
|
||||
echo "# DO NOT DELETE THIS LINE -- make depend depends on it." > makedepend.tmp
|
||||
echo "" >> makedepend.tmp
|
||||
grep '^[a-zA-Z]' makedepend | ( LC_ALL=C sort -u -f >> makedepend.tmp; )
|
||||
mv makedepend.tmp makedepend
|
||||
|
||||
# Automatically generated dependencies...
|
||||
include makedepend
|
||||
@@ -111,20 +113,16 @@ uninstall-linux:
|
||||
uninstall-osx:
|
||||
$(RM) -r $(DESTDIR)/Applications/fluid.app
|
||||
|
||||
|
||||
#
|
||||
# Note: The rebuild target can only be used if you have the original .fl
|
||||
# files. This is normally only used by the FLTK maintainers...
|
||||
#
|
||||
# files. This is normally only used by the FLTK maintainers...
|
||||
# It *must* be executed *after* fluid has been built and
|
||||
# fluid must be rebuilt if any {.fl|.cxx|.h} files were changed.
|
||||
|
||||
rebuild:
|
||||
./fluid -c about_panel.fl
|
||||
./fluid -c alignment_panel.fl
|
||||
./fluid -c function_panel.fl
|
||||
./fluid -c print_panel.fl
|
||||
./fluid -c template_panel.fl
|
||||
./fluid -c widget_panel.fl
|
||||
|
||||
#
|
||||
# End of "$Id$".
|
||||
#
|
||||
rebuild: fluid$(EXEEXT)
|
||||
echo 'Rebuilding fluid (.fl) and .cxx/.h files from .fl files ...'
|
||||
./fluid$(EXEEXT) -u -c about_panel.fl
|
||||
./fluid$(EXEEXT) -u -c alignment_panel.fl
|
||||
./fluid$(EXEEXT) -u -c function_panel.fl
|
||||
./fluid$(EXEEXT) -u -c print_panel.fl
|
||||
./fluid$(EXEEXT) -u -c template_panel.fl
|
||||
./fluid$(EXEEXT) -u -c widget_panel.fl
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// About dialog for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
// Copyright 1998-2017 by Bill Spitzak and others.
|
||||
// Copyright 1998-2021 by Bill Spitzak and others.
|
||||
//
|
||||
// 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
|
||||
@@ -282,7 +282,7 @@ Fl_Double_Window* make_about_panel() {
|
||||
snprintf(about,sizeof(about),"FLTK User\nInterface Designer\nVersion %d.%d.%d",FL_MAJOR_VERSION,FL_MINOR_VERSION,FL_PATCH_VERSION);
|
||||
o->copy_label(about);
|
||||
} // Fl_Box* o
|
||||
{ Fl_Box* o = new Fl_Box(135, 90, 200, 45, "Copyright 1998-2017 by\nBill Spitzak and others");
|
||||
{ Fl_Box* o = new Fl_Box(135, 90, 200, 45, "Copyright 1998-2021 by\nBill Spitzak and others");
|
||||
o->align(Fl_Align(132|FL_ALIGN_INSIDE));
|
||||
} // Fl_Box* o
|
||||
{ Fl_Button* o = new Fl_Button(115, 145, 123, 25, "View License...");
|
||||
|
||||
@@ -7,7 +7,7 @@ comment {//
|
||||
//
|
||||
// About dialog for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
// Copyright 1998-2017 by Bill Spitzak and others.
|
||||
// Copyright 1998-2021 by Bill Spitzak and others.
|
||||
//
|
||||
// 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
|
||||
@@ -45,7 +45,7 @@ Version x.x.x}
|
||||
code2 {o->copy_label(about);}
|
||||
}
|
||||
Fl_Box {} {
|
||||
label {Copyright 1998-2017 by
|
||||
label {Copyright 1998-2021 by
|
||||
Bill Spitzak and others}
|
||||
xywh {135 90 200 45} align 148
|
||||
}
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// About dialog for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
// Copyright 1998-2017 by Bill Spitzak and others.
|
||||
// Copyright 1998-2021 by Bill Spitzak and others.
|
||||
//
|
||||
// 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
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Setting and shell dialogs for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
// Copyright 1998-2017 by Bill Spitzak and others.
|
||||
// Copyright 1998-2021 by Bill Spitzak and others.
|
||||
//
|
||||
// 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
|
||||
|
||||
@@ -7,7 +7,7 @@ comment {//
|
||||
//
|
||||
// Setting and shell dialogs for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
// Copyright 1998-2017 by Bill Spitzak and others.
|
||||
// Copyright 1998-2021 by Bill Spitzak and others.
|
||||
//
|
||||
// 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
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Setting and shell dialogs for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
// Copyright 1998-2017 by Bill Spitzak and others.
|
||||
// Copyright 1998-2021 by Bill Spitzak and others.
|
||||
//
|
||||
// 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
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Code dialogs for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
// Copyright 1998-2017 by Bill Spitzak and others.
|
||||
// Copyright 1998-2021 by Bill Spitzak and others.
|
||||
//
|
||||
// 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
|
||||
|
||||
@@ -7,7 +7,7 @@ comment {//
|
||||
//
|
||||
// Code dialogs for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
// Copyright 1998-2017 by Bill Spitzak and others.
|
||||
// Copyright 1998-2021 by Bill Spitzak and others.
|
||||
//
|
||||
// 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
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Code dialogs for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
// Copyright 1998-2017 by Bill Spitzak and others.
|
||||
// Copyright 1998-2021 by Bill Spitzak and others.
|
||||
//
|
||||
// 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
|
||||
|
||||
+995
-424
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// FLUID print panel for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
// Copyright 1998-2017 by Bill Spitzak and others.
|
||||
// Copyright 1998-2021 by Bill Spitzak and others.
|
||||
//
|
||||
// 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
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user