Cinema 4D 2027 SDK fails to build on macOS if the path contains spaces
-
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 directoryThe 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.) -
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_DIRcompound 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 -
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.txtandcinema.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. -
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.
-
btw, same on windows