Fix MacOS build for missing bundle
ClosedPublic

Authored by patrickelectric on Apr 22 2020, 1:35 AM.

Details

Summary

It's not possible to compile minuet without bundle in cmake configuration

Diff Detail

Repository
R163 Minuet
Lint
Lint Skipped
Unit
Unit Tests Skipped
Restricted Application added a project: KDE Edu. · View Herald TranscriptApr 22 2020, 1:35 AM
Restricted Application added a subscriber: kde-edu. · View Herald Transcript
patrickelectric requested review of this revision.Apr 22 2020, 1:35 AM
apol added a subscriber: apol.Apr 22 2020, 2:10 AM

Should be ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}?

@apol is that what you mean ?

apol added a comment.Apr 23 2020, 10:47 AM

No, it should be install(TARGETS minuet ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}).

You can see how it takes care of this case in KDEInstallDirs.cmake:711

@apol doing so results in

CMake Error at src/app/CMakeLists.txt:87 (install):
  install TARGETS given no BUNDLE DESTINATION for MACOSX_BUNDLE executable
  target "minuet".

I took a look in KDEInstallDirs.cmake:711 and I can see that is sets the bundle with:

709   │ # on the Mac support an extra install directory for application bundles
710   │ if(APPLE)
711   │     set(KDE_INSTALL_TARGETS_DEFAULT_ARGS  ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}
712   │                                           BUNDLE DESTINATION "${BUNDLE_INSTALL_DIR}" )
713   │     set(KF5_INSTALL_TARGETS_DEFAULT_ARGS  ${KF5_INSTALL_TARGETS_DEFAULT_ARGS}
714   │                                           BUNDLE DESTINATION "${BUNDLE_INSTALL_DIR}" )
715   │ endif()

I did a simple test and APPLE is true in my macbook, so I don't know why and what is happening.
Patch update to reflect what I'm running here.

pino added a subscriber: pino.Apr 24 2020, 12:47 PM

CMake Error at src/app/CMakeLists.txt:87 (install):

That file in master has only 85 lines, so most probably you have local changes there? If so, try to temporarly remove them, or test the change on a clean source tree.

Also, ${INSTALL_TARGETS_DEFAULT_ARGS} and ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} are the same (the non-KDE_ one is deprecated).

@pino It was a simple if(apple) message(potato) endif() to test if apple was true and the correct variable was by kdeinstalldir, with everything stashed and only this patch applied:

CMake Error at src/app/CMakeLists.txt:84 (install):
  install TARGETS given no BUNDLE DESTINATION for MACOSX_BUNDLE executable
  target "minuet".

@pino if you can, please the history if of this patch to see my first and working version.
https://phabricator.kde.org/D29077?id=80827

pino added a comment.Apr 24 2020, 12:59 PM

@pino if you can, please the history if of this patch to see my first and working version.
https://phabricator.kde.org/D29077?id=80827

I don't think it is correct, ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} (or the deprecated version already in use) is the right thing to use in all the occasions.
Unfortunately I do not have any macOS knowledge, so I can only point you at KDEInstallDirs.cmake in extra-cmake-modules that sets ${BUNDLE_INSTALL_DIR}:

if(APPLE)
    _define_absolute(BUNDLEDIR "/Applications/KDE"
        "application bundles"
        BUNDLE_INSTALL_DIR)
endif()

Hm, Ok, I'll debug it later so.

@apol @pino This fix the problem, RUNTIME DESTINATION is already specified by KDE_INSTALL_TARGETS_DEFAULT_ARGS, that's why I was getting the error message.

apol accepted this revision.Apr 25 2020, 2:32 PM
This revision is now accepted and ready to land.Apr 25 2020, 2:32 PM