cmake_minimum_required(VERSION 3.14) include(FetchContent) # Set the project name. This is not the executable program's name! project(graphical_template) if(NOT EMSCRIPTEN) set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fsanitize=undefined,address") endif() FetchContent_Declare( raylib URL https://github.com/manuel5975p/raylib/archive/refs/tags/5.1.1.tar.gz DOWNLOAD_EXTRACT_TIMESTAMP True #This option is not required but suppresses a warning ) FetchContent_MakeAvailable(raylib) add_executable(index "hexagon.cpp") # Link raylib to main target_include_directories(index PUBLIC "${raylib_SOURCE_DIR}/src") FetchContent_Declare( eigen3 URL https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.tar.gz ) FetchContent_MakeAvailable(eigen3) file( DOWNLOAD https://raw.githubusercontent.com/raysan5/raygui/4.0/src/raygui.h "${CMAKE_BINARY_DIR}/downloaded_headers/raygui_dl.h" ) include_directories(${CMAKE_BINARY_DIR}/downloaded_headers/) target_link_libraries(index PUBLIC raylib Eigen3::Eigen) target_compile_features(index PUBLIC cxx_std_20) if (EMSCRIPTEN) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lidbfs.js -s USE_GLFW=3 --shell-file ${CMAKE_CURRENT_LIST_DIR}/web/minshell.html -s GL_ENABLE_GET_PROC_ADDRESS=1") set(CMAKE_EXECUTABLE_SUFFIX ".html") # This line is used to set your executable to build with the emscripten html template so that you can directly open it. endif ()