-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
63 lines (46 loc) · 1.84 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
# Copyright (C) 2018 by Godlike
# This code is licensed under the MIT license (MIT)
# (http://opensource.org/licenses/MIT)
cmake_minimum_required(VERSION 3.4)
project(Mule)
set(CMAKE_CXX_STANDARD 14)
option(MULE_BUILD_DOCUMENTATION "Build Mule documentation" OFF)
option(MULE_BUILD_TESTS "Build Mule tests" ON)
message(STATUS "${PROJECT_NAME} ${CMAKE_BUILD_TYPE} configuration:")
message(STATUS "-- MULE_BUILD_DOCUMENTATION: ${MULE_BUILD_DOCUMENTATION}")
message(STATUS "-- MULE_BUILD_TESTS: ${MULE_BUILD_TESTS}")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(MuleUtilitiesConfig)
#Build flags
if (UNIX)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=unused-command-line-argument")
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -pedantic")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s -O3")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g3 -ggdb3 -O0")
elseif(WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP /W3")
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
endif()
if (NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/output/lib)
endif()
if (NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/output/lib)
endif()
if (NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/output)
endif()
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
add_subdirectory(MuleUtilities)
if (MULE_BUILD_TESTS)
enable_testing()
include(CTest)
set(CATCH_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/Catch2)
add_subdirectory(tests)
endif()
get_directory_property(MULE_HAS_PARENT PARENT_DIRECTORY)
if (MULE_HAS_PARENT)
set(MULE_UTILITIES_LIB ${MULE_UTILITIES_LIB} PARENT_SCOPE)
endif()