Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix macos bundle #956

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Conversation

hmueller01
Copy link

Fixed a few things to make build work on macOS.

@novomesk
Copy link
Collaborator

Hello @s-daveb ,

You tried to build nomacs on MacOS in the past.
Would you like to test these changes and tell me if you agree with them.

@s-daveb
Copy link

s-daveb commented Jul 3, 2023

The first make call failed unless I ran export CPLUS_INCLUDE_PATH=/usr/local/include before make.

Then it subsequently built, but the second call to make bundle failed with:

[100%] Linking CXX executable nomacs.app/Contents/MacOS/nomacs
[100%] Built target nomacs
build ❯ make bundle                                                                              master
CMake Error at bundle.cmake:17 (file):
  file COPY cannot find "/Resources/qt_menu.nib": No such file or directory.

@hmueller01
Copy link
Author

The first point is documented in the README.md. I hope you've seen this.

The second failure this is really strange. Did you really checkout this branch?
make bundle shouldn't use bundle.cmake at all, as I replaced this target by macdeployqt

get_target_property(_qmake_executable Qt5::qmake IMPORTED_LOCATION)
get_filename_component(_qt_bin_dir "${_qmake_executable}" DIRECTORY)
find_program(MACDEPLOYQT_EXECUTABLE macdeployqt HINTS "${_qt_bin_dir}")

add_custom_target(bundle
	COMMAND ${MACDEPLOYQT_EXECUTABLE} ${BINARY_NAME}.app -dmg
	DEPENDS ${BINARY_NAME}
	COMMENT "Execute ${MACDEPLOYQT_EXECUTABLE} to create macOS bundle")

at the end of MacBuildTarget.cmake.

The whole command should look like this (if nomacs.app and nomacs.dmg are not yet created):

> make bundle
[  1%] Automatic MOC for target nomacsCore-3.17.0
[  1%] Built target nomacsCore-3.17.0_autogen
[ 60%] Built target nomacsCore-3.17.0
[ 61%] Automatic MOC for target nomacs
[ 61%] Built target nomacs_autogen
[ 98%] Built target nomacs
[100%] Execute /usr/local/opt/qt5/bin/macdeployqt to create macOS bundle
[100%] Built target bundle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants