-
Notifications
You must be signed in to change notification settings - Fork 65
macOS Compilation Guide
CaPTk can be built and packaged on macOS 10.12 (Sierra) equivalents and later, as required by Qt 5.12.
Run the following command to install required libraries and dependencies and link them:
brew install caskroom/cask/mactex cmake make git-lfs doxygen llvm
If this is your first time building CaPTk, the Superbuild is the best option to pull in the external dependencies (OpenCV, VTK, ITK, Qt). It is assumed that you either downloaded the latest commit over git or extracted the zip file with the CaPTk source.
- Navigate to the root directory of CaPTk (typically the folder where the repository was cloned to)
- Create a build directory and navigate to it:
mkdir bin && cd bin
- For cmake to be able to find LaTeX, run:
export CMAKE_PREFIX_PATH=/Library/TeX/texbin
- Run cmake (twice). This is for OpenMP to be found. Cmake will automatically detect that you need a Superbuild:
cmake ../ -DCMAKE_INSTALL_PREFIX="./superbuild"
cmake ../ -DCMAKE_INSTALL_PREFIX="./superbuild"
- Build OpenCV, ITK, and VTK:
make
(Optionally, if your computer can handle it: $ make -j n
will run with n
threads. This is ideal for CaPTk.)
6. Once the Superbuild has completed building OpenCV, VTK, and ITK, run:
rm CMakeCache.txt
export CC=/usr/local/opt/llvm/bin/clang
export CXX=/usr/local/opt/llvm/bin/clang++
export LDFLAGS="-L/usr/local/opt/llvm/lib"
export CPPFLAGS="-L/usr/local/opt/llvm/include"
cmake ../
cmake ../
- Run
make
ormake -j n
to build CaPTk
Once the make command has finished, run $ make package
to package CaPTk using macdeployqt
to generate a .app
bundle
To generate a .pkg
, run the following commands in the CaPTk source directory
pkgbuild --version 1.6.2.RC --identifier com.cbica.captk --install-location /Applications --component ./_CPack_Packages/OSX/DragNDrop/CaPTk_1.6.2.RC/CaPTk_1.6.2.RC.app/ ./CaPTk_1.6.2.RC.pkg
productbuild --synthesize --package CaPTk_1.6.2.RC.pkg ./distribution.xml
echo '<?xml version="1.0" encoding="utf-8"?>
<installer-gui-script minSpecVersion="1">
<title>CaPTk_1.6.2.RC</title>
<license file="Combined.txt"></license>
<pkg-ref id="com.cbica.captk"/>
<options customize="never" require-scripts="false"/>
<choices-outline>
<line choice="default">
<line choice="com.cbica.captk"/>
</line>
</choices-outline>
<choice id="default"/>
<choice id="com.cbica.captk" visible="false">
<pkg-ref id="com.cbica.captk"/>
</choice>
<pkg-ref id="com.cbica.captk" version="1.6.2.RC" onConclusion="none">CaPTk_1.6.2.RC.pkg</pkg-ref>
</installer-gui-script>' > "./distribution.xml"
productbuild --distribution ./distribution.xml --resources ./_CPack_Packages/OSX/DragNDrop/CaPTk_1.6.2.RC/CaPTk_1.6.2.RC.app/Contents/Resources/license/ --package-path . ./CaPTk_1.6.2.RC_Installer.pkg
CaPTk, 2022 | About CaPTk | Please report any issues here