2015-09-30 22:34:36 +08:00
|
|
|
cmake_minimum_required(VERSION 3.0.2)
|
2015-04-10 02:41:27 +08:00
|
|
|
project(mstch)
|
2015-10-10 19:36:14 +08:00
|
|
|
|
|
|
|
option(WITH_UNIT_TESTS "enable building unit test executable" OFF)
|
|
|
|
option(WITH_BENCHMARK "enable building benchmark executable" OFF)
|
2015-09-24 17:43:27 +08:00
|
|
|
|
2015-09-24 17:51:00 +08:00
|
|
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
2015-09-30 22:30:19 +08:00
|
|
|
set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON)
|
2015-09-24 17:43:27 +08:00
|
|
|
set(CMAKE_BUILD_TYPE Release)
|
|
|
|
|
2015-10-18 22:05:20 +08:00
|
|
|
set(mstch_VERSION 1.0.1)
|
2015-09-30 22:30:19 +08:00
|
|
|
|
2015-09-24 17:43:27 +08:00
|
|
|
if(NOT MSVC)
|
2015-10-10 20:00:45 +08:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra -O3")
|
2015-09-24 17:43:27 +08:00
|
|
|
endif()
|
|
|
|
|
2015-04-12 21:25:16 +08:00
|
|
|
add_subdirectory(src)
|
2015-09-30 22:30:19 +08:00
|
|
|
|
2015-04-12 22:13:21 +08:00
|
|
|
if(WITH_UNIT_TESTS)
|
2015-04-23 18:54:08 +08:00
|
|
|
enable_testing()
|
2015-10-12 06:24:25 +08:00
|
|
|
add_subdirectory(vendor/headerize)
|
2015-10-02 23:19:48 +08:00
|
|
|
add_subdirectory(test)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WITH_BENCHMARK)
|
2015-10-02 20:29:15 +08:00
|
|
|
add_subdirectory(vendor/benchmark)
|
2015-10-02 23:19:48 +08:00
|
|
|
add_subdirectory(benchmark)
|
2015-04-12 22:13:21 +08:00
|
|
|
endif()
|