-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
47 lines (36 loc) · 1.34 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
cmake_minimum_required(VERSION 3.5)
project(savanna_contracts)
set(VERSION_MAJOR 1)
set(VERSION_MINOR 0)
set(VERSION_PATCH 0)
set(VERSION_SUFFIX dev)
if(VERSION_SUFFIX)
set(VERSION_FULL "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}-${VERSION_SUFFIX}")
else()
set(VERSION_FULL "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
endif()
message(STATUS "Building savanna-contracts v${VERSION_FULL}")
include(ExternalProject)
find_package(cdt)
option(SYSTEM_ENABLE_SPRING_VERSION_CHECK
"Enables a configure-time check that the version of Spring's tester library is compatible with this project's unit tests" ON)
option(SYSTEM_ENABLE_CDT_VERSION_CHECK
"Enables a configure-time check that the version of CDT is compatible with this project's contracts" ON)
ExternalProject_Add(
contracts_project
SOURCE_DIR ${CMAKE_SOURCE_DIR}/contracts
BINARY_DIR ${CMAKE_BINARY_DIR}/contracts
CMAKE_ARGS -DCMAKE_BUILD_TYPE=Release
-DCMAKE_TOOLCHAIN_FILE=${CDT_ROOT}/lib/cmake/cdt/CDTWasmToolchain.cmake
UPDATE_COMMAND ""
PATCH_COMMAND ""
TEST_COMMAND ""
INSTALL_COMMAND ""
BUILD_ALWAYS 1)
option(BUILD_TESTS "Build unit tests" OFF)
if(BUILD_TESTS)
message(STATUS "Building unit tests.")
add_subdirectory(tests)
else()
message(STATUS "Unit tests will not be built. To build unit tests, set BUILD_TESTS to ON.")
endif()