- Remove find_library(LIB_GLEW ...) from 'resources.cmake'
- Use the variable FLTK_GLEW_DIR to "find" a user supplied GLEW library
for OpenGL3 example programs (examples/OpenGL3*.cxx).
Both static and shared libs (DLLs) are supported, but the static
library is preferred to avoid DLL dependencies.
- Define preprocessor macro 'GLEW_STATIC' by CMake compile definitions
if and only if the static glew library (glew32s) was found and linked.
The previous code defined 'GLEW_STATIC' unconditionally in the source
code which led to undefined references if a shared lib (DLL) was used.
Also: set build requirement of OpenGL3 tests to C++11 to enable
building in C++98 mode (if the compiler allows C++11).
Note: this may be removed in 1.5.0 when FLTK requires C++11 anyway.
This is a big commit and there are too many changes to list them all.
The main changes are:
- rename all CMake build options to 'FLTK_*'
- export library targets with namespace (prefix) 'fltk::'
- standardize shared library target names with suffix '-shared'
- set public build properties on libraries for consumers
- document library names and aliases in README.CMake.txt
- document changes in "Migrating Code from FLTK 1.3 to 1.4"
- partial backwards compatibility for old user projects
Included but not directly related changes:
- fix Windows (Visual Studio) DLL build
- add CMake function fl_debug_target() to show target properties
- don't build test programs if FLTK is a subproject
- internal: reformat CMake code: remove space before '('
Thanks to Matthias and Manolo for their help, testing, and feeback.
- FL/Fl_Grid.H: header file
- src/Fl_Grid.cxx: implementation
- examples/grid-simple.cxx: simple example program
- test/cube.cxx: use Fl_Grid for layout
- test/grid_alignment.cxx: test cell alignment and other functions
- test/grid_buttons.cxx: demo program as discussed in fltk.general
- test/grid_login.cxx: like test/flex_login.cxx but with Fl_Grid
- test/flex_login.cxx: modified to match test/grid_login.cxx
As reported in fltk.coredev in thread
"CMAKE build with build examples. On and test OFF fails"
$ cmake .. -D FLTK_BUILD_EXAMPLES=ON -D FLTK_BUILD_TEST=OFF
failed with: Unknown CMake command "FLTK_RUN_FLUID".
Albrecht submitted this in issue 358.
Tested the variations:
cmake .. -- examples and cairo off
cmake -D FLTK_BUILD_EXAMPLES=on -- examples on, cairo off
cmake -D FLTK_BUILD_EXAMPLES=on -D OPTION_CAIRO=on .. -- examples on, cairo on
When examples are 'on', they build into the bin/examples directory.