aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMateja <mail@matejamaric.com>2021-02-14 15:31:12 +0100
committerMateja <mail@matejamaric.com>2021-02-14 15:31:12 +0100
commitf1491583afa27bd271f5ec0372773716e2f6d320 (patch)
tree7338851e658e3ebf8e7c885dc906175e8dcf5687
parentba59c7b81f227b3e13ae945136575390bc5d8c59 (diff)
downloaderender-f1491583afa27bd271f5ec0372773716e2f6d320.tar.gz
erender-f1491583afa27bd271f5ec0372773716e2f6d320.zip
Comment CMakeLists.txt
-rw-r--r--CMakeLists.txt10
1 files changed, 8 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ba76fa7..a7a5bf1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,14 +1,19 @@
cmake_minimum_required(VERSION 3.13)
+# Set project name
project(erender)
+# Set C++ standard
set( CMAKE_CXX_STANDARD 17 )
+# Add all files in `src` directory to SRC_LIST variable
aux_source_directory(./src/ SRC_LIST)
+
+# Set project executable's name
add_executable(${PROJECT_NAME} ${SRC_LIST})
+# Auto-update git submodules
find_package(Git QUIET)
if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
-# Update submodules as needed
option(GIT_SUBMODULE "Check submodules during build" ON)
if(GIT_SUBMODULE)
message(STATUS "Submodule update")
@@ -21,12 +26,13 @@ if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
endif()
endif()
+# Check if submodules are available
if(NOT EXISTS "${PROJECT_SOURCE_DIR}/external/SFML/CMakeLists.txt")
message(FATAL_ERROR "The submodules were not downloaded! GIT_SUBMODULE was turned off or failed. Please update submodules and try again.")
endif()
+# Compile and add SFML to project
add_subdirectory(external/SFML)
target_include_directories(${PROJECT_NAME} PUBLIC external/SFML/include)
target_link_directories(${PROJECT_NAME} PUBLIC external/SFML/lib)
-
target_link_libraries(${PROJECT_NAME} sfml-graphics sfml-window sfml-system)