-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathCMakeLists.txt
41 lines (32 loc) · 1.26 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
cmake_minimum_required(VERSION 3.3)
project(monobind VERSION 0.0.1 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
# Uncomment this if mono executables are not required
# SET(MONO_ONLY_LIBRARIES_REQUIRED ON CACHE BOOL "" FORCE)
find_package(Mono REQUIRED)
if(MONO_FOUND)
message("Found Mono ${MONO_VERSION}")
else()
message(FATAL_ERROR "Could not find Mono!")
endif()
add_compile_definitions(MONOBIND_MONO_ROOT="${MONO_ROOT_DIR}")
include_directories(${MONO_INCLUDE_DIRS})
link_libraries(${MONO_LIBRARIES})
link_directories(${MONO_LIBRARY_DIRS})
option(MONOBIND_ENABLE_EXCEPTIONS "compile with exceptions enabled" TRUE)
option(MONOBIND_BUILD_TESTS "build monobind tests" TRUE)
option(MONOBIND_BUILD_EXAMPLES "build monobind examples" TRUE)
if(NOT MONOBIND_ENABLE_EXCEPTIONS)
add_compile_definitions(MONOBIND_DISABLE_EXCEPTIONS)
endif()
if (MONOBIND_BUILD_EXAMPLES)
include(ModuleMonoDllCopy)
add_subdirectory(examples/sandbox)
add_subdirectory(examples/simple_function_call)
add_subdirectory(examples/method_parameters)
add_subdirectory(examples/custom_types)
add_subdirectory(examples/angourimath)
add_subdirectory(examples/exporting)
add_subdirectory(examples/virtual_methods)
endif()