2016-04-01 14:10:18 +03:00
|
|
|
README.OSX.txt - 2016-04-01 - Building FLTK under Apple OS X
|
2010-10-24 02:50:39 +04:00
|
|
|
------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CONTENTS
|
2016-04-01 14:10:18 +03:00
|
|
|
==========
|
2010-10-24 02:50:39 +04:00
|
|
|
|
|
|
|
1 INTRODUCTION
|
|
|
|
2 HOW TO BUILD FLTK USING GCC
|
|
|
|
2.1 Prerequisites
|
|
|
|
2.2 Downloading and Unpacking
|
|
|
|
2.3 Configuring FLTK
|
|
|
|
2.4 Building FLTK
|
|
|
|
2.5 Testing FLTK
|
|
|
|
2.6 Installing FLTK
|
|
|
|
2.7 Creating new Projects
|
|
|
|
3 HOW TO BUILD FLTK USING XCODE3
|
|
|
|
3.1 Prerequisites
|
|
|
|
3.2 Downloading and Unpacking
|
|
|
|
3.3 Configuring FLTK
|
|
|
|
3.4 Building FLTK
|
|
|
|
3.5 Testing FLTK
|
2010-10-25 00:53:36 +04:00
|
|
|
3.6 Uninstalling previous versions of FLTK
|
|
|
|
3.7 Installing FLTK
|
|
|
|
3.8 Installing Little Helpers
|
|
|
|
3.9 Creating new Projects
|
2012-04-18 00:14:16 +04:00
|
|
|
4 HOW TO BUILD FLTK USING XCODE4
|
|
|
|
4.1 Prerequisites
|
|
|
|
4.2 Downloading and Unpacking
|
|
|
|
4.3 Configuring FLTK
|
|
|
|
4.4 Building FLTK
|
|
|
|
4.5 Testing FLTK
|
|
|
|
4.6 Uninstalling previous versions of FLTK
|
|
|
|
4.7 Installing FLTK
|
2012-11-13 17:03:20 +04:00
|
|
|
5 MAKE AN APPLICATION LAUNCHABLE BY DROPPING FILES ON ITS ICON
|
|
|
|
6 DOCUMENT HISTORY
|
2010-10-24 02:50:39 +04:00
|
|
|
|
|
|
|
|
2010-10-30 18:51:32 +04:00
|
|
|
1 INTRODUCTION
|
|
|
|
=================
|
2010-10-24 02:50:39 +04:00
|
|
|
|
2014-04-28 20:27:55 +04:00
|
|
|
FLTK supports all Mac OS X versions above 10.3 (Panther). See below for how to
|
|
|
|
build FLTK applications that can run on all (old or recent) Mac OS X versions.
|
|
|
|
|
2010-10-24 02:50:39 +04:00
|
|
|
FLTK currently supports the following development environments on the Apple OS X
|
|
|
|
platform:
|
|
|
|
|
|
|
|
- gcc command line tools
|
2014-04-28 20:27:55 +04:00
|
|
|
- Xcode 3.x and higher
|
2016-04-01 14:10:18 +03:00
|
|
|
|
2010-10-24 02:50:39 +04:00
|
|
|
CAUTION: gcc command line built libraries and Xcode created Frameworks should
|
2016-04-01 14:10:18 +03:00
|
|
|
not be mixed!
|
2010-10-24 02:50:39 +04:00
|
|
|
|
|
|
|
|
2010-10-30 18:51:32 +04:00
|
|
|
2 HOW TO BUILD FLTK USING GCC
|
|
|
|
================================
|
2010-10-24 02:50:39 +04:00
|
|
|
|
|
|
|
|
2010-10-30 18:51:32 +04:00
|
|
|
2.1 Prerequisites
|
|
|
|
--------------------
|
2010-10-24 02:50:39 +04:00
|
|
|
|
|
|
|
In order to build FLTK from the command line, you need to install the Xcode
|
2015-03-18 15:49:18 +03:00
|
|
|
developer environment. It can be downloaded from the Apple Store for free.
|
2010-10-24 02:50:39 +04:00
|
|
|
|
|
|
|
After downloading and installing, you need to launch the Terminal. Terminal.app
|
2016-04-01 14:10:18 +03:00
|
|
|
is located in the "Utilities" folder inside the "Applications" folder. I like
|
|
|
|
to keep the Terminal in the Dock.
|
2010-10-24 02:50:39 +04:00
|
|
|
|
|
|
|
|
2010-10-30 18:51:32 +04:00
|
|
|
2.2 Downloading and Unpacking
|
|
|
|
--------------------------------
|
2010-10-24 02:50:39 +04:00
|
|
|
|
|
|
|
Download FLTK from here:
|
|
|
|
|
|
|
|
http://www.fltk.org/software.php
|
|
|
|
|
2016-04-01 14:10:18 +03:00
|
|
|
If you are familiar with "subversion" and like to stay current with your
|
|
|
|
version, you will find the subversion access parameters at the bottom of that
|
|
|
|
page. Unpack FLTK into a convenient location. I like to have everything in my
|
2010-10-26 14:31:44 +04:00
|
|
|
dev directory:
|
2010-10-24 02:50:39 +04:00
|
|
|
|
|
|
|
cd
|
|
|
|
mkdir dev
|
|
|
|
cd dev
|
|
|
|
mv ~/Downloads/fltk-1.3.xxxx.tar.gz .
|
|
|
|
tar xvfz fltk-1.3.xxxx.tar.gz
|
|
|
|
cd fltk-1.3.xxxx
|
|
|
|
|
2016-04-01 14:10:18 +03:00
|
|
|
If you got FLTK via subversion then you need one extra step: build the
|
|
|
|
configure script. Otherwise skip the following part marked ADVANCED:
|
2010-10-24 02:50:39 +04:00
|
|
|
|
2015-03-18 15:49:18 +03:00
|
|
|
ADVANCED: (only if you got FLTK via subversion)
|
|
|
|
- The preferred procedure is to build the configure script using tools
|
|
|
|
called autoconf and automake. If these tools are not both available
|
|
|
|
on your system, this post
|
|
|
|
http://www.fltk.org/newsgroups.php?s15486+gfltk.coredev+v15499
|
|
|
|
details how to get them.
|
|
|
|
|
|
|
|
Then, stay in your FLTK source-code directory and type the following:
|
2013-12-13 14:19:54 +04:00
|
|
|
|
|
|
|
NOCONFIGURE=1 ./autogen.sh
|
2010-10-24 02:50:39 +04:00
|
|
|
|
2015-03-18 15:49:18 +03:00
|
|
|
- Alternatively, copy the configure script from the last FLTK weekly snapshot
|
|
|
|
to your svn source-code directory.
|
|
|
|
|
|
|
|
:END_ADVANCED
|
|
|
|
|
|
|
|
|
|
|
|
2.3 Configuring FLTK
|
|
|
|
-----------------------
|
|
|
|
|
|
|
|
|
2016-04-01 14:10:18 +03:00
|
|
|
Now configure your FLTK installation: stay in your FLTK source-code directory
|
|
|
|
and type
|
2010-10-24 02:50:39 +04:00
|
|
|
|
|
|
|
./configure
|
2016-04-01 14:10:18 +03:00
|
|
|
|
2016-10-03 19:12:51 +03:00
|
|
|
CAVEAT: if configure sends this error message :
|
|
|
|
configure: error: cannot run /bin/sh ./config.sub
|
|
|
|
type
|
|
|
|
make
|
|
|
|
and interrupt the building process. Then, run ./configure again.
|
|
|
|
:END CAVEAT
|
|
|
|
|
2016-04-01 14:10:18 +03:00
|
|
|
ADVANCED: type "./configure --help" to get a complete list of optional
|
2011-02-24 13:27:33 +03:00
|
|
|
configurations parameters. These should be pretty self-explanatory. Some
|
2016-04-01 14:10:18 +03:00
|
|
|
more details can be found in README.
|
2010-10-24 02:50:39 +04:00
|
|
|
|
2015-03-18 15:03:08 +03:00
|
|
|
To create multi-architecture binaries, start "configure" with these flags:
|
|
|
|
./configure --with-archflags="-arch i386 -arch x86_64"
|
2016-04-01 14:10:18 +03:00
|
|
|
|
2014-04-28 20:27:55 +04:00
|
|
|
To create applications that can run under Mac OS X 10.4 and above, use these flags:
|
|
|
|
./configure CXXFLAGS="-mmacosx-version-min=10.4" LDFLAGS="-mmacosx-version-min=10.4"
|
|
|
|
|
2010-10-24 02:50:39 +04:00
|
|
|
:END_ADVANCED
|
|
|
|
|
|
|
|
The configuration script will check your machine for the required resources
|
2016-04-01 14:10:18 +03:00
|
|
|
which should all have been part of your Xcode installation. Review the
|
2010-10-24 02:50:39 +04:00
|
|
|
Configuration Summary, maybe take some notes.
|
|
|
|
|
|
|
|
|
2010-10-30 18:51:32 +04:00
|
|
|
2.4 Building FLTK
|
|
|
|
--------------------
|
2010-10-24 02:50:39 +04:00
|
|
|
|
2016-04-01 14:10:18 +03:00
|
|
|
Now this is easy. Stay in your FLTK source-code directory and type:
|
2010-10-24 02:50:39 +04:00
|
|
|
|
|
|
|
make
|
|
|
|
|
2016-04-01 14:10:18 +03:00
|
|
|
The entire FLTK toolkit including many test programs will be built for you. No
|
2010-10-30 18:51:32 +04:00
|
|
|
warnings should appear, but "ranlib" may complain about a few modules having no
|
2010-10-24 02:50:39 +04:00
|
|
|
symbols. This is normal and can safely be ignored.
|
|
|
|
|
|
|
|
|
2010-10-30 18:51:32 +04:00
|
|
|
2.5 Testing FLTK
|
|
|
|
-------------------
|
2010-10-24 02:50:39 +04:00
|
|
|
|
|
|
|
After a successful build, you can test FLTK's capabilities:
|
|
|
|
|
|
|
|
test/demo
|
|
|
|
|
|
|
|
|
2010-10-30 18:51:32 +04:00
|
|
|
2.6 Installing FLTK
|
|
|
|
----------------------
|
2010-10-24 02:50:39 +04:00
|
|
|
|
2016-04-01 14:10:18 +03:00
|
|
|
If you did not change any of the configuration settings, FLTK will be installed
|
2010-10-24 02:50:39 +04:00
|
|
|
in "/usr/local/include" and "/usr/local/lib" by typing
|
|
|
|
|
|
|
|
sudo make install
|
2016-04-01 14:10:18 +03:00
|
|
|
|
|
|
|
It is possible to install FLTK without superuser privileges by changing the
|
|
|
|
installation path to a location within the user account by adding the
|
2010-12-19 11:30:23 +03:00
|
|
|
"--prefix=PREFIX" parameter to the "./configure" command.
|
2010-10-24 02:50:39 +04:00
|
|
|
|
|
|
|
|
2010-10-30 18:51:32 +04:00
|
|
|
2.7 Creating new Projects
|
|
|
|
----------------------------
|
2010-10-24 02:50:39 +04:00
|
|
|
|
2016-04-01 14:10:18 +03:00
|
|
|
FLTK provides a neat script named "fltk-config" that can provide all the flags
|
2010-10-24 02:50:39 +04:00
|
|
|
needed to build FLTK applications using the same flags that were used to build
|
2016-04-01 14:10:18 +03:00
|
|
|
the library itself. Architecture flags (e.g., -arch i386) used to build the
|
2011-02-24 13:27:33 +03:00
|
|
|
library, though, are not provided by the fltk-config script. This allows to
|
|
|
|
build universal libraries and to produce applications of any architecture
|
|
|
|
from them. Running "fltk-config" without arguments will print a list
|
2016-04-01 14:10:18 +03:00
|
|
|
of options. The easiest call to compile an FLTK application from a single source
|
|
|
|
file is:
|
2010-10-24 02:50:39 +04:00
|
|
|
|
|
|
|
fltk-config --compile myProgram.cxx
|
|
|
|
|
|
|
|
"fltk-config" and "fluid" will be installed in "/usr/local/bin/" by default. I
|
|
|
|
recommend that you add it to the command search path.
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-10-30 18:51:32 +04:00
|
|
|
3 HOW TO BUILD FLTK USING XCODE3
|
|
|
|
===================================
|
2010-10-24 02:50:39 +04:00
|
|
|
|
|
|
|
|
2010-10-30 18:51:32 +04:00
|
|
|
3.1 Prerequisites
|
|
|
|
--------------------
|
2010-10-24 02:50:39 +04:00
|
|
|
|
2015-03-18 15:49:18 +03:00
|
|
|
In order to build FLTK from within Xcode 3, you need to have the Xcode 3
|
2016-04-01 14:10:18 +03:00
|
|
|
developer environment on your computer. If you don't, go to: 'HOW TO BUILD
|
|
|
|
FLTK USING XCODE4'
|
2010-10-24 02:50:39 +04:00
|
|
|
|
|
|
|
|
2010-10-30 18:51:32 +04:00
|
|
|
3.2 Downloading and Unpacking
|
|
|
|
--------------------------------
|
2010-10-24 02:50:39 +04:00
|
|
|
|
|
|
|
Download FLTK from here:
|
|
|
|
|
|
|
|
http://www.fltk.org/software.php
|
|
|
|
|
2016-04-01 14:10:18 +03:00
|
|
|
If you are familiar with "subversion" and like to stay current with your
|
|
|
|
version, you will find the subversion access parameters at the bottom of that
|
2010-10-26 14:31:44 +04:00
|
|
|
page. You can use the SCM system that is built into Xcode.
|
|
|
|
|
2010-10-24 02:50:39 +04:00
|
|
|
Unpack FLTK by double-clicking it and copy the new folder into a convenient
|
|
|
|
location. I have set up a "dev" folder in my home folder for all my projects.
|
|
|
|
|
|
|
|
|
2010-10-30 18:51:32 +04:00
|
|
|
3.3 Configuring FLTK
|
|
|
|
-----------------------
|
2010-10-24 02:50:39 +04:00
|
|
|
|
2016-04-01 14:10:18 +03:00
|
|
|
Launch Xcode. Open the project file in
|
2010-10-24 02:50:39 +04:00
|
|
|
|
2015-03-18 14:51:54 +03:00
|
|
|
.../fltk-1.3.xxxx/ide/Xcode4/FLTK.xcodeproj
|
2010-10-24 02:50:39 +04:00
|
|
|
|
2016-04-01 14:10:18 +03:00
|
|
|
Use the "Project" pulldown menu to change "Active Build Configuration" to
|
|
|
|
"Release". Change the "Active Architecture" as desired.
|
|
|
|
|
2010-10-24 02:50:39 +04:00
|
|
|
|
2010-10-30 18:51:32 +04:00
|
|
|
3.4 Building FLTK
|
|
|
|
--------------------
|
2010-10-24 02:50:39 +04:00
|
|
|
|
2016-04-01 14:10:18 +03:00
|
|
|
Use the "Project" pulldown menu to set the "Active Target" to "Demo". Select
|
|
|
|
"Build" from the "Build" menu to create all libraries and test applications.
|
2010-10-24 02:50:39 +04:00
|
|
|
|
2016-04-01 14:10:18 +03:00
|
|
|
By default, the Xcode4 project builds applications that run under Mac OS X 10.5
|
|
|
|
and above. To build applications that also run under older Mac OS versions,
|
|
|
|
select "Edit Project Settings" of the Project menu, then select the Build panel,
|
|
|
|
and modify the "Mac OS X Deployment Target" item.
|
2014-04-28 20:27:55 +04:00
|
|
|
|
2015-03-18 14:51:54 +03:00
|
|
|
All frameworks and apps will be located in "./ide/Xcode4/build/Release/".
|
2010-10-24 02:50:39 +04:00
|
|
|
|
|
|
|
|
2010-10-30 18:51:32 +04:00
|
|
|
3.5 Testing FLTK
|
|
|
|
-------------------
|
2010-10-24 02:50:39 +04:00
|
|
|
|
2010-12-19 11:30:23 +03:00
|
|
|
Select "Build and Run" from the "Build" menu to run the Demo program. Use "Demo"
|
2010-10-25 12:08:07 +04:00
|
|
|
to explore all test programs.
|
2010-10-24 02:50:39 +04:00
|
|
|
|
|
|
|
|
2010-10-30 18:51:32 +04:00
|
|
|
3.6 Uninstalling previous versions of FLTK
|
|
|
|
---------------------------------------------
|
2010-10-25 00:53:36 +04:00
|
|
|
|
|
|
|
Remove FLTK frameworks:
|
|
|
|
|
|
|
|
sudo rm -r /Library/Frameworks/fltk*.framework
|
2016-04-01 14:10:18 +03:00
|
|
|
|
2010-12-19 11:30:23 +03:00
|
|
|
Remove Fluid and possibly other utilities:
|
2010-10-25 00:53:36 +04:00
|
|
|
|
2010-10-25 12:08:07 +04:00
|
|
|
sudo rm -r /Developer/Applications/Utilities/FLTK/
|
2016-04-01 14:10:18 +03:00
|
|
|
|
2010-10-25 00:53:36 +04:00
|
|
|
|
2010-10-30 18:51:32 +04:00
|
|
|
3.7 Installing FLTK
|
|
|
|
----------------------
|
2010-10-24 02:50:39 +04:00
|
|
|
|
2010-10-25 12:08:07 +04:00
|
|
|
When distributing FLTK applications, the FLTK frameworks should be made part of
|
|
|
|
the application package. For development however, it is very convenient to have
|
|
|
|
the Release-mode Frameworks in a standard location.
|
2010-10-25 00:53:36 +04:00
|
|
|
|
2016-04-01 14:10:18 +03:00
|
|
|
For Xcode project template use, all FLTK frameworks should be copied from
|
2015-03-18 14:51:54 +03:00
|
|
|
"./ide/Xcode4/build/Release/" to "/Library/Frameworks/". The FLTK header files
|
2010-10-25 12:08:07 +04:00
|
|
|
for all FLTK frameworks will then be at "/Library/Frameworks/fltk.framework/
|
|
|
|
Headers/". Add this path to the header search path of your projects.
|
|
|
|
|
2011-01-29 17:35:01 +03:00
|
|
|
sudo rm -f -r /Library/Frameworks/fltk*
|
2015-03-18 14:51:54 +03:00
|
|
|
sudo cp -R ide/Xcode4/build/Release/fltk*.framework /Library/Frameworks/
|
2010-10-25 00:53:36 +04:00
|
|
|
|
2016-04-01 14:10:18 +03:00
|
|
|
Many FLTK applications will use Fluid, the FLTK User Interface builder, to
|
|
|
|
generate C++ source code from .fl resource files. Add Fluid to the developer
|
2010-10-25 00:53:36 +04:00
|
|
|
tools:
|
|
|
|
|
|
|
|
sudo mkdir /Developer/Applications/Utilities/FLTK/
|
2018-12-04 17:00:49 +03:00
|
|
|
sudo rm -f -r /Developer/Applications/Utilities/FLTK/fluid.app
|
|
|
|
sudo cp -R ide/Xcode4/build/Release/fluid.app /Developer/Applications/Utilities/FLTK/
|
2010-10-24 02:50:39 +04:00
|
|
|
|
|
|
|
|
2010-10-30 18:51:32 +04:00
|
|
|
3.8 Installing Little Helpers
|
|
|
|
--------------------------------
|
2010-10-24 02:50:39 +04:00
|
|
|
|
2010-10-25 00:53:36 +04:00
|
|
|
|
2010-10-25 14:20:21 +04:00
|
|
|
- Project Templates:
|
2010-10-24 02:50:39 +04:00
|
|
|
|
2010-12-19 11:30:23 +03:00
|
|
|
Project Templates are the quickest way to create a new FLTK application from
|
2016-04-01 14:10:18 +03:00
|
|
|
within Xcode. The included project builds an FLTK based Cocoa application
|
|
|
|
written in C++ with support for the Fluid UI designer, image reading, and
|
2010-12-19 11:30:23 +03:00
|
|
|
OpenGL. Unused FLTK sub-Frameworks can simply be removed from the project.
|
2010-10-25 14:20:21 +04:00
|
|
|
The template assumes that Release versions of the FLTK frameworks are installed
|
|
|
|
in /Library/Frameworks as described above.
|
2010-10-24 02:50:39 +04:00
|
|
|
|
2010-10-25 14:20:21 +04:00
|
|
|
First, we need to create the Template folder:
|
2010-10-24 02:50:39 +04:00
|
|
|
|
2010-10-25 14:20:21 +04:00
|
|
|
sudo mkdir -p /Library/Application\ Support/Developer/Shared/Xcode/Project\ Templates/
|
2010-10-24 02:50:39 +04:00
|
|
|
|
2010-10-25 14:20:21 +04:00
|
|
|
Next, we copy the project template over:
|
|
|
|
|
2015-03-18 14:51:54 +03:00
|
|
|
sudo cp -r ide/Xcode4/Project\ Templates/* /Library/Application\ Support/Developer/Shared/Xcode/Project\ Templates/
|
2010-10-25 14:20:21 +04:00
|
|
|
|
|
|
|
After restarting Xcode, the dialog for "File > New Project..." will offer an
|
|
|
|
FLTK 1.3 user template which is ready to compile.
|
|
|
|
|
|
|
|
|
|
|
|
- Fluid file handling
|
|
|
|
|
2016-04-01 14:10:18 +03:00
|
|
|
This section assumes that a Release version of Fluid is installed in
|
2010-12-19 11:30:23 +03:00
|
|
|
"/Developer/Applications/Utilities/FLTK/" as described above. It will install
|
2010-10-25 14:20:21 +04:00
|
|
|
a new file type which opens Fluid as an editor for files ending in ".fl".
|
|
|
|
|
|
|
|
First, we need to create the spec folder:
|
|
|
|
|
|
|
|
sudo mkdir -p /Library/Application\ Support/Developer/Shared/Xcode/Specifications/
|
|
|
|
|
|
|
|
Next, we copy the Fluid specification over:
|
|
|
|
|
2015-03-18 14:51:54 +03:00
|
|
|
sudo cp ide/Xcode4/fluid.pbfilespec /Library/Application\ Support/Developer/Shared/Xcode/Specifications/
|
2010-10-25 14:20:21 +04:00
|
|
|
|
2016-04-01 14:10:18 +03:00
|
|
|
Open Xcode preferences and select the File Types tab. Find the
|
|
|
|
"sourcecode.fluid" entry in "file > text > sourcecode" and set the external
|
2010-12-19 11:30:23 +03:00
|
|
|
editor to Fluid. When adding ".fl" files, set the File Type in the Info dialog
|
2016-04-01 14:10:18 +03:00
|
|
|
to "sourcecode.fluid" and Xcode will edit your file in Fluid when
|
2010-10-26 14:31:44 +04:00
|
|
|
double-clicking.
|
2010-10-25 14:20:21 +04:00
|
|
|
|
|
|
|
|
|
|
|
- More
|
2010-10-24 02:50:39 +04:00
|
|
|
|
2010-10-25 14:20:21 +04:00
|
|
|
TODO: Language Definition
|
|
|
|
TODO: Build Rules
|
2010-10-25 00:53:36 +04:00
|
|
|
|
2010-10-24 02:50:39 +04:00
|
|
|
|
2010-10-30 18:51:32 +04:00
|
|
|
3.9 Creating new Projects
|
|
|
|
----------------------------
|
2010-10-24 02:50:39 +04:00
|
|
|
|
|
|
|
If the little helpers above were installed, the menu "File > New Project..."
|
|
|
|
will pop up a dialog that offers a User Template named Fluid. Select it and
|
2010-12-29 14:33:42 +03:00
|
|
|
follow the instructions.
|
2010-10-24 02:50:39 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
2012-04-18 00:14:16 +04:00
|
|
|
4 HOW TO BUILD FLTK USING XCODE4
|
|
|
|
===================================
|
|
|
|
|
|
|
|
|
|
|
|
4.1 Prerequisites
|
|
|
|
--------------------
|
|
|
|
|
2016-10-03 18:40:13 +03:00
|
|
|
In order to build FLTK from within Xcode 4, 5, 6, 7, or 8 you need to install
|
2016-04-01 14:10:18 +03:00
|
|
|
the Xcode developer environment via the Apple App Store that comes with
|
|
|
|
Lion and up. If you also want the command line version of gcc, you can use
|
|
|
|
the Download section in the Preferences dialog.
|
|
|
|
|
2012-04-18 00:14:16 +04:00
|
|
|
|
|
|
|
4.2 Downloading and Unpacking
|
|
|
|
--------------------------------
|
|
|
|
|
|
|
|
Download FLTK from here:
|
|
|
|
|
|
|
|
http://www.fltk.org/software.php
|
|
|
|
|
2016-04-01 14:10:18 +03:00
|
|
|
If you are familiar with "subversion" and like to stay current with your
|
|
|
|
version, you will find the subversion access parameters at the bottom of that
|
2012-04-18 00:14:16 +04:00
|
|
|
page. You can use the SCM system that is built into Xcode.
|
|
|
|
|
|
|
|
Unpack FLTK by double-clicking it and copy the new folder into a convenient
|
|
|
|
location. I have set up a "dev" folder in my home folder for all my projects.
|
|
|
|
|
|
|
|
|
|
|
|
4.3 Configuring FLTK
|
|
|
|
-----------------------
|
|
|
|
|
2016-04-01 14:10:18 +03:00
|
|
|
Launch Xcode. Open the project file in
|
2012-04-18 00:14:16 +04:00
|
|
|
|
|
|
|
.../fltk-1.3.xxxx/ide/Xcode4/FLTK.xcodeproj
|
|
|
|
|
|
|
|
There is nothing else to configure.
|
2016-04-01 14:10:18 +03:00
|
|
|
|
2012-04-18 00:14:16 +04:00
|
|
|
|
|
|
|
4.4 Building FLTK
|
|
|
|
--------------------
|
|
|
|
|
2016-04-01 14:10:18 +03:00
|
|
|
Use the "Scheme" pulldown menu to change the active target to "Demo" and
|
|
|
|
"My Mac 32-bit" or "My Mac 64-bit". Select "Build for" -> "Running"Run" from
|
2012-04-18 00:14:16 +04:00
|
|
|
the "Product" menu to create all libraries and test applications.
|
|
|
|
|
2016-04-01 14:10:18 +03:00
|
|
|
By default, the Xcode4 project builds applications that run under Mac OS X 10.5
|
|
|
|
and above. To build applications that also run under older Mac OS versions,
|
|
|
|
modify the "OS X Deployment Target" item of the FLTK project build settings.
|
2014-04-28 20:27:55 +04:00
|
|
|
|
2012-04-18 00:14:16 +04:00
|
|
|
All frameworks and apps will be located in a private directory. Use
|
2016-04-01 14:10:18 +03:00
|
|
|
"Window"->"Organizer" to find the full path.
|
2012-04-18 00:14:16 +04:00
|
|
|
|
|
|
|
|
|
|
|
4.5 Testing FLTK
|
|
|
|
-------------------
|
|
|
|
|
|
|
|
Select "Run" from the "Product" menu to run the Demo program. Use "Demo"
|
|
|
|
to explore all test programs.
|
|
|
|
|
|
|
|
|
|
|
|
4.6 Uninstalling previous versions of FLTK
|
|
|
|
---------------------------------------------
|
|
|
|
|
|
|
|
Remove FLTK frameworks:
|
|
|
|
|
|
|
|
sudo rm -r /Library/Frameworks/fltk*.framework
|
2016-04-01 14:10:18 +03:00
|
|
|
|
2012-04-18 00:14:16 +04:00
|
|
|
Remove Fluid and possibly other utilities:
|
|
|
|
|
|
|
|
sudo rm -r /Applications/FLTK/
|
2016-04-01 14:10:18 +03:00
|
|
|
|
2012-04-18 00:14:16 +04:00
|
|
|
|
|
|
|
4.7 Installing FLTK
|
|
|
|
----------------------
|
|
|
|
|
|
|
|
When distributing FLTK applications, the FLTK frameworks should be made part of
|
|
|
|
the application package. For development however, it is very convenient to have
|
|
|
|
the Release-mode Frameworks in a standard location.
|
|
|
|
|
2016-04-01 14:10:18 +03:00
|
|
|
For Xcode project template use, all FLTK frameworks should be built using
|
|
|
|
"Build for Archiving" and then copied from
|
|
|
|
"./(Organizer->Derived Data Path)/Release/" to "/Library/Frameworks/".
|
|
|
|
The FLTK header files for all FLTK frameworks will then be at
|
|
|
|
"/Library/Frameworks/fltk.framework/Headers/". Add this path to the header
|
|
|
|
search path of your projects.
|
2012-04-18 00:14:16 +04:00
|
|
|
|
|
|
|
sudo rm -f -r /Library/Frameworks/fltk*
|
|
|
|
sudo cp -R (Organizer->Derived Data Path)/Release/fltk*.framework /Library/Frameworks/
|
|
|
|
|
2016-04-01 14:10:18 +03:00
|
|
|
Many FLTK applications will use Fluid, the FLTK User Interface builder, to
|
|
|
|
generate C++ source code from .fl resource files. Add Fluid to the developer
|
2012-04-18 00:14:16 +04:00
|
|
|
tools:
|
|
|
|
|
|
|
|
sudo mkdir /Applications/FLTK/
|
2018-12-04 17:00:49 +03:00
|
|
|
sudo rm -f -r /Applications/FLTK/fluid.app
|
|
|
|
sudo cp -R (Organizer->Derived Data Path)/Release/fluid.app /Applications/FLTK/
|
2012-04-18 00:14:16 +04:00
|
|
|
|
|
|
|
(TODO: 4.8 Installing Little Helpers)
|
|
|
|
(TODO: 4.9 Creating new Projects)
|
|
|
|
|
2012-11-13 17:03:20 +04:00
|
|
|
|
|
|
|
|
|
|
|
5 MAKE AN APPLICATION LAUNCHABLE BY DROPPING FILES ON ITS ICON
|
|
|
|
=================================================================
|
|
|
|
- Prepare an Info.plist file for your application derived from file
|
|
|
|
ide/Xcode4/plists/editor-Info.plist which allows any file to be dropped
|
|
|
|
on the application icon.
|
2016-04-01 14:10:18 +03:00
|
|
|
You can edit this file in Xcode and change
|
2012-11-13 17:03:20 +04:00
|
|
|
Document types/Item 0/CFBundleTypeExtensions/Item 0
|
2016-04-01 14:10:18 +03:00
|
|
|
from the current "*" to the desired file extension. Use several items to
|
|
|
|
declare several extensions.
|
2012-11-13 17:03:20 +04:00
|
|
|
|
2016-04-01 14:10:18 +03:00
|
|
|
- Call fl_open_callback() at the beginning of your main() function that sets
|
|
|
|
what function will be called when a file is dropped on the application icon.
|
2012-11-13 17:03:20 +04:00
|
|
|
|
|
|
|
- In Xcode, set the "Info.plist File" build setting of your target application
|
|
|
|
to the Info.plist file you have prepared.
|
|
|
|
|
|
|
|
- Rebuild your application.
|
|
|
|
|
|
|
|
|
|
|
|
6 DOCUMENT HISTORY
|
2010-10-30 18:51:32 +04:00
|
|
|
=====================
|
2010-10-24 02:50:39 +04:00
|
|
|
|
2010-10-30 18:51:32 +04:00
|
|
|
Oct 29 2010 - matt: removed warnings
|
2010-10-24 02:50:39 +04:00
|
|
|
Oct 24 2010 - matt: restructured entire document and verified instructions
|
2010-12-19 11:30:23 +03:00
|
|
|
Dec 19 2010 - Manolo: corrected typos
|
2010-12-29 14:33:42 +03:00
|
|
|
Dec 29 2010 - Manolo: removed reference to AudioToolbox.framework that's no longer needed
|
2011-02-24 13:27:33 +03:00
|
|
|
Feb 24 2011 - Manolo: architecture flags are not propagated to the fltk-config script.
|
2012-04-18 00:14:16 +04:00
|
|
|
Apr 17 2012 - matt: added Xcode4 documentation
|
2012-11-13 17:03:20 +04:00
|
|
|
Nov 13 2012 - Manolo: added "MAKE AN APPLICATION LAUNCHABLE BY DROPPING FILES ON ITS ICON"
|
2014-04-28 20:27:55 +04:00
|
|
|
Apr 28 2014 - Manolo: how to build programs that run on various Mac OS X versions
|
2015-03-18 14:51:54 +03:00
|
|
|
Mar 18 2015 - Manolo: removed uses of the Xcode3 project
|
2016-04-01 14:10:18 +03:00
|
|
|
Apr 01 2016 - AlbrechtS: corrected typo, formatted most line breaks < 80 columns
|