Open cortis opened 3 years ago
Thanks so much for this fix! I never would have known to look there. Do you why this happens? (I know nothing about CMake)
For some reason,
if (APPLE)
# For some reason, CMake doesn't know about .m
set_source_files_properties(${glfw_SOURCES} PROPERTIES LANGUAGE C)
endif()
was lines 50-53 on my machine.
Do you why this happens?
I'm guessing that Cmake has been updated to know about .m files. It looked suspect to me because the error I was getting looked like it was treating the .m files as c-files.
I'm trying to build GLFW3.3.0 included as a part of Open3D with Xcode 12.3 configured with CMake 3.19.0, and I encountered the same error with the first post. The lines 'if (APPLE) ... endif()' are not in CMakeLists.txt. Can anyone help me to work around this problem?
This solution helps me a lot!
@cortis @Modjular I was trying to reproduce your issue. It seems to not occur anymore using the latest version of Nori and MacOS, is that correct?
The solution did work!
I tried building nori on my Mac in 2020 and got errors like the following: /Users/cortis/Save The Machine/Experiments/nori/ext/nanogui/ext/glfw/src/cocoa_init.m:282:1: error: expected identifier or '(' @interface GLFWLayoutListener : NSObject ^ /Users/cortis/Save The Machine/Experiments/nori/ext/nanogui/ext/glfw/src/cocoa_init.m:292:1: error: expected identifier or '(' @end ^ ....
The problem can be fixed by deleting (or commenting out) lines 75-79 of nori/ext/nanogui/ext/glfw/src/CMakeLists.txt
Specifically you need to remove these lines for modern macs (Tested with macOS Catalina 10.15.4 and Xcode 11.6): if (APPLE)
For some reason, CMake doesn't know about .m
endif()