MacOS support (using CMake)
Hi Cherno, I add a MacOS support using CMake.
Check the README.md of https://github.com/ZerenLong/OpenGL for installation instruction.
Nice!
I also had to copy the assets directory. Into OpenGL-Examples/CMakeList.txt added,
add_custom_command(
TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_CURRENT_SOURCE_DIR}/assets
${CMAKE_CURRENT_SOURCE_DIR}/../bin/Debug-x86_64/OpenGL-Examples/assets)
EDIT: but I noticed that updates to assets are not copied, it only copies the directory once
Then the build stopped to imgui not having CMakeLists.txt, added this to OpenGL-Core/CMakeLists.txt
set(IMGUI_INCLUDE_DIR vendor/imgui)
file(GLOB IMGUI_SOURCES ${IMGUI_INCLUDE_DIR}/*.cpp)
file(GLOB IMGUI_HEADERS ${IMGUI_INCLUDE_DIR}/*.h)
add_library(imgui STATIC ${IMGUI_SOURCES} ${IMGUI_SOURCES})
Thanks @jrasanen , I hope the code compile in your machine smoothly.
I used CLion as my IDE and the IDE will create the ../bin/Debug-x86_64/OpenGL-Examples directory as written in the CMakeLists.txt . However, when I use command line CMake to build to project, there is no ../bin/Debug-x86_64/OpenGL-Examples directory created, which confused me a lot.
I finally chose to use the command line CMake to build the project since not everyone use CLion as their IDE.
Hey! I actually use clion as well, got it working with the changes I mentioned above, though didn't have time to address the asset problem.