-
Notifications
You must be signed in to change notification settings - Fork 80
/
CMakeLists.txt
71 lines (57 loc) · 2.18 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# CMake version
cmake_minimum_required(VERSION 3.8.2 FATAL_ERROR)
# Include cmake modules
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/Builds/CMake")
# Declare project
project(RosettaStone)
# Set RosettaStone's root directory
if (NOT ROSETTA_ROOT)
set(ROSETTA_ROOT ${PROJECT_SOURCE_DIR})
endif()
# Set output directories
set(DEFAULT_CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
# Set enable output of compile commands during generation
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Includes
include_directories(Includes)
include_directories(Extensions/RosettaPython/Includes)
include_directories(Libraries)
include_directories(Libraries/doctest/doctest)
include_directories(Libraries/Lyra/include)
include_directories(Libraries/random/include)
include_directories(Libraries/pybind11/include)
# Compile options
include(Builds/CMake/CompileOptions.cmake)
# Build type - Release by default
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
# Overrides
set(CMAKE_MACOSX_RPATH ON)
# Set resources
set(RESOURCES_DIR ${ROSETTA_ROOT}/Resources)
set(RESOURCES_JSONS
${RESOURCES_DIR}/cards.collectible.json
${RESOURCES_DIR}/cards.json)
# Project modules
add_subdirectory(Libraries/doctest)
add_subdirectory(Sources/Rosetta)
add_subdirectory(Tests/UnitTests)
add_subdirectory(Extensions/RosettaConsole)
add_subdirectory(Extensions/RosettaTool)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Builds/setup.py.in ${CMAKE_CURRENT_SOURCE_DIR}/setup.py)
# Code coverage - Debug only
# NOTE: Code coverage results with an optimized (non-Debug) build may be misleading
option(BUILD_COVERAGE "Build code coverage" OFF)
if (CMAKE_BUILD_TYPE MATCHES Debug AND CMAKE_COMPILER_IS_GNUCXX AND BUILD_COVERAGE)
include(CodeCoverage)
setup_target_for_coverage(${PROJECT_NAME}_coverage UnitTests coverage)
endif()
add_subdirectory(Libraries/pybind11)
if (BUILD_FROM_PIP)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${DEFAULT_CMAKE_LIBRARY_OUTPUT_DIRECTORY})
endif()
add_subdirectory(Extensions/RosettaPython)