~wbetz/fesslix/flxeigen

« back to all changes in this revision

Viewing changes to src/CMakeLists.txt

  • Committer: Wolfgang Betz
  • Date: 2016-06-17 14:28:23 UTC
  • Revision ID: wolfgang.betz@fesslix.org-20160617142823-ao5x99dj066qkckg
Initial import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Fesslix - Stochastic Analysis
 
2
# Copyright (C) 2010-2016 Wolfgang Betz
 
3
#
 
4
# Fesslix is free software: you can redistribute it and/or modify
 
5
# it under the terms of the GNU General Public License as published by
 
6
# the Free Software Foundation, either version 3 of the License, or
 
7
# (at your option) any later version.
 
8
#
 
9
# Fesslix is distributed in the hope that it will be useful,
 
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
# GNU General Public License for more details.
 
13
#
 
14
# You should have received a copy of the GNU General Public License
 
15
# along with Fesslix.  If not, see <http://www.gnu.org/licenses/>. 
 
16
 
 
17
include_directories(${CMAKE_CURRENT_BINARY_DIR})
 
18
include_directories(${PROJECT_BINARY_DIR})
 
19
 
 
20
include_directories(${FLXLIB_INCLUDE_DIR})
 
21
include_directories(${FLXLIB_INCLUDE_DIR}/../build/src/)
 
22
link_directories(${FLXLIB_LIB_DIR})
 
23
 
 
24
include_directories(${Boost_INCLUDE_DIRS})
 
25
 
 
26
if (GSL_FOUND)
 
27
  include_directories(${GSL_INCLUDE_DIRS})      
 
28
  link_directories(${GSL_LIBRARY})
 
29
endif()
 
30
 
 
31
configure_file (
 
32
  "${PROJECT_SOURCE_DIR}/src/config.h.in"
 
33
  "${PROJECT_BINARY_DIR}/src/config.h"          
 
34
)
 
35
 
 
36
if(MSVC)
 
37
  include (GenerateExportHeader)
 
38
  add_compiler_export_flags()
 
39
endif(MSVC)
 
40
 
 
41
 
 
42
# Eigen - Library
 
43
# ==================
 
44
add_library(flxeigen ${FLX_LIB_LINKstat} flxMtx_Eigen.cpp flxMtx_Eigen_ARP.cpp flxMtx_Eigen_GSL.cpp )
 
45
if(MSVC)
 
46
  generate_export_header(flxeigen)
 
47
endif(MSVC)
 
48
 
 
49
if(UNIX)
 
50
  target_link_libraries(flxeigen ${FLXLIB_LIBRARIES} ${GSL_LIBRARIES} ${FLX_LIBS_GSL})
 
51
else()
 
52
  if("${FLX_USE_GSL}" STREQUAL "ON")
 
53
    if(MINGW)
 
54
      set(FLX_LIBS_GSL -lgsl)
 
55
    else(MINGW)
 
56
      set(FLX_LIBS_GSL gsl.lib gslcblas.lib)
 
57
    endif(MINGW)
 
58
  else("${FLX_USE_GSL}" STREQUAL "ON")
 
59
    set(FLX_LIBS_GSL  )
 
60
  endif("${FLX_USE_GSL}" STREQUAL "ON")
 
61
  target_link_libraries(flxeigen ${FLXLIB_LIBRARIES} ${FLX_LIBS_GSL})
 
62
endif()
 
63
 
 
64
 
 
65
# Installation
 
66
# ============
 
67
  set(FLX_LIBS flxeigen)
 
68
  set(FLX_EXEC )
 
69
 
 
70
  if(UNIX) 
 
71
    install(TARGETS ${FLX_LIBS} ${FLX_EXEC}
 
72
      RUNTIME DESTINATION bin
 
73
      LIBRARY DESTINATION lib
 
74
      ARCHIVE DESTINATION lib/static
 
75
    )
 
76
  else(UNIX)
 
77
    install(TARGETS ${FLX_LIBS} ${FLX_EXEC}
 
78
      RUNTIME DESTINATION ./
 
79
      LIBRARY DESTINATION ./
 
80
      ARCHIVE DESTINATION ./
 
81
    )
 
82
  endif(UNIX) 
 
83
 
 
84
  
 
85
#===================================================================================
 
86
# Install Header files
 
87
#===================================================================================
 
88
 
 
89
if("${FLX_INSTALL_HEADERS}" STREQUAL "ON")
 
90
 
 
91
  set(FLX_HEADERS 
 
92
    flxeigenversion.h
 
93
    flxMtx_Eigen.h
 
94
  )
 
95
  if(WIN32)
 
96
    install (FILES ${FLX_HEADERS} DESTINATION include)
 
97
    install (FILES ${PROJECT_BINARY_DIR}/src/flxeigen_export.h DESTINATION include)
 
98
  else()
 
99
    install (FILES ${FLX_HEADERS} DESTINATION include/fesslix)
 
100
  endif()
 
101
  
 
102
endif("${FLX_INSTALL_HEADERS}" STREQUAL "ON")
 
103