Statistics
| Branch: | Tag: | Revision:

root / volk / CMakeLists.txt @ cacfd391

History | View | Annotate | Download (5.2 kB)

1 21d6870a Josh Blum
#
2 21d6870a Josh Blum
# Copyright 2011 Free Software Foundation, Inc.
3 21d6870a Josh Blum
#
4 21d6870a Josh Blum
# This program is free software: you can redistribute it and/or modify
5 21d6870a Josh Blum
# it under the terms of the GNU General Public License as published by
6 21d6870a Josh Blum
# the Free Software Foundation, either version 3 of the License, or
7 21d6870a Josh Blum
# (at your option) any later version.
8 21d6870a Josh Blum
#
9 21d6870a Josh Blum
# This program is distributed in the hope that it will be useful,
10 21d6870a Josh Blum
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11 21d6870a Josh Blum
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 21d6870a Josh Blum
# GNU General Public License for more details.
13 21d6870a Josh Blum
#
14 21d6870a Josh Blum
# You should have received a copy of the GNU General Public License
15 21d6870a Josh Blum
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
16 21d6870a Josh Blum
#
17 21d6870a Josh Blum
18 21d6870a Josh Blum
########################################################################
19 21d6870a Josh Blum
# Project setup
20 21d6870a Josh Blum
########################################################################
21 71c0f14a Josh Blum
cmake_minimum_required(VERSION 2.6)
22 71c0f14a Josh Blum
if(NOT DEFINED CMAKE_BUILD_TYPE)
23 71c0f14a Josh Blum
    set(CMAKE_BUILD_TYPE Release)
24 71c0f14a Josh Blum
endif()
25 71c0f14a Josh Blum
set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Choose build type: None Debug Release RelWithDebInfo MinSizeRel")
26 71c0f14a Josh Blum
project(volk)
27 71c0f14a Josh Blum
enable_language(CXX)
28 71c0f14a Josh Blum
enable_language(C)
29 71c0f14a Josh Blum
enable_testing()
30 71c0f14a Josh Blum
set(VERSION 0.1)
31 71c0f14a Josh Blum
set(LIBVER 0.0.0)
32 21d6870a Josh Blum
33 71c0f14a Josh Blum
set(CMAKE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) #allows this to be a sub-project
34 71c0f14a Josh Blum
set(CMAKE_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) #allows this to be a sub-project
35 a2894f6a Josh Blum
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) #location for custom "Modules"
36 1fe474ce Josh Blum
37 21d6870a Josh Blum
########################################################################
38 24d572bc Josh Blum
# Environment setup
39 24d572bc Josh Blum
########################################################################
40 24d572bc Josh Blum
IF(NOT DEFINED BOOST_ROOT)
41 24d572bc Josh Blum
    SET(BOOST_ROOT "")
42 24d572bc Josh Blum
ENDIF()
43 24d572bc Josh Blum
SET(BOOST_ROOT ${BOOST_ROOT} CACHE STRING "Modify search path for Boost components")
44 24d572bc Josh Blum
45 24d572bc Josh Blum
#after caching user-defined value, make sure to add the install prefix
46 24d572bc Josh Blum
SET(BOOST_ROOT ${BOOST_ROOT}:${CMAKE_INSTALL_PREFIX})
47 24d572bc Josh Blum
48 24d572bc Josh Blum
IF(NOT DEFINED CROSSCOMPILE_MULTILIB)
49 24d572bc Josh Blum
    SET(CROSSCOMPILE_MULTILIB "")
50 24d572bc Josh Blum
ENDIF()
51 24d572bc Josh Blum
SET(CROSSCOMPILE_MULTILIB ${CROSSCOMPILE_MULTILIB} CACHE STRING "Define \"true\" if you have and want to use multiple C development libs installed for cross compile")
52 24d572bc Josh Blum
53 24d572bc Josh Blum
54 24d572bc Josh Blum
########################################################################
55 21d6870a Josh Blum
# Dependencies setup
56 21d6870a Josh Blum
########################################################################
57 4e86843a Josh Blum
include(GrPython) #sets PYTHON_EXECUTABLE and PYTHON_DASH_B
58 4e86843a Josh Blum
GR_PYTHON_CHECK_MODULE("python >= 2.5"     sys          "sys.version.split()[0] >= '2.5'"           PYTHON_MIN_VER_FOUND)
59 4e86843a Josh Blum
GR_PYTHON_CHECK_MODULE("Cheetah >= 2.0.0"  Cheetah      "Cheetah.Version >= '2.0.0'"                CHEETAH_FOUND)
60 4e86843a Josh Blum
61 4e86843a Josh Blum
if(NOT PYTHON_MIN_VER_FOUND)
62 4e86843a Josh Blum
    message(FATAL_ERROR "Python 2.5 or greater required to build VOLK")
63 4e86843a Josh Blum
endif()
64 4e86843a Josh Blum
65 4e86843a Josh Blum
if(NOT CHEETAH_FOUND)
66 4e86843a Josh Blum
    message(FATAL_ERROR "Cheetah templates required to build VOLK")
