forked from JetBrains-Research/boost.simd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
77 lines (65 loc) · 3.64 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
72
73
74
75
76
77
#===================================================================================================
# Copyright 2012 - 2015 NumScale SAS
#
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt
#===================================================================================================
cmake_minimum_required(VERSION 2.8.7)
#===================================================================================================
# Setup target for MSVC
#===================================================================================================
if(NOT CMAKE_GENERATOR MATCHES "Make|Ninja")
set(CMAKE_CONFIGURATION_TYPES Release Debug SIMDTest SIMDTestDebug SIMDBench CACHE STRING "" FORCE)
endif()
##===================================================================================================
## Setup project
##===================================================================================================
project(Boost.SIMD CXX)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/test")
##===================================================================================================
## Prevent in-source build
##===================================================================================================
if(${PROJECT_SOURCE_DIR} STREQUAL ${PROJECT_BINARY_DIR})
message( FATAL_ERROR "Building in-source, not recommended! Build in a separate directory." )
endif()
##===================================================================================================
## Search for packages.
##===================================================================================================
set(Boost_ADDITIONAL_VERSIONS "1.59")
find_package(Boost 1.58)
find_package(Doxygen QUIET)
##===================================================================================================
## Install pre-commit git hook
##===================================================================================================
execute_process(COMMAND ${CMAKE_COMMAND} -E copy
${PROJECT_SOURCE_DIR}/script/git/pre-commit
${PROJECT_SOURCE_DIR}/.git/hooks
)
##===================================================================================================
## Compute version string and mode
##===================================================================================================
include(parse_revision)
##===================================================================================================
## Add include directories
##===================================================================================================
include_directories ( ${PROJECT_SOURCE_DIR}/include
${PROJECT_SOURCE_DIR}/test
${Boost_INCLUDE_DIRS}
)
##===================================================================================================
## Setup Documentation
##===================================================================================================
add_subdirectory(doc)
##===================================================================================================
## Setup Unit & Coverage Test
##===================================================================================================
include(CTest)
add_custom_target(tests)
add_custom_target(unit)
include(coverage)
include( CTest )
enable_coverage(boost.simd)
add_dependencies(tests unit)
add_subdirectory(test)