forked from JetBrains-Research/boost.simd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
1,098 additions
and
261 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,77 +1,107 @@ | ||
#=================================================================================================== | ||
# 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 | ||
#=================================================================================================== | ||
## ------------------------------------------------------------------------------------------------- | ||
## 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 target for MSVC | ||
#=================================================================================================== | ||
## 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() | ||
|
||
##=================================================================================================== | ||
## 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") | ||
## 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) | ||
## ------------------------------------------------------------------------------------------------- | ||
|
||
##=================================================================================================== | ||
## 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." ) | ||
## 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() | ||
|
||
##=================================================================================================== | ||
## Search for packages. | ||
##=================================================================================================== | ||
set(Boost_ADDITIONAL_VERSIONS "1.59") | ||
find_package(Boost 1.58) | ||
find_package(Doxygen QUIET) | ||
## | ||
NS_prevent_in_source_build() | ||
|
||
##=================================================================================================== | ||
## Install pre-commit git hook | ||
##=================================================================================================== | ||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy | ||
${PROJECT_SOURCE_DIR}/script/git/pre-commit | ||
${PROJECT_SOURCE_DIR}/.git/hooks | ||
) | ||
## External projects | ||
## ------------------------------------------------------------------------------------------------- | ||
set(STF_STANDALONE_DESTINATION ${PROJECT_SOURCE_DIR}/test) | ||
set(BRIGAND_STANDALONE_DESTINATION ${PROJECT_SOURCE_DIR}/include/boost/simd/detail) | ||
|
||
##=================================================================================================== | ||
## Compute version string and mode | ||
##=================================================================================================== | ||
include(parse_revision) | ||
NS_project_include(brigand.standalone) | ||
NS_project_include(stf.standalone) | ||
if (DEFINED USE_SELF_BOOST) | ||
set(BOOST_HEADER_ONLY_GIT_TAG develop) | ||
NS_project_include(boost-header-only) | ||
|
||
##=================================================================================================== | ||
## Add include directories | ||
##=================================================================================================== | ||
include_directories ( ${PROJECT_SOURCE_DIR}/include | ||
${PROJECT_SOURCE_DIR}/test | ||
${Boost_INCLUDE_DIRS} | ||
) | ||
# 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) | ||
set(Boost_INCLUDE_DIRS | ||
${BOOST_DISPATCH_DESTINATION}/include | ||
${BOOST_HEADER_ONLY_DESTINATION}/include | ||
) | ||
endif() | ||
|
||
##=================================================================================================== | ||
## Setup Documentation | ||
##=================================================================================================== | ||
add_subdirectory(doc) | ||
## 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) | ||
|
||
include(coverage) | ||
include( CTest ) | ||
|
||
enable_coverage(boost.simd) | ||
add_dependencies(tests unit) | ||
|
||
add_subdirectory(test) | ||
|
||
if (NOT DEFINED IS_TRAVIS_CI) | ||
NS_include(coverage) | ||
enable_coverage(boost.simd) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
##================================================================================================== | ||
## Copyright 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 | ||
##================================================================================================== | ||
|
||
include(ExternalProject) | ||
|
||
if (NOT NS_CMAKE_INSTALL_DIR) | ||
set(NS_CMAKE_INSTALL_DIR ${PROJECT_SOURCE_DIR}) | ||
endif() | ||
|
||
if (NOT NS_CMAKE_EXTERNAL_PROJECTS_DESTINATION) | ||
set(NS_CMAKE_EXTERNAL_PROJECTS_DESTINATION ${PROJECT_BINARY_DIR}/_install) | ||
endif() | ||
|
||
if (NOT NS_CMAKE_GIT_TAG) | ||
set(NS_CMAKE_GIT_TAG master) | ||
endif() | ||
|
||
ExternalProject_Add(NS_CMAKE | ||
GIT_REPOSITORY https://github.com/NumScale/ns.cmake.git | ||
GIT_TAG ${NS_CMAKE_GIT_TAG} | ||
PREFIX ${NS_CMAKE_EXTERNAL_PROJECTS_DESTINATION} | ||
|
||
STEP_TARGETS install | ||
|
||
INSTALL_DIR ${NS_CMAKE_INSTALL_DIR} | ||
CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${NS_CMAKE_INSTALL_DIR}" | ||
) | ||
set(NS_CMAKE_INSTALL_TARGET NS_CMAKE-install) | ||
set(NS_CMAKE_SOURCES ${NS_CMAKE_INSTALL_DIR}/cmake) | ||
|
||
set(NS_CMAKE_EXTERNAL_PROJECTS | ||
NS_CMAKE | ||
) | ||
|
||
add_custom_target(ns.cmake.update | ||
DEPENDS ${NS_CMAKE_INSTALL_TARGET} | ||
) | ||
|
||
add_custom_target(ns.cmake.installed | ||
DEPENDS ns.cmake.update | ||
) | ||
|
||
if (EXISTS ${NS_CMAKE_INSTALL_DIR}/cmake/ns/ns.cmake) | ||
message(STATUS "## -----------------------------------------------------------------------------") | ||
message("") | ||
message(" ns.cmake is now installed!") | ||
message(" ns.cmake's (init) targets have been excluded from the `all` target!") | ||
message("") | ||
message(STATUS "## -----------------------------------------------------------------------------") | ||
set_target_properties(NS_CMAKE | ||
PROPERTIES EXCLUDE_FROM_ALL TRUE | ||
) | ||
set(NS_CMAKE_INSTALLED TRUE) | ||
else() | ||
message(WARNING "You intended to use ns.cmake, but it has not been installed yet!") | ||
|
||
add_custom_command( | ||
TARGET NS_CMAKE | ||
COMMAND ${CMAKE_COMMAND} ${CMAKE_SOURCE_DIR} | ||
) | ||
set(NS_CMAKE_INSTALLED FALSE) | ||
endif() |
5 changes: 4 additions & 1 deletion
5
cmake/add_target_parent.cmake → cmake/ns/add_target_parent.cmake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.