67 4e86843a Josh Blum
endif()
68 4e86843a Josh Blum
69 cacfd391 Josh Blum
set(Boost_ADDITIONAL_VERSIONS
70 cacfd391 Josh Blum
    "1.35.0" "1.35" "1.36.0" "1.36" "1.37.0" "1.37" "1.38.0" "1.38" "1.39.0" "1.39"
71 cacfd391 Josh Blum
    "1.40.0" "1.40" "1.41.0" "1.41" "1.42.0" "1.42" "1.43.0" "1.43" "1.44.0" "1.44"
72 cacfd391 Josh Blum
    "1.45.0" "1.45" "1.46.0" "1.46" "1.47.0" "1.47" "1.48.0" "1.48" "1.49.0" "1.49"
73 cacfd391 Josh Blum
    "1.50.0" "1.50" "1.51.0" "1.51" "1.52.0" "1.52" "1.53.0" "1.53" "1.54.0" "1.54"
74 cacfd391 Josh Blum
    "1.55.0" "1.55" "1.56.0" "1.56" "1.57.0" "1.57" "1.58.0" "1.58" "1.59.0" "1.59"
75 cacfd391 Josh Blum
    "1.60.0" "1.60" "1.61.0" "1.61" "1.62.0" "1.62" "1.63.0" "1.63" "1.64.0" "1.64"
76 cacfd391 Josh Blum
    "1.65.0" "1.65" "1.66.0" "1.66" "1.67.0" "1.67" "1.68.0" "1.68" "1.69.0" "1.69"
77 cacfd391 Josh Blum
)
78 a2894f6a Josh Blum
find_package(Boost COMPONENTS unit_test_framework)
79 cacfd391 Josh Blum
80 a2894f6a Josh Blum
find_package(ORC)
81 a2894f6a Josh Blum
82 21d6870a Josh Blum
########################################################################
83 21d6870a Josh Blum
# Setup the package config file
84 21d6870a Josh Blum
########################################################################
85 21d6870a Josh Blum
#set variables found in the pc.in file
86 71c0f14a Josh Blum
set(prefix ${CMAKE_INSTALL_PREFIX})
87 71c0f14a Josh Blum
set(exec_prefix "\${prefix}")
88 71c0f14a Josh Blum
set(libdir "\${exec_prefix}/lib${LIB_SUFFIX}")
89 71c0f14a Josh Blum
set(includedir "\${prefix}/include")
90 21d6870a Josh Blum
91 71c0f14a Josh Blum
configure_file(
92 21d6870a Josh Blum
    ${CMAKE_CURRENT_SOURCE_DIR}/volk.pc.in
93 21d6870a Josh Blum
    ${CMAKE_CURRENT_BINARY_DIR}/volk.pc
94 21d6870a Josh Blum
@ONLY)
95 21d6870a Josh Blum
96 71c0f14a Josh Blum
install(
97 256304ee Nick Foster
    FILES ${CMAKE_CURRENT_BINARY_DIR}/volk.pc
98 21d6870a Josh Blum
    DESTINATION lib${LIB_SUFFIX}/pkgconfig
99 d6334f04 Josh Blum
    COMPONENT "volk_devel"
100 21d6870a Josh Blum
)
101 21d6870a Josh Blum
102 21d6870a Josh Blum
########################################################################
103 21d6870a Josh Blum
# Install all headers in the include directories
104 21d6870a Josh Blum
########################################################################
105 71c0f14a Josh Blum
install(
106 21d6870a Josh Blum
    DIRECTORY ${CMAKE_SOURCE_DIR}/include/volk
107 d6334f04 Josh Blum
    DESTINATION include COMPONENT "volk_devel"
108 d6334f04 Josh Blum
    FILES_MATCHING PATTERN "*.h"
109 21d6870a Josh Blum
)
110 21d6870a Josh Blum
111 71c0f14a Josh Blum
install(FILES
112 9bfe75fd Josh Blum
    ${CMAKE_BINARY_DIR}/include/volk/volk.h
113 9bfe75fd Josh Blum
    ${CMAKE_BINARY_DIR}/include/volk/volk_cpu.h
114 9bfe75fd Josh Blum
    ${CMAKE_BINARY_DIR}/include/volk/volk_config_fixed.h
115 8879533b Nick Foster
    ${CMAKE_BINARY_DIR}/include/volk/volk_typedefs.h
116 d6334f04 Josh Blum
    DESTINATION include/volk
117 d6334f04 Josh Blum
    COMPONENT "volk_devel"
118 d6334f04 Josh Blum
)
119 9bfe75fd Josh Blum
120 21d6870a Josh Blum
########################################################################
121 21d6870a Josh Blum
# Setup the library
122 21d6870a Josh Blum
########################################################################
123 71c0f14a Josh Blum
add_subdirectory(lib)
124 21d6870a Josh Blum
125 21d6870a Josh Blum
########################################################################
126 b50dbc44 Nick Foster
# And the utility apps
127 b50dbc44 Nick Foster
########################################################################
128 71c0f14a Josh Blum
add_subdirectory(apps)
129 b50dbc44 Nick Foster
130 b50dbc44 Nick Foster
########################################################################
131 21d6870a Josh Blum
# Print summary
132 21d6870a Josh Blum
########################################################################
133 71c0f14a Josh Blum
message(STATUS "Using install prefix: ${CMAKE_INSTALL_PREFIX}")