forked from JetBrains-Research/boost.simd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
112 lines (97 loc) · 4.25 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
## -------------------------------------------------------------------------------------------------
## Copyright 2016 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 project
## -------------------------------------------------------------------------------------------------
project(Boost.SIMD CXX)
set(PROJECT_DOC_DIR ${PROJECT_SOURCE_DIR}/doc)
## Setup target for MSVC
## -------------------------------------------------------------------------------------------------
if(NOT CMAKE_GENERATOR MATCHES "Make|Ninja")
set(CMAKE_CONFIGURATION_TYPES Release Debug SIMDTest SIMDTestDebug SIMDBench CACHE STRING "" FORCE)
endif()
## Requirements for ns.cmake:
## -------------------------------------------------------------------------------------------------
set(NS_CMAKE_GIT_TAG master)
include(cmake/ns.cmake.install.cmake)
if (NOT NS_CMAKE_INSTALLED)
return()
endif()
include(cmake/ns/ns.cmake)
## -------------------------------------------------------------------------------------------------
## Potential warnings fixup
## -------------------------------------------------------------------------------------------------
NS_ignore(${IS_TRAVIS_CI})
NS_ignore(${USE_SELF_BOOST})
## Search for packages
## -------------------------------------------------------------------------------------------------
if (DEFINED IS_TRAVIS_CI)
# We do not want to find boost here, as we're gonna use the one on NumScale/boost-header-only
set(GIT_EXECUTABLE git)
set(USE_SELF_BOOST TRUE)
else()
NS_find_package(Git QUIET)
if (NOT DEFINED USE_SELF_BOOST)
NS_find_package(Boost 1.60 REQUIRED)
endif()
endif()
##
NS_prevent_in_source_build()
## External projects
## -------------------------------------------------------------------------------------------------
set(STF_STANDALONE_DESTINATION ${PROJECT_SOURCE_DIR}/test)
set(BRIGAND_STANDALONE_DESTINATION ${PROJECT_SOURCE_DIR}/include/boost/simd/detail)
NS_project_include(brigand.standalone)
NS_project_include(stf.standalone)
if (DEFINED USE_SELF_BOOST)
if (DEFINED CMAKE_INSTALL_PREFIX)
NS_project_global_destination(${CMAKE_INSTALL_PREFIX})
endif()
set(BOOST_HEADER_ONLY_GIT_TAG develop)
NS_project_include(boost-header-only)
# NOTE: (workaround)
# We DO need to use `CMAKE_ARGS` here otherwise, travis is not able to find boost even when
# exporting BOOST_ROOT using shell export...
set(BOOST_DISPATCH_GIT_TAG develop)
set(BOOST_DISPATCH_OPTIONS
CMAKE_ARGS "-DBOOST_ROOT=${BOOST_HEADER_ONLY_DESTINATION}/include"
)
NS_project_include(boost.dispatch)
add_dependencies(BOOST_DISPATCH BOOST_HEADER_ONLY)
set(Boost_INCLUDE_DIRS
${BOOST_DISPATCH_DESTINATION}/include
${BOOST_HEADER_ONLY_DESTINATION}/include
)
endif()
## Compute version string and mode + Documentation
## -------------------------------------------------------------------------------------------------
if (NOT DEFINED IS_TRAVIS_CI)
NS_include(parse_revision)
NS_include(doc/doxygen)
endif()
## Install target
## -------------------------------------------------------------------------------------------------
install(DIRECTORY ${PROJECT_SOURCE_DIR}/include DESTINATION .)
## Add include directories
## -------------------------------------------------------------------------------------------------
include_directories(
${PROJECT_SOURCE_DIR}/include
${PROJECT_SOURCE_DIR}/test
${Boost_INCLUDE_DIRS}
)
## Setup Unit & Coverage Test
## -------------------------------------------------------------------------------------------------
include(CTest)
add_custom_target(tests)
add_custom_target(unit)
add_dependencies(tests unit)
add_subdirectory(test)
if (NOT DEFINED IS_TRAVIS_CI)
NS_include(coverage)
enable_coverage(boost.simd)
endif()