Update two README files for 1.5.0
- remove configure related stuff - improve documentation in these files
This commit is contained in:
parent
26ff0df6cf
commit
43e24a7541
@ -1,5 +1,5 @@
|
|||||||
README.Cairo.txt - Cairo Window Support for FLTK
|
README.Cairo.txt - Cairo Window Support for FLTK
|
||||||
----------------------------------------------------
|
-------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
CONTENTS
|
CONTENTS
|
||||||
@ -38,25 +38,22 @@ use the class Fl_Cairo_Window which sets up a Cairo context so the user
|
|||||||
progam can call Cairo drawing calls in their own drawing callback.
|
progam can call Cairo drawing calls in their own drawing callback.
|
||||||
|
|
||||||
CMake option name: FLTK_OPTION_CAIRO_WINDOW
|
CMake option name: FLTK_OPTION_CAIRO_WINDOW
|
||||||
Configure option : --enable-cairo
|
|
||||||
|
|
||||||
Since FLTK 1.3 the library can also be configured to provide a Cairo context
|
Since FLTK 1.3 the library can also be configured to provide a Cairo context
|
||||||
in all subclasses of Fl_Window. This is called "extended" Cairo support.
|
in all subclasses of Fl_Window. This is called "extended" Cairo support and
|
||||||
|
is not recommended for general use.
|
||||||
|
|
||||||
CMake option name: FLTK_OPTION_CAIRO_EXT
|
CMake option name: FLTK_OPTION_CAIRO_EXT
|
||||||
Configure option : --enable-cairoext
|
|
||||||
|
|
||||||
These two options provide users with an interface to use Cairo to draw
|
These two options provide users with an interface to use Cairo to draw
|
||||||
into FLTK windows. FLTK does not use Cairo for rendering its own graphics
|
into FLTK windows. FLTK does not use Cairo for rendering its own graphics
|
||||||
with these two options. Both options must be enabled explicitly.
|
with these two options. Both options must be enabled explicitly.
|
||||||
|
|
||||||
|
|
||||||
Since FLTK 1.4 the new Wayland platform uses Cairo for all drawings.
|
Since FLTK 1.4 the new Wayland platform uses Cairo for all drawings.
|
||||||
Under X11 drawing with Cairo rather than Xlib is a build option.
|
Under X11 drawing with Cairo rather than Xlib is a build option.
|
||||||
The old "Fl_Cairo_Window support" is still available on all platforms.
|
The old "Fl_Cairo_Window support" is still available on all platforms.
|
||||||
|
|
||||||
CMake option name: FLTK_GRAPHICS_CAIRO
|
CMake option name: FLTK_GRAPHICS_CAIRO
|
||||||
Configure option : --enable-usecairo
|
|
||||||
|
|
||||||
Full Cairo drawing is provided on Unix/Linux platforms. It is always used if
|
Full Cairo drawing is provided on Unix/Linux platforms. It is always used if
|
||||||
Wayland (FLTK_BACKEND_WAYLAND) is enabled during the build. It is optional
|
Wayland (FLTK_BACKEND_WAYLAND) is enabled during the build. It is optional
|
||||||
@ -97,10 +94,10 @@ drawing by itself (FLTK_GRAPHICS_CAIRO).
|
|||||||
to automatically making possible the use of a Cairo context
|
to automatically making possible the use of a Cairo context
|
||||||
in any FLTK window.
|
in any FLTK window.
|
||||||
|
|
||||||
This feature must be enabled with 'configure --enable-cairoext' or the
|
This feature must be enabled explicitly with the CMake option
|
||||||
CMake option FLTK_OPTION_CAIRO_EXT:BOOL=ON (Default: OFF).
|
FLTK_OPTION_CAIRO_EXT:BOOL=ON (Default: OFF).
|
||||||
|
|
||||||
(4) A new Cairo demo that is available in the test subdirectory.
|
(4) A Cairo demo program in the test subdirectory.
|
||||||
|
|
||||||
For more details, please have a look to the doxygen documentation,
|
For more details, please have a look to the doxygen documentation,
|
||||||
in the Modules section.
|
in the Modules section.
|
||||||
@ -122,7 +119,8 @@ on the various supported operating systems.
|
|||||||
sudo apt install libcairo2-dev
|
sudo apt install libcairo2-dev
|
||||||
|
|
||||||
Then build fltk using the Cairo support option using:
|
Then build fltk using the Cairo support option using:
|
||||||
cmake -G "Unix Makefiles" -D FLTK_OPTION_CAIRO_WINDOW:BOOL=ON -S <fltk_dir> -B <your_build_dir>
|
|
||||||
|
cmake -G "Unix Makefiles" -D FLTK_OPTION_CAIRO_WINDOW=ON -S <fltk_dir> -B <your_build_dir>
|
||||||
cd <your_build_dir>
|
cd <your_build_dir>
|
||||||
make
|
make
|
||||||
|
|
||||||
@ -134,26 +132,8 @@ on the various supported operating systems.
|
|||||||
|
|
||||||
sudo yum install cairo-devel
|
sudo yum install cairo-devel
|
||||||
|
|
||||||
..and then rebuild FLTK:
|
..and then rebuild FLTK (see above for CMake command and options).
|
||||||
|
|
||||||
make distclean
|
|
||||||
./configure --enable-cairo
|
|
||||||
make
|
|
||||||
|
|
||||||
If you get this error:
|
|
||||||
|
|
||||||
[..]
|
|
||||||
Linking cairo_test...
|
|
||||||
/usr/bin/ld: cannot find -lpixman-1
|
|
||||||
collect2: ld returned 1 exit status
|
|
||||||
make[1]: *** [cairo_test] Error 1
|
|
||||||
|
|
||||||
..remove "-lpixman-1" from FLTK's makeinclude file, i.e. change this line:
|
|
||||||
|
|
||||||
-CAIROLIBS = -lcairo -lpixman-1
|
|
||||||
+CAIROLIBS = -lcairo
|
|
||||||
|
|
||||||
..then another 'make' should finish the build without errors.
|
|
||||||
You should be able to then run the test/cairo_test program.
|
You should be able to then run the test/cairo_test program.
|
||||||
|
|
||||||
According to the Cairo site, "For Debian and Debian derivatives including
|
According to the Cairo site, "For Debian and Debian derivatives including
|
||||||
@ -166,12 +146,9 @@ on the various supported operating systems.
|
|||||||
as well.
|
as well.
|
||||||
|
|
||||||
As of Feb 2021 (FLTK 1.4.0) dependencies like pixman-1 will be detected by
|
As of Feb 2021 (FLTK 1.4.0) dependencies like pixman-1 will be detected by
|
||||||
configure or CMake automatically using pkg-config.
|
CMake automatically using pkg-config.
|
||||||
|
|
||||||
Note 1: CMake builds *require* the use of pkg-config.
|
Note: builds with Cairo and/or Wayland *require* pkg-config.
|
||||||
|
|
||||||
Note 2: As of Feb 2021 autoconf/configure/make builds require pkg-config
|
|
||||||
as well.
|
|
||||||
|
|
||||||
|
|
||||||
3.2 Windows
|
3.2 Windows
|
||||||
@ -181,11 +158,12 @@ on the various supported operating systems.
|
|||||||
|
|
||||||
3.3 macOS
|
3.3 macOS
|
||||||
----------
|
----------
|
||||||
As under Linux you can use both build options, i.e. autoconf/make or CMake
|
As under Linux you can use CMake to build FLTK with Cairo support.
|
||||||
to build FLTK with Cairo support. One option is to install Homebrew and
|
|
||||||
add the required libraries with `brew install ...'. It is always required
|
One option is to install Homebrew and add the required libraries with
|
||||||
to install the "Xcode commandline tools" but a full installation of Xcode
|
`brew install ...'. It is always required to install the "Xcode
|
||||||
is not necessary. If you choose to use Xcode you can generate the Xcode
|
commandline tools" but a full installation of Xcode is not necessary.
|
||||||
|
If you choose to use Xcode you can generate the Xcode
|
||||||
IDE files with CMake.
|
IDE files with CMake.
|
||||||
|
|
||||||
The following instructions are intentionally terse. More detailed
|
The following instructions are intentionally terse. More detailed
|
||||||
@ -200,16 +178,7 @@ on the various supported operating systems.
|
|||||||
|
|
||||||
With these tools installed it is already possible to download and build
|
With these tools installed it is already possible to download and build
|
||||||
a current FLTK tarball or snapshot. All you need to do is unpack the
|
a current FLTK tarball or snapshot. All you need to do is unpack the
|
||||||
tarball and run `make' in the root directory. This will run `configure',
|
tarball and cmake and make as described in README.CMake.txt.
|
||||||
generate the necessary files, and build FLTK in its standard configuration.
|
|
||||||
|
|
||||||
Note 1: this requires an existing `configure' file which is included in
|
|
||||||
FLTK releases and snapshots but not in the FLTK Git repository.
|
|
||||||
|
|
||||||
Note 2: to build current FLTK downloaded from Git using configure + make
|
|
||||||
you need to run `autoconf' to generate 'configure'. If autoconf is not
|
|
||||||
available on your system you can download a FLTK snapshot, unpack it,
|
|
||||||
and copy the 'configure' file from the snapshot to your Git worktree.
|
|
||||||
|
|
||||||
|
|
||||||
3.3.2 Install Homebrew for Cairo and other Library Support
|
3.3.2 Install Homebrew for Cairo and other Library Support
|
||||||
@ -232,9 +201,9 @@ on the various supported operating systems.
|
|||||||
other software (package) name to see if it can be installed. If yes, run
|
other software (package) name to see if it can be installed. If yes, run
|
||||||
`brew install cairo' (or other name) to install it.
|
`brew install cairo' (or other name) to install it.
|
||||||
|
|
||||||
Other helpful packages are 'autoconf' and other Unix (Linux) tools, for
|
Other helpful packages are some Unix (Linux) tools, for instance 'git-gui'
|
||||||
instance 'git-gui' (installs 'gitk' and 'git gui' commands). The Xcode
|
(installs 'gitk' and 'git gui' commands). The Xcode commandline tools
|
||||||
commandline tools mentioned above install only the git commandline tool.
|
mentioned above install only the git commandline tool.
|
||||||
|
|
||||||
|
|
||||||
3.3.3 Install CMake and Build with CMake
|
3.3.3 Install CMake and Build with CMake
|
||||||
|
|||||||
139
README.Unix.txt
139
README.Unix.txt
@ -17,16 +17,15 @@ README.Unix.txt - Building FLTK on Unix/Linux Systems
|
|||||||
2.7 HP-UX
|
2.7 HP-UX
|
||||||
2.8 AIX
|
2.8 AIX
|
||||||
|
|
||||||
3 How to Build FLTK Using GCC
|
3 How to Build FLTK on Unix or Unix-like Systems
|
||||||
3.1 Downloading and Unpacking
|
3.1 Downloading and Unpacking
|
||||||
3.2 Configuration and Build Systems
|
3.2 Configuration and Build Systems
|
||||||
3.3 Configuring FLTK with autoconf and configure (deprecated)
|
3.3 Building FLTK in a Nutshell
|
||||||
3.4 Building FLTK
|
3.4 Testing FLTK
|
||||||
3.5 Testing FLTK
|
3.5 Installing FLTK
|
||||||
3.6 Installing FLTK
|
3.6 Creating Your Own Projects
|
||||||
3.7 Creating new Projects
|
|
||||||
|
|
||||||
4 Creating a new Project in Code::Blocks
|
4 Creating a New Project in Code::Blocks
|
||||||
|
|
||||||
|
|
||||||
[*] TODO: we still need to write these chapters
|
[*] TODO: we still need to write these chapters
|
||||||
@ -272,8 +271,8 @@ you want to do so.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
3 How to Build FLTK Using GCC
|
3 How to Build FLTK on Unix or Unix-like Systems
|
||||||
================================
|
===================================================
|
||||||
|
|
||||||
|
|
||||||
3.1 Downloading and Unpacking
|
3.1 Downloading and Unpacking
|
||||||
@ -285,8 +284,8 @@ The FLTK source code and documentation can be downloaded from:
|
|||||||
|
|
||||||
If you are familiar with "git" and like to stay current with your version,
|
If you are familiar with "git" and like to stay current with your version,
|
||||||
you will find the git access parameters at the bottom of that page.
|
you will find the git access parameters at the bottom of that page.
|
||||||
Unpack FLTK into a convenient location. I like to have everything in my
|
Unpack FLTK into a convenient location, e.g. in your `dev` directory.
|
||||||
dev directory. Change the following instructions to fit your preferences.
|
Change the following instructions to fit your preferences.
|
||||||
|
|
||||||
cd
|
cd
|
||||||
mkdir dev
|
mkdir dev
|
||||||
@ -296,114 +295,62 @@ dev directory. Change the following instructions to fit your preferences.
|
|||||||
cd fltk-1.x.y
|
cd fltk-1.x.y
|
||||||
|
|
||||||
|
|
||||||
3.2 Configuration and Build Systems
|
3.2 Configuration and Building
|
||||||
--------------------------------------
|
---------------------------------
|
||||||
|
|
||||||
The following paragraphs describe the "classic" build system with autoconf,
|
Since FLTK 1.5 the only build system (generator) used by FLTK is CMake.
|
||||||
configure, and make that has been used to build FLTK up to version 1.3.x
|
|
||||||
and can still be used with FLTK 1.4.x.
|
|
||||||
|
|
||||||
However, the FLTK team recommend to use CMake which is the preferred build
|
|
||||||
system generator since FLTK 1.4 used for all platforms (including Windows).
|
|
||||||
CMake can be used to create the build system of your choice, for instance
|
CMake can be used to create the build system of your choice, for instance
|
||||||
Makefiles, Ninja build files, Xcode or Visual Studio IDE projects etc..
|
Makefiles, Ninja build files, Xcode or Visual Studio IDE projects etc..
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
Note: The "classic" build system with autoconf, configure, and Makefiles
|
||||||
Note: usage of autotools, configure, and the included Makefiles
|
is no longer available.
|
||||||
to build the FLTK library is deprecated since FLTK 1.4 and will
|
|
||||||
be removed in the next minor version (1.5).
|
|
||||||
Please consider using CMake instead, see README.CMake.txt.
|
|
||||||
-------------------------------------------------------------------
|
|
||||||
|
|
||||||
Please see README.CMake.txt for how to build FLTK and your application
|
Please see README.CMake.txt for how to build FLTK and your application
|
||||||
programs using CMake. You can stop reading here if you do this.
|
programs using CMake.
|
||||||
|
|
||||||
You can, of course, build FLTK with CMake and your own application(s)
|
You can, of course, build FLTK with CMake and your own application(s)
|
||||||
with your existing and well-known build system.
|
with your existing and well-known build system.
|
||||||
|
|
||||||
If you like the "classic" build system more, continue reading the
|
|
||||||
following chapters but please be aware that configure support will
|
3.3 Building FLTK in a Nutshell
|
||||||
be removed in FLTK 1.5.
|
----------------------------------
|
||||||
|
|
||||||
|
Following are only basic commands, please see details in README.CMake.txt.
|
||||||
|
|
||||||
|
Building FLTK with all default parameters on your platform is easy.
|
||||||
|
Stay in your FLTK source-code directory and type:
|
||||||
|
|
||||||
|
cmake . -B build -D [ CMAKE_BUILD_TYPE=Debug ... more options ]
|
||||||
|
cmake --build build
|
||||||
|
|
||||||
|
The entire FLTK toolkit including many test programs will be built for you
|
||||||
|
in the subdirectory `build`. No warnings should appear. If some do, please
|
||||||
|
let the FLTK developer team know via the mailing list "fltk.general" or
|
||||||
|
view the bug reporting guidelines at https://www.fltk.org/bugs.php .
|
||||||
|
|
||||||
|
|
||||||
3.3 Configuring FLTK with autoconf and configure (deprecated)
|
3.4 Testing FLTK
|
||||||
----------------------------------------------------------------
|
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
|
||||||
Note: usage of autotools, configure, and the included Makefiles
|
|
||||||
to build the FLTK library is deprecated since FLTK 1.4 and will
|
|
||||||
be removed in the next minor version (1.5).
|
|
||||||
Please consider using CMake instead, see README.CMake.txt.
|
|
||||||
-------------------------------------------------------------------
|
|
||||||
|
|
||||||
If you got FLTK via git then you need one extra step. Otherwise skip
|
|
||||||
over this part. Stay in your FLTK source-code directory and type:
|
|
||||||
|
|
||||||
autoconf
|
|
||||||
|
|
||||||
or
|
|
||||||
|
|
||||||
make configure
|
|
||||||
|
|
||||||
Both commands create the configure script for you.
|
|
||||||
|
|
||||||
Now configure your FLTK installation:
|
|
||||||
|
|
||||||
./configure
|
|
||||||
|
|
||||||
Hint: Instead of executing `autoconf` and `configure` followed by `make`
|
|
||||||
to build FLTK (see next section) you can also run `make` directly which
|
|
||||||
will create and execute the 'configure' script with default parameters
|
|
||||||
and build FLTK with the default configuration.
|
|
||||||
|
|
||||||
ADVANCED: type "./configure --help" to get a complete list of optional
|
|
||||||
configuration parameters. These should be pretty self-explanatory. Some
|
|
||||||
more details can be found in README.txt.
|
|
||||||
:END_ADVANCED
|
|
||||||
|
|
||||||
The configuration script will check your machine for the required resources
|
|
||||||
which you should have installed as described in the "Prerequisites" chapter.
|
|
||||||
Review the "Configuration Summary", maybe take some notes.
|
|
||||||
|
|
||||||
|
|
||||||
3.4 Building FLTK
|
|
||||||
--------------------
|
|
||||||
|
|
||||||
Now this is easy. Stay in your FLTK source-code directory and type:
|
|
||||||
|
|
||||||
make
|
|
||||||
|
|
||||||
The entire FLTK toolkit including many test programs will be built for you. No
|
|
||||||
warnings should appear. If some do, please let the FLTK developer team know via
|
|
||||||
the mailing list "fltk.general" or view the bug reporting guidelines at
|
|
||||||
https://www.fltk.org/bugs.php
|
|
||||||
|
|
||||||
|
|
||||||
3.5 Testing FLTK
|
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
After a successful build, you can test FLTK's capabilities:
|
After a successful build, you can test FLTK's capabilities:
|
||||||
|
|
||||||
|
cd build
|
||||||
test/demo
|
test/demo
|
||||||
|
|
||||||
|
|
||||||
3.6 Installing FLTK
|
3.5 Installing FLTK
|
||||||
----------------------
|
----------------------
|
||||||
|
|
||||||
If you did not change any of the configuration settings, FLTK will be installed
|
If you did not change any of the configuration settings, FLTK will be installed
|
||||||
in "/usr/local/include" and "/usr/local/lib" by typing
|
in "/usr/local/include" and "/usr/local/lib" by typing
|
||||||
|
|
||||||
sudo make install
|
sudo cmake --install .
|
||||||
|
|
||||||
If you are using the KDE, GNOME or XFCE desktop environments and want to call
|
in your build folder. Note the trailing '.' .
|
||||||
"fluid" from the desktop menu, you will need to install additional files and
|
|
||||||
icons under "/usr/share" by typing:
|
|
||||||
|
|
||||||
sudo make install-desktop
|
|
||||||
|
|
||||||
It is possible to install FLTK without superuser privileges by changing the
|
It is possible to install FLTK without superuser privileges by changing the
|
||||||
installation path to a location within the user account by adding the
|
installation path to a location within the user account by adding the
|
||||||
"--prefix=PREFIX" parameters to the "./configure" command.
|
"-D CMAKE_INSTALL_PREFIX=<path>" parameters to the "cmake" command.
|
||||||
|
|
||||||
Note: installing FLTK is optional. You can build your own software by using
|
Note: installing FLTK is optional. You can build your own software by using
|
||||||
the FLTK build tree directly. This is recommended if you link your application
|
the FLTK build tree directly. This is recommended if you link your application
|
||||||
@ -415,8 +362,8 @@ shared FLTK libraries you may want to install FLTK, particularly on a production
|
|||||||
system.
|
system.
|
||||||
|
|
||||||
|
|
||||||
3.7 Creating new Projects
|
3.6 Creating Your Own Projects
|
||||||
----------------------------
|
---------------------------------
|
||||||
|
|
||||||
FLTK provides a neat script named "fltk-config" that can provide all the flags
|
FLTK provides a neat script named "fltk-config" that can provide all the flags
|
||||||
needed to build FLTK applications using the same flags that were used to build
|
needed to build FLTK applications using the same flags that were used to build
|
||||||
@ -429,14 +376,16 @@ source file is:
|
|||||||
Since version 1.4.0 `fltk-config --compile` can also be used to build a program
|
Since version 1.4.0 `fltk-config --compile` can also be used to build a program
|
||||||
from multiple source files. See the official docs in chapter "FLTK Basics" and
|
from multiple source files. See the official docs in chapter "FLTK Basics" and
|
||||||
section "Compiling Multiple Source Files with 'fltk-config'":
|
section "Compiling Multiple Source Files with 'fltk-config'":
|
||||||
https://www.fltk.org/doc-1.4/basics.html#basics_fltk_config2
|
https://www.fltk.org/doc-1.5/basics.html#basics_fltk_config2
|
||||||
|
|
||||||
"fltk-config" and "fluid" will be installed in "/usr/local/bin/" by default.
|
"fltk-config" and "fluid" will be installed in "/usr/local/bin/" by default.
|
||||||
We recommend that you add it to the command search path.
|
We recommend that you add it to the command search path.
|
||||||
|
|
||||||
|
For larger projects than just a few source files we recommend to use CMake.
|
||||||
|
Details can be found in README.CMake.txt.
|
||||||
|
|
||||||
|
|
||||||
4 Creating a new Project in Code::Blocks
|
4 Creating a New Project in Code::Blocks
|
||||||
===========================================
|
===========================================
|
||||||
|
|
||||||
Code::Blocks is a free and popular C++ IDE in the Linux world. It also runs on
|
Code::Blocks is a free and popular C++ IDE in the Linux world. It also runs on
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user