Commit Graph

76 Commits

Author SHA1 Message Date
Albrecht Schlosser
54596de1c3 [CMake] Fix Visual Studio header detection.
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 17:42:50 +00:00
Albrecht Schlosser
83b5df04fb [CMake] Remove unused header test HAVE_GL_GL_H (GL/gl.h).
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
2017-03-17 15:59:07 +00:00
Albrecht Schlosser
16774ddc4e Rename test/help demo program to test/help_dialog.
This change avoids a name conflict with CMake's auto-generated target 'help'
for "Unix Makefiles", "Ninja", and supposedly other generators as well.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12171 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-02-08 02:06:52 +00:00
Manolo Gouy
461750c38e X11 platform: Add optional use of the pango library to draw text, gaining the possibility to draw text in any script supported by Unicode.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12153 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-12-21 15:05:02 +00:00
Albrecht Schlosser
307dd033f0 [CMake] Rewrite pthreads checks for compatibility with configure.
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-12-06 19:20:34 +00:00
Manolo Gouy
21781c3fe9 Add --enable-print option to configure to allow building without print support on X11 platforms.
Also, the NO_PRINT_SUPPORT preprocessor variable is renamed FL_NO_PRINT_SUPPORT.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12131 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-12-01 17:31:29 +00:00
Manolo Gouy
c794b5ecbd MacOS platform: restore CMake building with OPTION_APPLE_X11 on.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12128 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-12-01 06:31:25 +00:00
Albrecht Schlosser
78d853891c [CMake] Fix Windows dll build with Visual Studio generator.
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-08-09 14:11:42 +00:00
Manolo Gouy
e5e7fa9b1e Fix CMake building under Apple platform that used to set HAVE_GL_GLU_H to 0
On the Mac OS platform, file glu.h is not in a directory called GL.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11864 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-08-05 17:14:55 +00:00
Albrecht Schlosser
d0fa58f700 Clarification and better documentation of ABI version configuration.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11804 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-07-09 18:47:06 +00:00
Manolo Gouy
68cf00ee09 THE best way to test for availability of dlsym().
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11779 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-06-14 05:19:32 +00:00
Albrecht Schlosser
1f81808b10 [CMake] Fix restoration of CMAKE_REQUIRED_LIBRARIES.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11777 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-06-13 22:32:01 +00:00
Manolo Gouy
dc2fd2befc Fix cases where function dlysym() is not in library libdl.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11774 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-06-13 12:29:54 +00:00
Albrecht Schlosser
3dfec155ad [CMake] Remove redundant linking in CMake build process (STR #3298).
[CMake] Simplify CMake build files, remove redundancies.

Ports of branch-1.3, svn r 11442 and 11444:

Remove src/fl_call_main.c from non-Windows (static) libraries. It would
be an empty object file anyway.
 
Use CMake variables to set up used files and linked libraries to remove
redundancies. All files and libs are used only in the definition of
CMake variables and used later in static and shared builds, resp.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11447 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-27 20:59:39 +00:00
Albrecht Schlosser
e86e4a6ab0 [CMake] Fix library name (Debug mode), add fluid dependencies.
The library name in Debug mode must only be 'libname'd.a if the build
is with MSVC; all other builds never appended the 'd' suffix to the name.
This is also documented (see lib/README).

Fluid did not regenerate the .cxx and .h files if the .fl file was changed.
The DEPENDS keyword adds the necessary dependency.
The MAIN_DEPENDENCY keyword "also suggests to Visual Studio generators
where to hang the custom command" according to CMake docs.

Ported from branch-1.3, svn r11430.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11431 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-26 14:33:20 +00:00
Albrecht Schlosser
420408e7d3 [CMake] Mark OPTION_USE_POLL as advanced.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11292 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-05 13:29:46 +00:00
Matthias Melcher
fcdc7f1212 Made Pico/SDL setup compile and run some minimal code.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11274 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-03 00:07:17 +00:00
Matthias Melcher
53859c584f Add support for SDL as a base library on OS X.
This commit adds the basic setup in CMake to allow SDL as a base
library for FLTK on OS X (and probably for other platforms as well).

The SDL library driver set is derived from yet another new driver
set named 'Pico'. 'Pico' is a base class for a driver that will
allow porting of FLTK with the tinyest amount of effort. This 
implementation of the SDL driver shall be documented very well
to explain the porting process.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11262 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-02 00:54:37 +00:00
Matthias Melcher
478d633620 More device and driver setup.
- building the base structure to have a screen driver, a window driver, and a system driver
- still pondering over the exact implementation

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11147 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-10 13:04:24 +00:00
Matthias Melcher
572b7fe0b8 Starting CMake config to blend out filechoose and filename handling (shrins fltk massively if not needed)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11146 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-10 12:22:38 +00:00
Manolo Gouy
a8a777ff26 New CMake option OPTION_PRINT_SUPPORT turned ON by default
When the option is off, file config.h defines NO_PRINT_SUPPORT 
which in turn produces a library without print support, that is, 
class Fl_Printer does nothing.
When off, the FLTK library is somewhat smaller.
Can be turned off only when the X11 library is used.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11127 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-05 16:34:42 +00:00
Manolo Gouy
254cb01f54 Support of OPTION_APPLE_X11 by CMake: do not use hard-coded paths
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11125 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-03 10:20:03 +00:00
Manolo Gouy
f057cca22b To support OPTION_APPLE_X11
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11122 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-02 14:14:38 +00:00
Manolo Gouy
54c1c935e6 Stop using ide/Xcode4/plists/editor-Info.plist because ide will be removed.
This file is moved to the test/ directory.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11120 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-02 08:58:33 +00:00
Albrecht Schlosser
00dd296ff2 Bump version numbers for next minor release: FLTK 1.4.0.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11088 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-01-30 00:56:42 +00:00
Albrecht Schlosser
72dda7f35a CMake] Work around CMake bug in CMake versions 3.4.x.
CMake versions 3.4.x crash when using fltk_wrap_ui, a built-in CMake
command. According to the CMake devs this will be fixed in CMake 3.5.

