This is an excellent article by Ian about making portable makefiles using fltk-configHowever this makes a vanilla Makefile, and most of us use IDEs like Visual Studio and Xcode.Is there a way to use fltk-config inside the Flags and linker fields within these IDE settings ?
git clone https://github.com/fltk/fltk.git fltk-1.4
cd fltk-1.4
mkdir build
cd build
mkdir Xcode
cd Xcode
cmake -G "Xcode" \
-D OPTION_USE_SYSTEM_LIBJPEG=Off \
-D OPTION_USE_SYSTEM_ZLIB=Off \
-D OPTION_USE_SYSTEM_LIBPNG=Off \
../..
Now open the .xcodeproj with Xcode and
Xcode will ask to Autocreate Schemes. Click Automatically Create Schemes.
In Xcode, set the 'active Scheme' to 'fltk' and press CMD+R to compile
Right click on scheme and Open in Finder.
Now, close the fltk project. <-- THIS IS IMPORTANT as the project must not be open
You can drag the fltk xcodeproj to your custom project, and add under
Target->Build Phases->Dependencies and
Target->Build Phases->Link Library with binaries
Now the static lib and headers are automatically picked up in your project.