-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
55 lines (45 loc) · 1.73 KB
/
CMakeLists.txt
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
cmake_minimum_required(VERSION 3.21...3.29 FATAL_ERROR)
# Disable in source build
set(CMAKE_DISABLE_SOURCE_CHANGES ON)
set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
# Project
project(Satisfactory3DMap
VERSION 0.8.0
LANGUAGES CXX)
# Set a default build type if none was specified
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Release' as none was specified.")
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build." FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "RelWithDebInfo" "MinSizeRel")
endif ()
# Modules
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake)
include(build_info)
include(copyright)
include(warning_level)
# Options
option(SATISFACTORY3DMAP_INSTALL_LIB "Install SatisfactorySave library." OFF)
option(SATISFACTORY3DMAP_BUILD_SHARED "Build shared library." OFF)
option(SATISFACTORY3DMAP_BUILD_PIC "Build position independent code." ON)
option(SATISFACTORY3DMAP_BUILD_APP "Build Satisfactory3DMap App." ON)
option(SATISFACTORY3DMAP_BUILD_LIB_PYTHON "Build SatisfactorySave Python library." OFF)
option(SATISFACTORY3DMAP_STRICT_WARNINGS "Enable strict compiler warnings." OFF)
option(SATISFACTORY3DMAP_BENCHMARK "Benchmark save loading." OFF)
# Dependencies
find_package(OpenMP REQUIRED)
include(libs/libs.cmake)
# Save Library
add_subdirectory(libsave)
# Main App
if (SATISFACTORY3DMAP_BUILD_APP)
add_subdirectory(map)
if (MSVC)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT ${PROJECT_NAME})
endif ()
endif ()
# Python Library
if (SATISFACTORY3DMAP_BUILD_LIB_PYTHON)
add_subdirectory(libsavepy)
endif ()
# Visual Studio target folders
set_property(GLOBAL PROPERTY USE_FOLDERS ON)