However, since fltk_wrap_ui is no longer necessary (it can replaced by
custom build commands) and some Linux distributions deploy CMake 3.4.x
we decided to use an own replacement function.

This makes sure that FLTK can be built with CMake 3.4.x, but FLTK users
may still have to rewrite their own CMake files to not use fltk_wrap_ui.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11082 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-01-29 13:40:08 +00:00
Manolo Gouy
69ec698e41 Mac OS: modified CMake config files to allow use of OPTION_APPLE_X11
to build an X11-using version of FLTK on the Mac OS platform.
This matches the recent support of the --enable-x11 option
by the configure script on the mac.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10986 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-31 06:19:59 +00:00
Albrecht Schlosser
3beb45165a [CMake] config.h, part 2 - full compatibility with autoconf.
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-30 21:13:07 +00:00
Albrecht Schlosser
4f5e6e7732 Harmonize configure and CMake build system (part 1).
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-30 14:37:35 +00:00
Albrecht Schlosser
17c4817592 Add configure and CMake checks for X11/Xregion.h.
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-12-30 12:10:15 +00:00
Manolo Gouy
bb4f485708 Mac OS: add if(APPLE condition to Mac OS-specific target property.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10982 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-29 16:50:50 +00:00
Manolo Gouy
8ac33d6b71 Mac OS: Enhanced the application bundle for the editor demo
so it is launchable by dropping any file on its icon. This is
done both for the configure/make and the CMake build systems
(the Xcode build system did that already).
The editor demo is the only one calling fl_open_callback().


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10981 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-29 16:41:15 +00:00
Manolo Gouy
fdd1369292 Mac OS + CMake: this file is used by CMake to build the Info.plist files of the application
bundles it creates. This makes these apps support retina displays, because
the file contains
	<key>NSHighResolutionCapable</key>
	<true/>


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10980 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-26 16:14:19 +00:00
Albrecht Schlosser
fb172ecd3c Fix fltk-config for CMake build.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10787 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-07-12 22:32:30 +00:00
Albrecht Schlosser
9adb181156 Make FL_ABI_VERSION configurable (STR #3161).
This commit adds the configure option --with-abiversion and the CMake option
OPTION_ABI_VERSION. Both options can be set e.g. to 10304 to build with
FL_ABI_VERSION = 10304 (FLTK 1.3.4).

For IDE builds there are new files ide/<IDE-NAME>/FL/abi-version.h that
can be edited to change the ABI version before the FLTK lib is built.
Note that this file MUST be copied to the include/FL directory if the
IDE-built library is to be installed.

The default is FL_ABI_VERSION = FL_MAJOR*10000 + FL_MINOR*100 + 0, i.e.
10300 for all FLTK 1.3.x versions to keep binary compatibility (ABI).

Todo: more tests and more documentation.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10786 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-07-12 19:23:55 +00:00
Albrecht Schlosser
f5bf727e37 [CMake] Add option to suppress CMake regeneration (STR #3215).
This option is marked as advanced and only available with CMake >= 3.0.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10721 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-04-25 22:57:17 +00:00
Albrecht Schlosser
5f3f1c8bc6 [CMake] Add doxygen documentation generation (STR #3195).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10720 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-04-25 21:42:51 +00:00
Albrecht Schlosser
a6a75b81d2 [CMake] Update fltk-config generation for AIX (STR #3217).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10719 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-04-25 20:36:48 +00:00
Albrecht Schlosser
e23bf0b768 [CMake] Fix CMake build's fltk-config (STR #3217).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10716 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-04-25 13:50:27 +00:00
Albrecht Schlosser
ce76b65e55 CMake: Remove installation of example programs (STR #3194).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10695 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-04-10 15:50:59 +00:00
Manolo Gouy
3ec8bab10e CMake build on Mac OS: r10688 was not a good move because it works with
the makefiles generator but not with the Xcode generator. Stepping back one commit.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10689 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-04-08 12:16:52 +00:00
Manolo Gouy
4b5b11a1cb CMake building on Mac OS: use a simpler way to put files within app bundles.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10688 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-04-08 11:37:14 +00:00
Manolo Gouy
ab78d7ee61 Make building on Mac OS: compile with -DUSING_XCODE only for demo.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10687 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-04-08 10:54:24 +00:00
Manolo Gouy
9510c22bd3 CMake building on Mac OS: the demo program uses and finds demo.menu in its bundle.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10686 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-04-08 09:33:39 +00:00
Manolo Gouy
ccffe4cf63 Corrected typo: resources --> Resources
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10685 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-04-07 16:13:25 +00:00
Manolo Gouy
b0f05ee7ff CMake for Mac OS: the generated Xcode project creates bundled test applications and
uses appropriate icons for blocks, checkers, and sudoku.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10683 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-04-07 15:31:12 +00:00
Albrecht Schlosser
1bb0fb36f6 CMake] install CMake files in DATADIR instead of LIBDIR under Linux.
FLTKConfig.cmake and others have been installed in arch dependent LIBDIR,
but should be in arch independent DATADIR.  The result is that you can
always find FLTKConfig.cmake in <prefix>/share/fltk.

This is where "/path/to/fltk" should point to when FLTK is used in external
projects (see README.CMake.txt).

Todo: test if find_package works w/o defining FLTK_DIR when installed
in a standard location.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10682 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-04-07 15:18:35 +00:00
Manolo Gouy
f7ffa787fc Don't use -pthread in link commands on Mac OS.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10681 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-04-07 09:05:24 +00:00
Albrecht Schlosser
d767ae7ff6 [CMake] Fix and install fltk-config.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10679 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-04-06 13:06:21 +00:00
Albrecht Schlosser
0f45a7adf5 [Version 1.3.4] Update version numbers - hopefully complete.
Note to devs: if I missed something, please mark follow-up commits with
[Version 1.3.4] so we can find the necessary commits for version updates.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10612 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-03-10 01:41:55 +00:00