Skip to content

Commit

Permalink
feat(tutorial): part 4 tictactoe
Browse files Browse the repository at this point in the history
  • Loading branch information
Milerius committed Oct 21, 2019
1 parent c1ff6e4 commit 1febab0
Show file tree
Hide file tree
Showing 2 changed files with 451 additions and 0 deletions.
46 changes: 46 additions & 0 deletions tutorials/tic-tac-toe/step_4/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
message(FATAL_ERROR "Prevented in-tree build. Please create a build directory outside of the source code and call cmake from there")
endif ()

##! Minimum version of the CMake.
cmake_minimum_required(VERSION 3.14)

##! C++ Standard needed by the SDK is 17
set(CMAKE_CXX_STANDARD 17)

##! Our Project title, here tic-tac-toe.
project(tic-tac-toe DESCRIPTION "An awesome tic-tac-toe" LANGUAGES CXX)

##! The SDK need's clang as main compiler.
if (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
message(FATAL_ERROR "Only Clang is supported (minimum LLVM 8.0)")
endif ()

##! We will let know the SDK if our on Linux
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(LINUX TRUE)
endif ()

##! We include the module from CMake for fetching dependencies
include(FetchContent)

##! We declare information about the dependance that we want to fetch.
FetchContent_Declare(
antara-gaming-sdk
URL https://github.com/KomodoPlatform/antara-gaming-sdk/archive/master.zip
)

##! We set extras modules from the SDK that we want to use, here we will use the SFML module.
set(USE_SFML_ANTARA_WRAPPER ON)

##! We fetch our dependence
FetchContent_MakeAvailable(antara-gaming-sdk)

##! Calling this macros provided by the sdk will if you are on Apple init the environment for this OS (std::filesystem).
init_apple_env()

##! We create the executable with the project name
add_executable(${PROJECT_NAME} tic-tac-toe.cpp)

##! We link the SDK modules that we want to use to our executable
target_link_libraries(${PROJECT_NAME} PUBLIC antara::world antara::sfml)
Loading

0 comments on commit 1febab0

Please sign in to comment.