summaryrefslogtreecommitdiff
path: root/CMake/resources.cmake
AgeCommit message (Collapse)Author
3 dayswip: forkmaxim nikonov
2024-08-31 CMake: replace check_function_exists() with check_symbol_exists() (#1053)ManoloFLTK
2024-08-26Display Git revision in docs generated from releases (#499)Albrecht Schlosser
- 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
2024-08-25CMake: replace check_function_exists() for trunc() (#1049)Albrecht Schlosser
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.
2024-08-23CMake: remove cache consistency check (#1046)Albrecht Schlosser
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.
2024-08-08CMake: remove debug statementsAlbrecht Schlosser
2024-08-08CMake: fix usage of OPENGL_GLU_INCLUDE_DIR (#1001)Albrecht Schlosser
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.
2024-05-13CMake: improve linking OpenGL3 example programs (#959)Albrecht Schlosser
- 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.
2024-05-03 CMake: don't put freetype stuff in include directories for macOSManoloFLTK
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.
2024-05-02Remove commit 4a31d49 that breaks X11 buildManoloFLTK
2024-05-02CMake: put freetype stuff in include directories for X11 onlyManoloFLTK
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.
2024-04-05CMake: Fix detection of trunc() for WindowsAlbrecht Schlosser
2024-04-02Add replacement for potentially missing trunc() (#944)Albrecht Schlosser
- add configure + CMake checks to define HAVE_TRUNC in config.h - src/Fl_Timeout.cxx: add local replacement function
2024-03-18CMake: formatting onlyAlbrecht Schlosser
2024-03-18Replace setenv() with putenv() on old systems (+937)Albrecht Schlosser
Add system check for setenv() function in configure and CMake.
2024-02-13CMake: simplify resources.cmakeAlbrecht Schlosser
Note: CheckIncludeFiles caches the result in an 'internal' variable. Hence mark_as_advanced() is not necessary for these variables.
2024-02-13CMake: improve formatting, remove debug statementsAlbrecht Schlosser
2024-02-07Introduce "Modern CMake" in FLTKAlbrecht Schlosser
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.
2022-05-21Wayland under FreeBSD: detect <GL/glu.h> and fix LIBDECOR_PLUGIN_DIR.ManoloFLTK
2022-04-03Improve libpng header search (notably on macOS)Albrecht Schlosser
Fix usage of internal cache variables so users can switch between system and builtin libpng reliably.
2022-03-13CMake/Windows (MSVC): remove confusing CMake warningAlbrecht Schlosser
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.
2022-03-07CMake/MinGW/MSYS2: fix building examples with libglew32 (#226)Albrecht Schlosser
CMake/resources.cmake: add NAMES option to find_library examples/CMakeLists.txt: fix linking libGLEW/libglew32
2021-11-26Fix for issue #253: Remove xdbe supportManoloFLTK
2021-07-21Call pthread's recursive mutex on Linux (Issue #245)Albrecht Schlosser
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
2021-03-01Fix cairo build (autoconf + CMake) + README'sAlbrecht Schlosser
- 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)
2020-08-25Towards construction of fltk-config by CMake under macOS (WIP).ManoloFLTK
2020-08-21CMake: add examples folder to build (optional)Albrecht Schlosser
- replace misnamed option 'OPTION_BUILD_EXAMPLES' with 'FLTK_BUILD_TEST' - add option 'FLTK_BUILD_EXAMPLES' to build apps in examples folder - move examples/fltk-versions.cxx to test/fltk-versions.cxx - [Travis-CI] enable option 'FLTK_BUILD_EXAMPLES' for automatic builds
2020-07-15CMake: refactor and reformat CMake filesAlbrecht Schlosser
- 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
2020-07-06Remove $Id$ tags, update URL's, and moreAlbrecht Schlosser
- 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.
2018-02-23CMake: Fix fltk-config for Windows and Unix/Linux.Albrecht Schlosser
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
2018-01-10CMake: enable building FLTK in a subdirectory of another project.Albrecht Schlosser
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
2017-06-29Update copyright year(s).Albrecht Schlosser
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12282 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-06-29CMake: replace improperly used variables with correct ones.Albrecht Schlosser
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
2017-03-17[CMake] Fix Visual Studio header detection.Albrecht Schlosser
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
2017-03-17[CMake] Remove unused header test HAVE_GL_GL_H (GL/gl.h).Albrecht Schlosser
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
2016-12-06[CMake] Rewrite pthreads checks for compatibility with configure.Albrecht Schlosser
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
2016-08-09[CMake] Fix Windows dll build with Visual Studio generator.Albrecht Schlosser
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
2016-06-14THE best way to test for availability of dlsym().Manolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11779 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-06-13[CMake] Fix restoration of CMAKE_REQUIRED_LIBRARIES.Albrecht Schlosser
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11777 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-06-13Fix cases where function dlysym() is not in library libdl.Manolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11774 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-30[CMake] config.h, part 2 - full compatibility with autoconf.Albrecht Schlosser
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
2015-12-30Harmonize configure and CMake build system (part 1).Albrecht Schlosser
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
2015-12-30Add configure and CMake checks for X11/Xregion.h.Albrecht Schlosser
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
2015-04-25[CMake] Add doxygen documentation generation (STR #3195).Albrecht Schlosser
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10720 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-04-25[CMake] Fix CMake build's fltk-config (STR #3217).Albrecht Schlosser
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10716 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-11-22Set correct svn properties on CMake files.Albrecht Schlosser
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10466 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-09-27CMake enhancements, as discussed in STR #3055.Albrecht Schlosser
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10342 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-02-09Split CMake files for better maintenance, as discussed in fltk.general.Albrecht Schlosser
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10098 ea41ed52-d2ee-0310-a9c1-e6b18d33e121