squall/CMakeLists.txt

42 lines
1,001 B
Text
Raw Normal View History

cmake_minimum_required(VERSION 3.1)
2020-09-07 14:54:56 -05:00
if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
message(FATAL_ERROR
"In-source builds not allowed.
Please make a new directory (called a build directory) and run CMake from there.
You may need to remove CMakeCache.txt."
)
endif()
if(TARGET storm)
# Guard for use as transitive dependency
return()
endif()
2020-09-07 14:54:56 -05:00
# Project
project(storm)
set(CMAKE_CXX_STANDARD 11)
# Arch defines
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(WHOA_ARCH_64 1)
2020-09-07 14:54:56 -05:00
elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(WHOA_ARCH_32 1)
2020-09-07 14:54:56 -05:00
endif()
# OS defines
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(WHOA_PLATFORM_WIN 1)
add_definitions(-DWHOA_PLATFORM_WIN)
2020-09-07 14:54:56 -05:00
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(WHOA_PLATFORM_LINUX 1)
add_definitions(-DWHOA_PLATFORM_LINUX)
2020-09-07 14:54:56 -05:00
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(WHOA_PLATFORM_MAC 1)
add_definitions(-DWHOA_PLATFORM_MAC)
2020-09-07 14:54:56 -05:00
endif()
add_subdirectory(storm)
add_subdirectory(test)