-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
75 lines (59 loc) · 2.51 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
# Copyright (c) 2015 Alireza Kheirkhahan
#
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
# We require at least CMake V2.8.10
cmake_minimum_required(VERSION 2.8.10 FATAL_ERROR)
################################################################################
# project metadata
################################################################################
project(hpxio CXX)
set(HPXIO_MAJOR_VERSION 0)
set(HPXIO_MINOR_VERSION 1)
set(HPXIO_PATCH_LEVEL 0)
set(HPXIO_VERSION "${HPXIO_MAJOR_VERSION}.${HPXIO_MINOR_VERSION}.${HPXIO_PATCH_LEVEL}")
set(HPXIO_LIBRARY_VERSION "${HPXIO_VERSION}")
################################################################################
# Find and Include HPX
################################################################################
if(NOT HPX_ROOT)
message(FATAL_ERROR "HPX_ROOT not set, unable to find HPX!")
endif()
if(HPX_ROOT AND NOT HPX_DIR)
set(HPX_DIR "${HPX_ROOT}/lib/cmake/HPX")
endif()
# Instruct cmake to find the HPX settings, it looks for HPXConfig.cmake in ${HPX_DIR}
find_package(HPX)
include_directories(${HPX_INCLUDE_DIR})
link_directories(${HPX_LIBRARY_DIR})
# Adjust auxiliary build settings for HPX to work properly
if(NOT MSVC)
set(HPX_RPATH ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}${HPX_RPATH})
else()
# enable solution folders for MSVC
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
if(HPX_NO_INSTALL)
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/$(Configuration)" CACHE PATH
"Prefix prepended to install directories." FORCE)
endif()
endif()
################################################################################
# Additional CMake configuration
################################################################################
set(CMAKE_MODULE_PATH "${hpxio_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH} )
################################################################################
# Build and Create Executable
################################################################################
include_directories("${hpxio_SOURCE_DIR}" "${CMAKE_BINARY_DIR}")
add_subdirectory(src)
add_subdirectory(examples)
################################################################################
# Installation
################################################################################
install(
DIRECTORY hpxio
DESTINATION include
FILES_MATCHING PATTERN "*.hpp"
PATTERN ".git" EXCLUDE
PATTERN "CMakeFiles" EXCLUDE
PATTERN "CTestFiles" EXCLUDE)