- makesrcdist: store Git revision in a file in the tarball
- CMake/resources.cmake: get git revision either from Git or file and
store it as CMake cache variable 'FLTK_GIT_REVISION' for reference
- documentation/*: get git revision from git or file
- fluid/documentation/*: get git revision from git or file
Part 1: replace the check for trunc() with check_symbol_exists().
Part 2 (to be done): replace all occurrences of the macro
check_function_exists() with check_symbol_exists() if possible.
The attempted consistency check to remove FLTK's obsolete cache
variable OPENGL_GLU_INCLUDE_DIR which is used by CMake 3.29+ could
cause false positives, at least on macOS, as reported on issue #1046.
This modified code removes OPENGL_GLU_INCLUDE_DIR if it is defined
but FLTK_OPENGL_GLU_INCLUDE_DIR is not (yet) defined which indicates
the first configure execution with the new code.
This commit consists of two parts:
1. CMake/resources.cmake: remove the old variable OPENGL_GLU_INCLUDE_DIR
from the CMake cache if possible, otherwise enforce a clean build.
2. src/CMakeLists.txt, CMake/options.cmake: use the new variable name
FLTK_OPENGL_GLU_INCLUDE_DIR.
For details please see GitHub Issue #1001.
- 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.
This removes these warnings for each source file compiled
osxcross: warning: possibly dangerous include path specified: '-I /usr/include/freetype2'
osxcross: info: you can silence this warning via 'OSXCROSS_NO_INCLUDE_PATH_WARNINGS=1' (env)
when cross-compiling from Linux to macOS.
This would create these warnings for each source file compiled
osxcross: warning: possibly dangerous include path specified: '-I /usr/include/freetype2'
osxcross: info: you can silence this warning via 'OSXCROSS_NO_INCLUDE_PATH_WARNINGS=1' (env)
when cross-compiling from Linux to macOS.
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.
The Visual Studio generator does often not find GL/glu.h and locale.h
although these headers are in the Visual Studio SDK. The warning has
been changed to "info" and the unnecessary and sometimes confusing
recommendation to rerun CMake has been removed.
Add CMake test for PTHREAD_MUTEX_RECURSIVE
Add autoconf/configure compile test for PTHREAD_MUTEX_RECURSIVE
Replace "#ifdef PTHREAD_MUTEX_RECURSIVE"
with "#ifdef HAVE_PTHREAD_MUTEX_RECURSIVE"
and define HAVE_PTHREAD_MUTEX_RECURSIVE in config.h
- rewrite to use pkg-config with both autoconf + CMake
- remove hardcoded library names
- fix build dependencies and search directories
- remove or replace old and unused variables
- update README files
To be done:
- implement fallback for autoconf/configure if pkg-config is missing
- fix pango build (uses cairo internally)
- raise minimum CMake version from 2.6.3 to 3.2.3 (Jun 01, 2015)
- indent all CMake files according to the CMP (2 col.)
- refactor FLTK version number definitions and usage
- unify CMake and autoconf/configure variable names:
- FL_VERSION -> FLTK_VERSION
- FL_MAJOR_VERSION -> FLTK_VERSION_MAJOR
- etc. for _MINOR_ and _PATCH_, respectively
- note: this does not affect FL_VERSION etc. in source code
- generate "export headers" for all libraries (experimental: OFF)
- port some forgotten goodies from branch-1.3 to master
- merge and improve macro 'create_example' (WIP)
- remove "temporary" options and code for older CMake versions
- include and use 'GenerateExportHeader' (experimental, WIP: OFF)
- note: created header files are not yet used
- build only *one* DLL with Visual Studio (tested, works)
- similar to the bundled IDE projects in 1.3.x
- add some dynamically linked test/demo programs ('*-shared')
if shared libraries are built (WIP)
- split 'macros.cmake': use one file per macro
- remove obsolete svn '$Id$' tags from all source files
- update .fl files and generated files accordingly
- replace 'http://www.fltk.org' URL's with 'https://...'
- replace bug report URL 'str.php' with 'bugs.php'
- remove trailing whitespace
- fix other whitespace errors flagged by Git
- add and/or fix missing or wrong standard headers
- convert tabs to spaces in all source files
The only relevant code changes are in the fluid/ folder where
some .fl files and other source files were used to generate
the '$Id' headers and footers.
This update ought to work with
fltk-config [--use-images] [--use-gl] --compile <c source file>
on both Windows and Unix/Linux when built with CMake. It was tested
under Windows and Linux using fltk-config directly from the build tree,
but it should work as well after installation.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12686 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Basically replace CMAKE_XXX_DIR with CMAKE_CURRENT_XXX_DIR where
XXX = SOURCE or BINARY.
Patch proposal by cleanrock, FLTK PR #4:
https://github.com/fltk/test-only/pull/4
Patch modified to fix target dirs for test programs and doxygen docs.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12630 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
CMake variables FLTK_SOURCE_DIR and FLTK_BINARY_DIR are only defined
if the project name is exactly "FLTK" (all uppercase). These variables
are generated (set) by CMake as <PROJECT_NAME>_SOURCE_DIR etc.
The correct variables are CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR,
respectively, which are always defined.
This commit enables future changes of the FLTK project name, e.g. to
"fltk" or "fltk-1.4.0" (a versioned project name), if we like...
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12281 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit fixes a CMake issue if CMake is invoked from a desktop icon
or the Windows menu, i.e. not within the correct environment to find all
required header files.
We recommend to run CMake from a "Developer Command Prompt for Visual Studio X",
but sometimes users click on their desktop icon and run CMake without the
correct context. In this case some header files in the Windows SDK's are not
found by CMake.
The solution is to issue a warning and "fix" the header detection by faking
that the headers were found, because they are always available in Visual
Studio. The affected headers <locale.h> and <GL/glu.h> were set to "found"
in the bundles IDE's in FLTK 1.3 as well, so there should be no issue with
this fix.
It is also recommended by the CMake folks, i.e. they suggest not to search
for these special header files that are known to exist always.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12209 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Note: the test for OpenGL works slightly different with CMake vs. configure.
The CMake (cache) variable HAVE_GL_GL_H was never used.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12203 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Main point: pthreads must not be checked under Windows (e.g. MinGW)
since Windows always uses native Windows threads (unless Cygwin is used).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12138 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Now you can set OPTION_BUILD_SHARED_LIBS:BOOL=ON to build FLTK dll's with
Visual Studio. Tested and works (Visual Studio 2010 + 2015).
Note: Linux fixes included, tested and works (Ubuntu).
Todo: dll names and target directories may need some changes.
We really need to get rid of that "_SHARED" suffix in .so names.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11867 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit makes the file config.h generated by CMake 100% compatible
with the one generated by autoconf/configure.
Fixes in this commit:
- Set FLTK_DATADIR and FLTK_DOCDIR with the same default values.
Note: needs some cleanup, option values are not clear, '/fltk'
is currently appended in export.cmake (needs improvement).
- Simulation of autoconf macro AC_HEADER_DIRENT for correct
definition of only one 'dirent' header file.
- Fix more function checks:
- dlsym
- png_get_valid
- png_set_tRNS_to_alpha
- Improve "Big Endian" check for __APPLE__ (mac_endianness.h).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10985 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
The files "config.h" generated by configure and CMake are now almost
identical, except a few comments and some still missing or failing
config tests, for instance checks for some functions in libraries.
[Note: tested and compared on Linux.]
configh.cmake.in: Fixed many #cmakedefine and #cmakedefine01 statements
so they #define their variables as 0 or 1, or /* #undef */ it, resp.,
as it is done in the configure build.
Added tests:
- libXrender
Fixed tests:
- function glXGetProcAddressARB
Todo (still failing tests in CMake):
- HAVE_PNG_GET_VALID
- HAVE_PNG_SET_TRNS_TO_ALPHA
- HAVE_DLSYM
Other remaining issues:
- compiler flags introduced in configure/make build
- HAVE_SYS_NDIR_H - maybe missing test in configure ?
- HAVE_SYS_DIR_H - maybe missing test in configure ?
- HAVE_NDIR_H - maybe missing test in configure ?
- WORDS_BIGENDIAN and #include <mac_endianness.h> ...
i.e. Mac OS X specific #include needed or not ?
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10984 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Configure and CMake now both check if X11/Xregion.h exists on the
build system and set HAVE_X11_XREGION_H in config.h accordingly.
src/Fl_Pixmap.cxx: modified to use the configure test as proposed by Manolo
in fltk.coredev on Dec 13 2015 in thread "Using X11 backend on OS X".
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10983 ea41ed52-d2ee-0310-a9c1-e6b18d33e121