Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MacOS support (using CMake) #11

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

MacOS support (using CMake) #11

wants to merge 3 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Feb 4, 2021

Hi Cherno, I add a MacOS support using CMake.

Check the README.md of https://github.com/ZerenLong/OpenGL for installation instruction.

@jrasanen
Copy link

jrasanen commented Feb 13, 2021

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})

@ghost
Copy link
Author

ghost commented Feb 15, 2021

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.

@jrasanen
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants