forked from p12tic/libsimdpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
53 lines (41 loc) · 1.86 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
# Copyright (C) 2011-2013 Povilas Kanapickas <[email protected]>
#
# 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)
cmake_minimum_required(VERSION 2.8.0)
project(libsimdpp)
set(PROJECT_VERSION "2.0-rc2")
set(SIMDPP_API_VERSION "2.0")
set(PKG_NAME "${CMAKE_PROJECT_NAME}")
set(PKG_FULL_NAME "${CMAKE_PROJECT_NAME}-${PROJECT_VERSION}")
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
# ------------------------------------------------------------------------------
# Custom make dist target. Assumes source directory is a git repository.
set(ARCHIVE_NAME "${PKG_FULL_NAME}")
set(ARCHIVE_DIR "${PKG_FULL_NAME}")
add_custom_target(dist
COMMAND cd "${CMAKE_SOURCE_DIR}" && ./make_dist.sh "${ARCHIVE_DIR}" "${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar.gz"
# we may append to the archive now if needed
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
)
# ------------------------------------------------------------------------------
# Check what instruction sets the current host supports. Use them for testing
include(SimdppMultiarch)
simdpp_get_runnable_archs(NATIVE_ARCHS)
simdpp_get_compilable_archs(COMPILABLE_ARCHS)
# ------------------------------------------------------------------------------
set(SIMDPP_INCLUDEDIR "${CMAKE_INSTALL_PREFIX}/include/${PKG_NAME}-${SIMDPP_API_VERSION}")
set(SIMDPP_DOCDIR "${CMAKE_INSTALL_PREFIX}/share/doc/${PKG_NAME}")
set(SIMDPP_PKGCONFIGDIR "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig")
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/libsimdpp.pc.in"
"${CMAKE_CURRENT_BINARY_DIR}/${PKG_NAME}-${SIMDPP_API_VERSION}.pc" @ONLY
)
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/${PKG_NAME}-${SIMDPP_API_VERSION}.pc"
DESTINATION "${SIMDPP_PKGCONFIGDIR}"
)
enable_testing()
add_subdirectory(simdpp)
add_subdirectory(test)