-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
451 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Oops, something went wrong.