Skip to content

Commit

Permalink
Converted project to cmake, making it somewhat portable
Browse files Browse the repository at this point in the history
  • Loading branch information
cdgiessen committed Nov 12, 2018
1 parent 67b830f commit 66b9b75
Show file tree
Hide file tree
Showing 10 changed files with 87 additions and 2 deletions.
33 changes: 33 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
cmake_minimum_required(VERSION 3.7 FATAL_ERROR)

project(GraphicsProject4 VERSION 0.0.1 LANGUAGES CXX)

find_package (OpenGL REQUIRED)
find_package(GLEW REQUIRED)
find_package(SOIL CONFIG REQUIRED)
find_package(glfw3 REQUIRED)
find_package(glm REQUIRED)

add_executable(main

src/TerrainFPS.cpp
src/GridFloatData.cpp
)

target_link_libraries(main PRIVATE ${OPENGL_LIBRARIES})

target_include_directories(main PRIVATE GLEW)
target_link_libraries(main PRIVATE GLEW::GLEW)

target_link_libraries(main PRIVATE SOIL)

target_link_libraries(main PUBLIC glm)

target_include_directories(main PUBLIC glfw)
target_link_libraries(main PRIVATE glfw)

target_include_directories(main PRIVATE ${CMAKE_SOURCE_DIR}/src)

add_custom_command(TARGET main POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${PROJECT_SOURCE_DIR}/Resources $<TARGET_FILE_DIR:main>)
52 changes: 52 additions & 0 deletions CMakeSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"configurations": [
{
"name": "x64-Debug",
"generator": "Ninja",
"configurationType": "Debug",
"inheritEnvironments": [ "msvc_x64_x64" ],
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-v",
"variables": [
{
"name": "CMAKE_TOOLCHAIN_FILE",
"value": "C:/src/vcpkg/scripts/buildsystems/vcpkg.cmake"
}
],
"ctestCommandArgs": ""
},
{
"name": "x64-RelWithDebInfo",
"generator": "Ninja",
"configurationType": "RelWithDebInfo",
"inheritEnvironments": [ "msvc_x64_x64" ],
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-v",
"variables": [
{
"name": "CMAKE_TOOLCHAIN_FILE",
"value": "C:/src/vcpkg/scripts/buildsystems/vcpkg.cmake"
}
],
"ctestCommandArgs": ""
},
{
"name": "x64-Release",
"generator": "Ninja",
"configurationType": "Release",
"inheritEnvironments": [ "msvc_x64_x64" ],
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-v",
"variables": [
{
"name": "CMAKE_TOOLCHAIN_FILE",
"value": "C:/src/vcpkg/scripts/buildsystems/vcpkg.cmake"
}
],
"ctestCommandArgs": ""
}
]
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions TerrainFPS/TerrainFPS.h → src/TerrainFPS.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <iostream>

// GLEW
#define GLEW_STATIC
//#define GLEW_STATIC
#include <GL/glew.h>

// GLFW
Expand All @@ -20,7 +20,7 @@
// SOIL
#include "SOIL.h"

// Other includes
// Other includes
#include "Shader.h"
#include "Camera.h"
#include "GridFloatData.h"
Expand Down

0 comments on commit 66b9b75

Please sign in to comment.