diff --git a/CMake/fl_create_example.cmake b/CMake/fl_create_example.cmake index dd4e1bc42..9053fa790 100644 --- a/CMake/fl_create_example.cmake +++ b/CMake/fl_create_example.cmake @@ -115,6 +115,10 @@ macro (CREATE_EXAMPLE NAME SOURCES LIBRARIES) set_target_properties (${TARGET_NAME} PROPERTIES OUTPUT_NAME ${NAME}) target_link_libraries (${TARGET_NAME} ${LIBRARIES}) + if (FLTK_HAVE_CAIRO) + target_link_directories (${TARGET_NAME} PUBLIC ${PKG_CAIRO_LIBRARY_DIRS}) + endif (FLTK_HAVE_CAIRO) + if (ICON_PATH) set_target_properties (${TARGET_NAME} PROPERTIES MACOSX_BUNDLE_ICON_FILE ${ICON_NAME}) set_target_properties (${TARGET_NAME} PROPERTIES RESOURCE ${ICON_PATH}) diff --git a/CMake/fl_debug_var.cmake b/CMake/fl_debug_var.cmake index 4cecf3c7a..865f2a895 100644 --- a/CMake/fl_debug_var.cmake +++ b/CMake/fl_debug_var.cmake @@ -21,7 +21,7 @@ # # This macro displays the name and value of a CMake variable. # The variable name is expanded with spaces to be (at least) -# (currently 24) characters wide for better readability. +# (currently 30) characters wide for better readability. # VARNAME must be a string literal, e.g. WIN32 or "WIN32". # # Syntax: @@ -34,7 +34,7 @@ ####################################################################### macro (fl_debug_var name) - set (min_len 24) + set (min_len 30) set (var "${name}") string(LENGTH "${var}" len) while (len LESS min_len) diff --git a/CMake/options.cmake b/CMake/options.cmake index 142f345ee..008088a45 100644 --- a/CMake/options.cmake +++ b/CMake/options.cmake @@ -145,37 +145,63 @@ if (OPTION_BUILD_HTML_DOCUMENTATION OR OPTION_BUILD_PDF_DOCUMENTATION) endif (OPTION_BUILD_HTML_DOCUMENTATION OR OPTION_BUILD_PDF_DOCUMENTATION) ####################################################################### -include (FindPkgConfig) +# Include optional Cairo support +####################################################################### option (OPTION_CAIRO "use lib Cairo" OFF) option (OPTION_CAIROEXT "use FLTK code instrumentation for Cairo extended use" OFF ) -if ((OPTION_CAIRO OR OPTION_CAIROEXT) AND LIB_CAIRO) +set (FLTK_HAVE_CAIRO 0) +set (FLTK_USE_CAIRO 0) + +if (OPTION_CAIRO OR OPTION_CAIROEXT) pkg_search_module (PKG_CAIRO cairo) -endif ((OPTION_CAIRO OR OPTION_CAIROEXT) AND LIB_CAIRO) -if (PKG_CAIRO_FOUND) - set (FLTK_HAVE_CAIRO 1) - add_subdirectory (cairo) - list (APPEND FLTK_LDLIBS -lcairo -lpixman-1) - include_directories (${PKG_CAIRO_INCLUDE_DIRS}) - string (REPLACE ";" " " CAIROFLAGS "${PKG_CAIRO_CFLAGS}") + # fl_debug_var (PKG_CAIRO_FOUND) + + if (PKG_CAIRO_FOUND) + set (FLTK_HAVE_CAIRO 1) + if (OPTION_CAIROEXT) + set (FLTK_USE_CAIRO 1) + endif (OPTION_CAIROEXT) + add_subdirectory (cairo) + + # fl_debug_var (PKG_CAIRO_INCLUDE_DIRS) + # fl_debug_var (PKG_CAIRO_CFLAGS) + # fl_debug_var (PKG_CAIRO_STATIC_CFLAGS) + # fl_debug_var (PKG_CAIRO_LIBRARIES) + # fl_debug_var (PKG_CAIRO_STATIC_LIBRARIES) + + include_directories (${PKG_CAIRO_INCLUDE_DIRS}) + + # Cairo libs and flags for fltk-config + + # Hint: use either PKG_CAIRO_* or PKG_CAIRO_STATIC_* variables to + # create the list of libraries used to link programs with cairo + # by running fltk-config --use-cairo --compile ... + # Currently we're using the non-STATIC variables to link cairo shared. + + set (CAIROLIBS) + foreach (lib ${PKG_CAIRO_LIBRARIES}) + list (APPEND CAIROLIBS "-l${lib}") + endforeach() + + string (REPLACE ";" " " CAIROLIBS "${CAIROLIBS}") + string (REPLACE ";" " " CAIROFLAGS "${PKG_CAIRO_CFLAGS}") + + # fl_debug_var (FLTK_LDLIBS) + # fl_debug_var (CAIROFLAGS) + # fl_debug_var (CAIROLIBS) - if (LIB_CAIRO AND OPTION_CAIROEXT) - set (FLTK_USE_CAIRO 1) - set (FLTK_CAIRO_FOUND TRUE) else () - set (FLTK_CAIRO_FOUND FALSE) - endif (LIB_CAIRO AND OPTION_CAIROEXT) -else () - if (OPTION_CAIRO OR OPTION_CAIROEXT) message (STATUS "*** Cairo was requested but not found - please check your cairo installation") message (STATUS "*** or disable options OPTION_CAIRO and OPTION_CAIRO_EXT.") message (FATAL_ERROR "*** Terminating: missing Cairo libs or headers.") - endif (OPTION_CAIRO OR OPTION_CAIROEXT) -endif (PKG_CAIRO_FOUND) + endif (PKG_CAIRO_FOUND) + +endif (OPTION_CAIRO OR OPTION_CAIROEXT) ####################################################################### option (OPTION_USE_SVG "read/write SVG files" ON) diff --git a/CMake/resources.cmake b/CMake/resources.cmake index 3ec95b3b6..57173f206 100644 --- a/CMake/resources.cmake +++ b/CMake/resources.cmake @@ -2,7 +2,7 @@ # Resource definitions to build the FLTK project using CMake (www.cmake.org) # Written by Michael Surette # -# Copyright 1998-2020 by Bill Spitzak and others. +# Copyright 1998-2021 by Bill Spitzak and others. # # This library is free software. Distribution and use rights are outlined in # the file "COPYING" which should have been included with this file. If this @@ -35,7 +35,19 @@ macro (fl_find_header VAR HEADER) endif (NOT CMAKE_REQUIRED_QUIET) endmacro (fl_find_header) +####################################################################### +# Include FindPkgConfig for later use of pkg-config +####################################################################### + +include (FindPkgConfig) + +# fl_debug_var (PKG_CONFIG_FOUND) +# fl_debug_var (PKG_CONFIG_EXECUTABLE) +# fl_debug_var (PKG_CONFIG_VERSION_STRING) + +####################################################################### # Find header files... +####################################################################### fl_find_header (HAVE_ALSA_ASOUNDLIB_H alsa/asoundlib.h) fl_find_header (HAVE_DLFCN_H dlfcn.h) @@ -150,7 +162,6 @@ mark_as_advanced (FREETYPE_PATH) ####################################################################### # libraries -find_library (LIB_CAIRO cairo) find_library (LIB_dl dl) if ((NOT APPLE) OR OPTION_APPLE_X11) find_library (LIB_fontconfig fontconfig) @@ -163,7 +174,7 @@ find_library (LIB_jpeg jpeg) find_library (LIB_png png) find_library (LIB_zlib z) -mark_as_advanced (LIB_CAIRO LIB_dl LIB_fontconfig LIB_freetype) +mark_as_advanced (LIB_dl LIB_fontconfig LIB_freetype) mark_as_advanced (LIB_GL LIB_MesaGL LIB_GLEW) mark_as_advanced (LIB_jpeg LIB_png LIB_zlib) diff --git a/README.Cairo.txt b/README.Cairo.txt index d4b519d2a..47eabda4d 100644 --- a/README.Cairo.txt +++ b/README.Cairo.txt @@ -1,22 +1,28 @@ -README.Cairo.txt - 2011-12-10 - Cairo rendering support for FLTK ----------------------------------------------------------------- - +README.Cairo.txt - Cairo rendering support for FLTK +---------------------------------------------------- CONTENTS ========== 1 INTRODUCTION - 2 CAIRO SUPPORT FOR FLTK 1.3 - 2.1 Configuration - 2.2 Currently supported features - 2.3 Future considerations - 3 PLATFORM SPECIFIC NOTES - 3.1 Linux - 3.2 Windows - 3.3 Mac OSX - 4 DOCUMENT HISTORY + 2 CAIRO SUPPORT FOR FLTK + 2.1 Configuration + 2.2 Currently supported features + 2.3 Future considerations + + 3 PLATFORM SPECIFIC NOTES + 3.1 Linux + 3.1.1 Debian and Derivatives (like Ubuntu) + 3.1.2 CentOS from Greg (erco@seriss.com) + 3.2 Windows + 3.3 macOS + 3.3.1 Install Xcode Commandline Tools + 3.3.2 Install Homebrew for Cairo and other Library Support + 3.3.3 Install CMake and Build with CMake + + 4 DOCUMENT HISTORY INTRODUCTION @@ -28,14 +34,13 @@ primitives for 2-dimensional drawing across a number of different backends. Cairo is designed to use hardware acceleration when available. - CAIRO SUPPORT FOR FLTK 1.3 -============================ + CAIRO SUPPORT FOR FLTK +======================== -It is now possible to integrate cairo rendering in your FLTK application +It is now possible to integrate Cairo rendering in your FLTK application more easily and transparently. -In 1.3, we provide minimum support for Cairo, -in particular, no "total" cairo rendering layer support is achieved, -as in fltk2. +Since FLTK 1.3 we provide minimum support for Cairo; no "total" Cairo +rendering layer support is achieved. Configuration @@ -53,25 +58,25 @@ variable OPTION_CAIRO:BOOL=ON is set. integration of a Cairo draw callback without the need to subclass Fl_Window. (2) Adding a Fl::cairo_make_current(Fl_Window*) function only providing - transparently a cairo context to your custom Fl_Window derived class. + transparently a Cairo context to your custom Fl_Window derived class. This function is intended to be used in your overloaded draw() method. -(3) Adding an optional cairo autolink context mode support which permits +(3) Adding an optional Cairo autolink context mode support which permits complete and automatic synchronization of OS dependent graphical context - and cairo contexts, thus furthering a valid cairo context anytime, + and Cairo contexts, thus furthering a valid Cairo context anytime, in any current window. This feature should be only necessary in the following cases: - - Intensive and almost systematic use of cairo in an FLTK application - - Creation of a new cairo based scheme for FLTK - - Other uses of cairo necessitating the FLTK internal instrumentation - to automatically making possible the use of a cairo context + - Intensive and almost systematic use of Cairo in an FLTK application + - Creation of a new Cairo based scheme for FLTK + - Other uses of Cairo necessitating the FLTK internal instrumentation + to automatically making possible the use of a Cairo context in any FLTK window. This feature must be enabled with 'configure --enable-cairoext' or the CMake variable OPTION_CAIROEXT:BOOL=ON (Default: OFF). -(4) A new cairo demo that is available in the test subdirectory and has +(4) A new Cairo demo that is available in the test subdirectory and has been used as a testcase during the multiplatform tests. For more details, please have a look to the doxygen documentation, @@ -83,16 +88,16 @@ in the Modules section. From Bill: First there is the FLTK_HAVE_CAIRO configuration option. This indicates that -any cairo calls are available. In this case you get something like this: +any Cairo calls are available. In this case you get something like this: -// static variable holding the last cairo context FLTK set: +// static variable holding the last Cairo context FLTK set: cairo_t* Fl::cr; // Make cr draw in this window. This hides the ugly platform-dependent -// part of getting cairo going: +// part of getting Cairo going: void Fl::cairo_make_current(Fl_Window*) -*** POST 1.3 potential cairo use: +*** POST 1.3 potential Cairo use: // Set cr to something you made yourself. This lets you reuse functions // that use cr, and also tells FLTK that cr is not one of its own and // thus cannot be destroyed or reused for a different window: @@ -117,19 +122,19 @@ on the various supported operating systems. 3.1 Linux --------- - 3.1.1 Debian and derivatives (like Ubuntu) - ----------------------------------------------------- + 3.1.1 Debian and Derivatives (like Ubuntu) + ------------------------------------------- Run from a terminal command line: sudo apt install libcairo2-dev - Then build fltk using the cairo additional option using: + Then build fltk using the Cairo support option using: cmake -G"Unix Makefiles" -DOPTION_CAIRO:BOOL=ON -S -B cd make 3.1.2 CentOS from Greg (erco@seriss.com) - --------------------------------------------------- + ----------------------------------------- To get FLTK 1.3.x (r9204) to build on Centos 5.5, I found that I only needed to install the "cairo-devel" package, ie: @@ -158,7 +163,7 @@ on the various supported operating systems. ..then another 'make' should finish the build without errors. 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 Ubuntu" you need to install libcairo2-dev, i.e. sudo apt-get install libcairo2-dev @@ -167,16 +172,101 @@ on the various supported operating systems. installs libpixman-1-dev, so that dependencies on this should be resolved as well. + As of Feb 2021 (FLTK 1.4.0) dependencies like pixman-1 will be detected by + configure or CMake automatically using pkg-config. + + Note 1: CMake builds *require* the use of pkg-config. + + Note 2: As of Feb 2021 autoconf/configure/make builds require pkg-config + as well but there are plans to implement a fallback mechanism so you can + build FLTK w/o having to install and use pkg-config. This will be done if + possible (but not guaranteed). + 3.2 Windows - ----------- + ------------ TBD - 3.3 Mac OSX - ----------- - TBD + 3.3 macOS + ---------- + As under Linux you can use both build options, i.e. autoconf/make or CMake + to build FLTK with Cairo support. One option is to install Homebrew and + add the required libraries with `brew install ...'. It is always required + to install 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. + The following instructions are intentionally terse. More detailed + information can be found in README.macOS.md and README.CMake.txt. + + + 3.3.1 Install Xcode Commandline Tools + -------------------------------------- + Launch a "Terminal" and execute `xcode-select --install', then select to + install the Xcode commandline tools. This installs the required compilers + and build tools, for instance `git' (commandline only) and `clang'. + + 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 + tarball and run `make' in the root directory. This will run `configure', + 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 + ----------------------------------------------------------- + There are several options to install additional library support under + macOS. macOS does not provide a package manager to install such software. + This README is about installing and using Homebrew as a package manager + to build FLTK with Cairo, everything else (for instance "Fink") is beyond + the scope of this README. + + This was tested on a MacBook Air 2020 (M1) with the new Apple Silicon M1 + (ARM) processor. + + Go to https://brew.sh/ and follow the instructions under "Install Homebrew". + Before you do this, read about the security implications - the FLTK team + is not responsible for your system security. Read their docs on how to + install and use Homebrew. + + If you installed Homebrew correctly you can use `brew search cairo' or any + other software (package) name to see if it can be installed. If yes, run + `brew install cairo' (or other name) to install it. + + Other helpful packages are 'autoconf' and other Unix (Linux) tools, for + instance 'git-gui' (installs 'gitk' and 'git gui' commands). The Xcode + commandline tools mentioned above install only the git commandline tool. + + + 3.3.3 Install CMake and Build with CMake + ----------------------------------------- + Either use `brew install cmake' or go to https://cmake.org/download/ + and download the latest stable CMake release for macOS, for instance + 'cmake-3.19.6-macos-universal.dmg' (at the time of this writing). Open + (mount) this .dmg file in the Finder. In the shown window you can either + run CMake directly or drag the CMake application to the "Applications" + folder to install it (recommended). Then you can run CMake from your + Applications folder or using "launchpad". See README.macOS.md for + instructions to install the downloaded CMake GUI tool for use with the + commandline. + + Once you start the CMake GUI version you can select your source folder + (where you downloaded FLTK) and the build folder (either a subdirectory, + e.g. 'build' or another folder anywhere else) and click "configure". + Follow the instructions and select either "native compilers" or Xcode or + whatever you like to build your FLTK library. In the CMake GUI you need + to select OPTION_CAIRO (ON) to build with basic Cairo support. Finally + click "generate" to create the build files. + + For more information on using CMake to build FLTK see README.CMake.txt. DOCUMENT HISTORY @@ -186,3 +276,4 @@ Dec 20 2010 - matt: restructured document Dec 09 2011 - greg: Updates for Centos 5.5 builds Dec 10 2011 - Albrecht: Updates for Ubuntu and Debian, fixed typos. Jul 05 2017 - Albrecht: Added CMake config info, fixed typos. +Feb 28 2021 - Albrecht: Update for FLTK 1.4, add macOS instructions. diff --git a/README.macOS.md b/README.macOS.md index 6cef26876..811b83bd8 100644 --- a/README.macOS.md +++ b/README.macOS.md @@ -44,6 +44,9 @@ _README.macOS.md - Building FLTK under Apple macOS_ FLTK supports macOS version 10.3 Panther and above. At the time of writing (Jan. 2019), FLTK compiles and runs fine on the most recent macOS 10.14 Mojave. +Update (March 2021): FLTK builds and runs fine on macOS 11 (Big Sur) on Intel and +the new M1 Apple Silicon (Arm) processors. + FLTK 1.4 supports the following build environments on the macOS platform: @@ -76,7 +79,7 @@ user input, but will likely take well over an hour. compiler independent configuration files, and generate native makefiles and workspaces that can be used in the compiler environment of your choice." -Please download and install the Mac OS X version of _CMake_ from +Please download and install the macOS version of _CMake_ from [www.cmake.org](https://cmake.org/download/). Download the .dmg file, click it, and when the Finder window opens, drag the _CMake_ icon into the Applications folder. @@ -91,17 +94,17 @@ _pull_ the newest release. If you want to use _Xcode_ to clone the FLTK GitHub repository, you will have to give _Xcode_ access to your GitHub Account in the _Xcode_ preferences. If you don't have a GitHub account, or don't want to share your credentials with _Xcode_, you can use still the command -line `git clone https://github.com/fltk/fltk.git fltk-1.4.git` -to ceck out the repo. +line `git clone https://github.com/fltk/fltk.git fltk-1.4` +to check out the repo. Start _Xcode_. Select `Source Control >> Clone...` in the main menu. A dialog box will open with a search field and a list of repositories. Enter `fltk/fltk` in -the search field. A list of matchin repositories appears. The first one should be named `fltk` +the search field. A list of matching repositories appears. The first one should be named `fltk` and be owned by `fltk`. Select it and click _Clone_. -A file chooser appears. Navigate to your home directory. The create a new folder named -`dev`. Enter `fltk-1.4.git` in the _Save As:_ field and click _Clone_, then _Done_ in the +A file chooser appears. Navigate to your home directory. Create a new folder named +`dev`. Enter `fltk-1.4` in the _Save As:_ field and click _Clone_, then _Done_ in the previous dialog. The local copy of your repository can be updated by loading it into _Xcode_ and selecting @@ -110,23 +113,23 @@ The local copy of your repository can be updated by loading it into _Xcode_ and ### Configuring FLTK (CMake, Xcode) -Launch _CMake_ by pressing Command+Spacebar, the type _CMake_ and press return. +Launch _CMake_ by pressing Command+Spacebar, then type _CMake_ and press return. _CMake_ should open with a large dialog box. The first input field is labeled with _Where is the source code:_ . Click on _Browse Source..._ -and navigate to your home folder, then `dev`, then `fltk-1.4.git`. Click _Open_. +and navigate to your home folder, then `dev`, then `fltk-1.4`. Click _Open_. The next input field is marked _Where to build the binaries:_. Click _Browse Build..._ -and navigate to your home folder, then `dev`, then `fltk-1.4.git`, then use _New Folder_ +and navigate to your home folder, then `dev`, then `fltk-1.4`, then use _New Folder_ to create a folder named `build`, and inside that, create a folder named `Xcode`. Click _Open_. The top two input fields should read ``` -/Users/your_name/dev/fltk-1.4.git +/Users/your_name/dev/fltk-1.4 ``` and ``` -/Users/your_name/dev/fltk-1.4.git/build/Xcode +/Users/your_name/dev/fltk-1.4/build/Xcode ``` Back in the _CMake_ main window, click _Configure_, select _Xcode_ as the generator and @@ -150,7 +153,7 @@ _CMake_ will be smart enough to update the build files as well. Now this is easy if all the previous steps were successful. If you are still in _CMake_, just click _Open Project_ and _CMake_ will launch _XCode_ for you. If not, just launch _XCode_ and -open `Macintosh HD⁩ ▸ ⁨Users⁩ ▸ your_name⁩ ▸ ⁨dev⁩ ▸ ⁨fltk-1.4.git⁩ ▸ ⁨build⁩ ▸ ⁨Xcode⁩ ▸ ⁨FLTK.xcodeproj`. +open `Macintosh HD⁩ ▸ ⁨Users⁩ ▸ your_name⁩ ▸ ⁨dev⁩ ▸ ⁨fltk-1.4⁩ ▸ ⁨build⁩ ▸ ⁨Xcode⁩ ▸ ⁨FLTK.xcodeproj`. _XCode_ may or may not ask to Autocreate Schemes. Click _Automatically Create Schemes_. @@ -176,8 +179,7 @@ permission. ### Creating new Projects (CMake, Xcode) -TODO: we still need to write a simple CMake file for creating a minimal cross platform app. - +See README.CMake.txt ## How to Build FLTK Using _CMake_ and _make_ @@ -197,7 +199,7 @@ In order to build FLTK, you need to install _CMake_ and the _Xcode_ command line compiler independent configuration files, and generate native makefiles and workspaces that can be used in the compiler environment of your choice." -Please download and install the Mac OS X version of _CMake_ from +Please download and install the macOS version of _CMake_ from [www.cmake.org](https://cmake.org/download/). Download the .dmg file, click it, and when the Finder window opens, drag the _CMake_ icon into the Applications folder. @@ -229,7 +231,7 @@ Downloading FLTK is explained [here](#bam_download). ### Configuring FLTK (CMake, make) -Using you shell in the terminal, make sure that you are in the root directory of your +Using your shell in the terminal, make sure that you are in the root directory of your FLTK source code tree. Create a directory where all FLTK binaries will be built: @@ -253,7 +255,7 @@ cmake -G "Unix Makefiles" \ _CMake_ runs a number of tests to find external headers, libraries, and tools. The configuration summary should not show any errors. You can now continue to build FLTK. -For the advanced user, there are a few more optinons to the _CMake_ setup. Type +For the advanced user there are a few more options to the _CMake_ setup. Type `cmake -L ../..` to get a complete list of options. These should be pretty self-explanatory. Some more details can be found in [online documentation](https://www.fltk.org/doc-1.4/intro.html#intro_unix). @@ -278,7 +280,7 @@ symbols. This is normal and can safely be ignored. After a successful build, you can test FLTK's capabilities by running ```bash -open bin/examples/demo.app +open bin/test/demo.app ``` @@ -380,8 +382,8 @@ cd dev Now create a copy of the source code archive at Github on your local file system: ```bash -git clone https://github.com/fltk/fltk.git fltk-1.4.git -cd fltk-1.4.git +git clone https://github.com/fltk/fltk.git fltk-1.4 +cd fltk-1.4 ``` @@ -394,9 +396,9 @@ If you are configuring fltk for the first time, you need to instruct FLTK to cre very basic configuration files. Type: ```bash -NOCONFIGURE=1 ./autogen.sh +autoconf ``` -This script may generate a few error messages which you can sefely ignore. +This creates the configure script. Now configure your FLTK installation. Stay in your FLTK source-code directory and type @@ -408,7 +410,7 @@ and type The configuration script runs a number of tests to find external headers, libraries, and tools. The configuration summary should not show any errors. You can now continue to build FLTK. -For the advanced user, there are a few more optinons to the _configure_ script. Type +For the advanced user there are a few more optinons to the _configure_ script. Type `./configure --help` to get a complete list of options. These should be pretty self-explanatory. Some more details can be found in [online documentation](https://www.fltk.org/doc-1.4/intro.html#intro_unix). @@ -512,9 +514,9 @@ to the Info.plist file you have prepared. - Feb 24 2011 - Manolo: architecture flags are not propagated to the fltk-config script. - Apr 17 2012 - matt: added Xcode4 documentation - Nov 13 2012 - Manolo: added "MAKE AN APPLICATION LAUNCHABLE BY DROPPING FILES ON ITS ICON" -- Apr 28 2014 - Manolo: how to build programs that run on various Mac OS X versions +- Apr 28 2014 - Manolo: how to build programs that run on various macOS versions - Mar 18 2015 - Manolo: removed uses of the Xcode3 project -- Apr 01 2016 - AlbrechtS: corrected typo, formatted most line breaks < 80 columns -- Dec 04 2018 - AlbrechtS: fix typo (lowercase fluid.app) for case sensitive macOS +- Apr 01 2016 - Albrecht: corrected typo, formatted most line breaks < 80 columns +- Dec 04 2018 - Albrecht: fix typo (lowercase fluid.app) for case sensitive macOS - Dec 28 2018 - Matt: complete rework for FLTK 1.4 - +- Mar 01 2021 - Albrecht: minor updates, macOS Big Sur and Apple Silicon M1 (ARM) diff --git a/cairo/Fl_Cairo.cxx b/cairo/Fl_Cairo.cxx index 28c0079f1..0ebd04b97 100644 --- a/cairo/Fl_Cairo.cxx +++ b/cairo/Fl_Cairo.cxx @@ -1,7 +1,7 @@ // // Main header file for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2018 by Bill Spitzak and others. +// Copyright 1998-2021 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -124,9 +124,9 @@ static cairo_surface_t * cairo_create_surface(void * gc, int W, int H) { cairo_t * Fl::cairo_make_current(void *gc) { int W=0,H=0; #if defined(USE_X11) - //FIXME X11 get W,H - // gc will be the window handle here -# warning FIXME get W,H for cairo_make_current(void*) + // FIXME X11 get W,H + // gc will be the window handle here + // # warning FIXME get W,H for cairo_make_current(void*) #elif defined(__APPLE_QUARTZ__) if (fl_window) { W = Fl_Window::current()->w(); diff --git a/configure.ac b/configure.ac index af4e6bd66..265598bb4 100644 --- a/configure.ac +++ b/configure.ac @@ -211,8 +211,7 @@ AS_IF([test x$enable_cairoext = xyes], [ AC_DEFINE([FLTK_HAVE_CAIRO]) CAIRODIR="cairo" CAIROFLAGS="$($PKGCONFIG --cflags cairo)" - # TODO: Use pkg-config to get cairo libraries - CAIROLIBS="-lcairo -lpixman-1" + CAIROLIBS="$($PKGCONFIG --libs cairo)" CXXFLAGS="$CAIROFLAGS $CXXFLAGS" LINKFLTKCAIRO="../lib/libfltk_cairo.a" FLTKCAIROOPTION="-L ../cairo -lfltk_cairo$SHAREDSUFFIX" @@ -226,8 +225,7 @@ AS_IF([test x$enable_cairoext = xyes], [ AC_DEFINE(FLTK_HAVE_CAIRO) CAIRODIR="cairo" CAIROFLAGS="$($PKGCONFIG --cflags cairo)" - # TODO: Use pkg-config to get cairo libraries - CAIROLIBS="-lcairo -lpixman-1" + CAIROLIBS="$($PKGCONFIG --libs cairo)" CXXFLAGS="$CAIROFLAGS $CXXFLAGS" LINKFLTKCAIRO="../lib/libfltk_cairo.a" FLTKCAIROOPTION="-L ../cairo -lfltk_cairo$SHAREDSUFFIX" diff --git a/fluid/CMakeLists.txt b/fluid/CMakeLists.txt index d429affe2..fcf4cedb1 100644 --- a/fluid/CMakeLists.txt +++ b/fluid/CMakeLists.txt @@ -1,7 +1,7 @@ # # CMakeLists.txt to build fluid for the FLTK project using CMake (www.cmake.org) # -# Copyright 1998-2020 by Bill Spitzak and others. +# Copyright 1998-2021 by Bill Spitzak and others. # # This library is free software. Distribution and use rights are outlined in # the file "COPYING" which should have been included with this file. If this @@ -69,7 +69,10 @@ else () add_executable (fluid WIN32 ${CPPFILES}) endif (APPLE AND (NOT OPTION_APPLE_X11) AND (NOT OPTION_APPLE_SDL)) -target_link_libraries(fluid fltk fltk_images fltk_forms) +target_link_libraries (fluid fltk fltk_images fltk_forms) +if (FLTK_HAVE_CAIRO) + target_link_directories (fluid PUBLIC ${PKG_CAIRO_LIBRARY_DIRS}) +endif (FLTK_HAVE_CAIRO) # install fluid diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4e8d8c759..7c64a3a9d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -518,7 +518,7 @@ endif (WIN32) if (FLTK_HAVE_CAIRO) list (APPEND OPTIONAL_LIBS fltk_cairo ${PKG_CAIRO_LIBRARIES}) -ENDif (FLTK_HAVE_CAIRO) +endif (FLTK_HAVE_CAIRO) if (HAVE_XINERAMA) list (APPEND OPTIONAL_LIBS ${X11_Xinerama_LIB}) @@ -537,10 +537,9 @@ if (HAVE_XRENDER) endif (HAVE_XRENDER) if (USE_PANGO) - list (APPEND OPTIONAL_LIBS ${HAVE_LIB_PANGO} ${HAVE_LIB_PANGOXFT} ${HAVE_LIB_PANGOCAIRO} ${HAVE_LIB_CAIRO} ${HAVE_LIB_GOBJECT}) - #if (NOT APPLE) - # list (APPEND OPTIONAL_LIBS ${HAVE_LIB_GOBJECT} ) - #endif (NOT APPLE) + ### FIXME ### This needs to use the PKG_* variables directly + list (APPEND OPTIONAL_LIBS ${HAVE_LIB_PANGO} ${HAVE_LIB_PANGOXFT} ${HAVE_LIB_PANGOCAIRO}) + list (APPEND OPTIONAL_LIBS ${HAVE_LIB_CAIRO} ${HAVE_LIB_GOBJECT}) endif (USE_PANGO) if (USE_XFT) diff --git a/test/Makefile b/test/Makefile index 8dc808edd..b3f213119 100644 --- a/test/Makefile +++ b/test/Makefile @@ -181,7 +181,6 @@ ALL = \ tree$(EXEEXT) \ twowin$(EXEEXT) \ valuators$(EXEEXT) \ - cairotest$(EXEEXT) \ utf8$(EXEEXT) \ windowfocus$(EXEEXT)