Skip to content

Commit 3ad6d36

Browse files
authored
Merge pull request #153 from Benitoite/patch-4
INSTALL.md: Mac Compilation info
2 parents 148c8e0 + db008a0 commit 3ad6d36

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

Diff for: INSTALL.md

+51
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,54 @@ make
122122

123123
The result of the compilation should be the binaries `hdrmerge.exe` and `hdrmerge-nogui.exe`.
124124
You have finished.
125+
126+
## Compilation in macOS
127+
128+
These steps don't include things like getting Xcode, a MacOS SDK, **Qt5.11.0**, cmake, clang++-mp-3.9, etc.
129+
130+
1a. Dependencies. Get the dependencies listed above.
131+
132+
1b. [Download ALGLIB 3.13.0 for C++](http://www.alglib.net/download.php) and extract to ~/alglib
133+
134+
1c. Clone HDRMerge into ~/hdrmerge and checkout master branch
135+
```
136+
git clone https://github.com/jcelaya/hdrmerge.git ~/hdrmerge
137+
cd ~/hdrmerge
138+
git checkout master
139+
```
140+
2. Set the environment variable for alglib:
141+
```
142+
export ALGLIB_ROOT=~/alglib/cpp
143+
```
144+
3. Make and goto the build directory.
145+
```
146+
mkdir ~/hdrmerge/build && cd ~/hdrmerge/build
147+
```
148+
4. Issue cmake command
149+
```
150+
sudo cmake .. -DQt5_DIR=$HOME/Qt/5.11.0/clang_64/lib/cmake/Qt5 -DCMAKE_BUILD_TYPE=Release -DOpenMP_C_FLAGS=-fopenmp="libiomp5" -DOpenMP_CXX_FLAGS=-fopenmp="libiomp5" -DOpenMP_C_LIB_NAMES="libiomp5" -DOpenMP_CXX_LIB_NAMES="libiomp5" -DOpenMP_libiomp5_LIBRARY="/opt/local" -DCMAKE_C_COMPILER="clang-mp-3.9" -DCMAKE_CXX_COMPILER="clang++-mp-3.9" -DCMAKE_OSX_SYSROOT="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk" -DALGLIB_ROOT=$ALGLIB_ROOT -DALGLIB_INCLUDES=$ALGLIB_ROOT/src -DALGLIB_LIBRARIES=$ALGLIB_ROOT/src -DCMAKE_INSTALL_BINDIR=$HOME/hdrmerge/build/install
151+
```
152+
5. compile
153+
```
154+
sudo make -j4 install
155+
```
156+
6. Copy two of the dependencies into Frameworks.
157+
```
158+
sudo mkdir ~/hdrmerge/build/install/hdrmerge.app/Contents/Frameworks
159+
sudo cp /opt/local/lib/libomp/libiomp5.dylib ~/hdrmerge/build/install/hdrmerge.app/Contents/Frameworks/.
160+
sudo cp /usr/local/lib/libexiv2.26.dylib ~/hdrmerge/build/install/hdrmerge.app/Contents/Frameworks/.
161+
```
162+
7. Run Qt5's macdeployqt
163+
```
164+
sudo ~/Qt/5.11.0/clang_64/bin/macdeployqt ~/hdrmerge/build/install/hdrmerge.app -no-strip -verbose=3
165+
```
166+
8. Install an rpath
167+
```
168+
sudo install_name_tool -add_rpath "@executable_path/../Frameworks" ~/hdrmerge/build/install/hdrmerge.app/Contents/MacOS/hdrmerge
169+
```
170+
9. Make the .dmg
171+
```
172+
sudo hdiutil create -ov -srcfolder ~/hdrmerge/build/install/hdrmerge.app ~/hdrmerge/build/install/HDRMerge.dmg
173+
```
174+
175+

0 commit comments

Comments
 (0)