Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Recent
    • Tags
    • Users
    • Register
    • Login

    Cinema 4D 2027 SDK fails to build on macOS if the path contains spaces

    Scheduled Pinned Locked Moved Cinema 4D SDK
    macosc++
    5 Posts 3 Posters 66 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P Offline
      peter_horvath
      last edited by

      The cmake build fails with the following error if the sdk is located in a folder that has spaces in the name:

      PhaseScriptExecution Generate generated/core.framework/prebuildEventStamp2 ... (in target 'core.framework')
        cp: .../Library/Application Support/MAXON/maxon.py: Not a directory
      

      The generated script (build/core.framework.build/Release/Script-A6F7B869415D4714E2AE9A4C.sh) contains a cp command where the source path isn't escaped, so cp interprets the path as multiple arguments.

      The issue is in frameworks/core.framework/project/CMakeLists.txt:23-24 (and probably in other frameworks as well), where ${CMAKE_CURRENT_SOURCE_DIR} goes in raw/unescaped. (Can not post the actual code block, because the security filter blocks it.)

      ferdinandF 1 Reply Last reply Reply Quote 0
      • ferdinandF Offline
        ferdinand @peter_horvath
        last edited by ferdinand

        Hey @peter_horvath,

        Thank you for reporting this. I have never encountered this because I am habitually never use any white space in folders when it comes to coding but I understand this can be annoying. As far as I understand your posting correctly, you are placing the Cinema C++ SDK in the designated library folder of MacOS, more concretely its 'Application Support' sub folder, and the white space in that folder name is then causing issues with the prebuild event scripts?

        I would have to check if we can fix this, as this is a part of the build system (the frameworks) that is not owned by SDK. And just for clarity, you propose to change the relevant files to something like this:

        # Section: macOS
        set(exclude_from_build.MACOS /win)
        set(prebuild_event.MACOS.DEBUG "mkdir -p ~/Library/Application\\ Support/MAXON ; cp -f \"${CMAKE_CURRENT_SOURCE_DIR}/typeviewer/xcode/maxon.py\" ~/Library/Application\\ Support/MAXON/maxon.py ; perl -w \"${CMAKE_CURRENT_SOURCE_DIR}/typeviewer/xcode/copytypeviewer.pl\" maxon.py ~/Library/Application\\ Support/MAXON/maxon.py")
        set(prebuild_event.MACOS.RELEASE "mkdir -p ~/Library/Application\\ Support/MAXON ; cp -f \"${CMAKE_CURRENT_SOURCE_DIR}/typeviewer/xcode/maxon.py\" ~/Library/Application\\ Support/MAXON/maxon.py ; perl -w \"${CMAKE_CURRENT_SOURCE_DIR}/typeviewer/xcode/copytypeviewer.pl\" maxon.py ~/Library/Application\\ Support/MAXON/maxon.py")
        
        # Section: iOS
        set(exclude_from_build.IOS /win)
        set(prebuild_event.IOS.DEBUG "mkdir -p ~/Library/Application\\ Support/MAXON ; cp -f \"${CMAKE_CURRENT_SOURCE_DIR}/typeviewer/xcode/maxon.py\" ~/Library/Application\\ Support/MAXON/maxon.py ; perl -w \"${CMAKE_CURRENT_SOURCE_DIR}/typeviewer/xcode/copytypeviewer.pl\" maxon.py ~/Library/Application\\ Support/MAXON/maxon.py")
        set(prebuild_event.IOS.RELEASE "mkdir -p ~/Library/Application\\ Support/MAXON ; cp -f \"${CMAKE_CURRENT_SOURCE_DIR}/typeviewer/xcode/maxon.py\" ~/Library/Application\\ Support/MAXON/maxon.py ; perl -w \"${CMAKE_CURRENT_SOURCE_DIR}/typeviewer/xcode/copytypeviewer.pl\" maxon.py ~/Library/Application\\ Support/MAXON/maxon.py")
        

        I.e., you want CMAKE_CURRENT_SOURCE_DIR compound paths to be quote escaped. If we will fix this, this will happen in an upcoming release and not a hotfix. For now you must either place the SDK in a path without whitespaces (or fix the CMake files yourself).

        Cheers,
        Ferdinand

        MAXON SDK Specialist
        developers.maxon.net

        1 Reply Last reply Reply Quote 0
        • P Offline
          peter_horvath
          last edited by

          It's not a blocker or critical issue for sure, the SDK builds fine when no whitespaces are in the path. Normally I don't use whitespaces either, but this time I unpacked the SDK in the Cinema 4D install folder in "/Applications/Maxon Cinema 4D 2027/sdk", that's why I noticed the issue. (The "Application Support" folder is where the SDK scripts are copying some files to, and that is properly escaped. The issue is only with whitespaces in the source folder CMAKE_CURRENT_SOURCE_DIR).

          Yes, the fix is to escape CMAKE_CURRENT_SOURCE_DIR in core.framework/project/CMakeLists.txt and cinema.framework/project/CMakeLists.txt. There are also a few other places in sdk_targets.cmake that break when the path has whitespaces. It's fine to fix it in an upcoming release instead of a hotfix. Thank you.

          1 Reply Last reply Reply Quote 0
          • ferdinandF Offline
            ferdinand
            last edited by

            I forwarded this to the build team (who own this part of the build system). Let's see what they say, I will update this topic once I have an answer.

            MAXON SDK Specialist
            developers.maxon.net

            1 Reply Last reply Reply Quote 0
            • DunhouD Offline
              Dunhou
              last edited by

              btw, same on windows

              https://boghma.com
              https://github.com/DunHouGo

              1 Reply Last reply Reply Quote 0
              • First post
                Last post