eternalcodes / EternalJK

Effort to maintain and improve OpenJK
GNU General Public License v2.0
60 stars 23 forks source link

Make install on Mac OS X 10.15 not working #102

Open joshabb opened 4 years ago

joshabb commented 4 years ago

This has something to do with rpath for sdl2, which now requires hidapi on mac OS X. The fix was found here:

https://github.com/bvschaik/julius/issues/386

Adding this to codemp/CMakeLists.txt fixes it. Changed:

                install(CODE "
                        include(BundleUtilities)
                        set(BU_CHMOD_BUNDLE_ITEMS ON)
                        fixup_bundle(\"${CMAKE_BINARY_DIR}/${MPEngine}.app\" \"\" \"\")

to this


                # if SDL2 library is a framework, we need to indicate to CMake
        # the path to its dependencies. SDL2_LIBRARY contains two parts.
        # Example: /Library/Frameworks/SDL2.framework;-framework Cocoa
        # So strip out everything after the ';'
        string(REGEX REPLACE ";.*$" "" SDL2_LIB_DIR "${SDL2_LIBRARY}")
        if(EXISTS "${SDL2_LIB_DIR}/Versions/A/Frameworks")
            set(DIRS "${DIRS};${SDL2_LIB_DIR}/Versions/A/Frameworks")
        endif()

        install(CODE "
            include(BundleUtilities)
            set(BU_CHMOD_BUNDLE_ITEMS ON)
            fixup_bundle(\"${CMAKE_BINARY_DIR}/${MPEngine}.app\" \"\" \"${DIRS}\")
            "
            COMPONENT Runtime)```