You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

37 lines
1.5 KiB

project(Embryo)
cmake_minimum_required(VERSION 2.8)
# Compiler options
set(CMAKE_CXX_FLAGS "-std=c++17 -Lstdc++fs -Wall -Wextra -static")
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeModules/")
set(GLFW_SRC_PATH "${CMAKE_SOURCE_DIR}/ExternalLib/glfwSrc/")
set(SOIL_SRC_PATH "${CMAKE_SOURCE_DIR}/ExternalLib/SOIL/")
#Listing Code Sources at root
aux_source_directory(. SRC_LIST)
#Listing Shaders Sources (so they show up in the IDE)
file(GLOB_RECURSE shaders_SRC
"shaders/*.frag"
"shaders/*.vert"
)
# Writing config.cfg file
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/config.cfg "# This file has been automatically generated, please only interact with it if you know what you're doing\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/config.cfg "shaders = ${CMAKE_SOURCE_DIR}/shaders/\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/config.cfg "models = ${CMAKE_SOURCE_DIR}/models/\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/config.cfg "resources = ${CMAKE_SOURCE_DIR}/resources/\n")
# TODO : detect whenever user is installing and if so, copy the shaders, models, resources files and write a config.cfg file with correct adresses
#Including SOIL
add_subdirectory(${SOIL_SRC_PATH})
include_directories("${SOIL_SRC_PATH}")
#Including glfw
add_subdirectory(${GLFW_SRC_PATH})
include_directories("${GLFW_SRC_PATH}/include")
find_package(OpenGL REQUIRED)
# Targets and executable
add_executable(${PROJECT_NAME} ${SRC_LIST} ${shaders_SRC})
target_link_libraries(${PROJECT_NAME} soil ${OPENGL_LIBRARIES} glfw ${GLFW_LIBRARIES})