forked from FlavioFS/ParsecSoda
-
-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
40 lines (33 loc) · 1.31 KB
/
CMakeLists.txt
File metadata and controls
40 lines (33 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
cmake_minimum_required(VERSION 3.18)
# Make sure we are on Windows
if(NOT WIN32)
message(FATAL_ERROR "Smash Soda can only be built on Windows.")
endif()
project(SmashSoda LANGUAGES CXX)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Force C++17 (matching the subdirectory requirement)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Detect architecture for output directories
if(NOT CMAKE_VS_PLATFORM_NAME)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(ARCH "x64")
else()
set(ARCH "Win32")
endif()
else()
set(ARCH "${CMAKE_VS_PLATFORM_NAME}")
endif()
# Output folders (using standard CMake case: Release, Debug)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/${ARCH}/lib")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/${ARCH}/lib")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_SOURCE_DIR}/${ARCH}/Debug")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_SOURCE_DIR}/${ARCH}/Release")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_SOURCE_DIR}/${ARCH}/RelWithDebInfo")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL "${CMAKE_SOURCE_DIR}/${ARCH}/MinSizeRel")
# Add dependencies if they have their own CMakeLists
if(EXISTS "${CMAKE_SOURCE_DIR}/Dependencies/CMakeLists.txt")
add_subdirectory(Dependencies)
endif()
# Add main project
add_subdirectory(SmashSoda)