forked from DArpinoRobotics/eigen-pod
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
48 lines (38 loc) · 1.91 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
cmake_minimum_required(VERSION 2.8.0)
project(eigen)
include(ExternalProject)
# PODs out-of-source build logic
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
find_file(_build_dir build PATHS ${PROJECT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/.. ${PROJECT_SOURCE_DIR}/../.. ${PROJECT_SOURCE_DIR}/../../.. ${PROJECT_SOURCE_DIR}/../../../..)
if (_build_dir)
set(CMAKE_INSTALL_PREFIX "${_build_dir}" CACHE STRING
"install prefix" FORCE)
else()
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_SOURCE_DIR}/build)
set(CMAKE_INSTALL_PREFIX ${PROJECT_SOURCE_DIR}/build
CACHE STRING "install prefix" FORCE)
endif()
endif()
message(STATUS CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX})
#set(ENV{PKG_CONFIG_LIBDIR} "${CMAKE_INSTALL_PREFIX}/lib")
# Note: this doesn't survive through to the configure step of the extenal project (http://cmake.3232098.n2.nabble.com/Pass-PATH-to-ExternalProject-Add-td5788195.html). added an install version below
ExternalProject_Add(eigen
URL https://bitbucket.org/eigen/eigen/get/5a47e5a.tar.gz
URL_MD5 54426bf9cb034a9031e9cd1327cc0921
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND "")
# this was cleaner (more platform independent) than writing a wrapper shell script around CMAKE
ExternalProject_Get_Property(eigen SOURCE_DIR)
file(MAKE_DIRECTORY ${CMAKE_INSTALL_PREFIX}/include/eigen3)
install(DIRECTORY ${SOURCE_DIR}/Eigen ${SOURCE_DIR}/unsupported
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/eigen3)
install(FILES ${SOURCE_DIR}/signature_of_eigen3_matrix_library
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/eigen3)
# and finally the configure file
set(EIGEN_VERSION_NUMBER 3.2.93)
set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/eigen3)
configure_file(eigen3.pc.in eigen3.pc)
file(MAKE_DIRECTORY ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/eigen3.pc
DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig)