~wbetz/fesslix/flxeigen

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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# Fesslix - Stochastic Analysis
# Copyright (C) 2010-2016 Wolfgang Betz
#
# Fesslix is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Fesslix is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Fesslix.  If not, see <http://www.gnu.org/licenses/>. 

include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(${PROJECT_BINARY_DIR})

include_directories(${FLXLIB_INCLUDE_DIR})
include_directories(${FLXLIB_INCLUDE_DIR}/../build/src/)
link_directories(${FLXLIB_LIB_DIR})

include_directories(${Boost_INCLUDE_DIRS})

if (GSL_FOUND)
  include_directories(${GSL_INCLUDE_DIRS})	
  link_directories(${GSL_LIBRARY})
endif()

configure_file (
  "${PROJECT_SOURCE_DIR}/src/config.h.in"
  "${PROJECT_BINARY_DIR}/src/config.h"   	
)

if(MSVC)
  include (GenerateExportHeader)
  add_compiler_export_flags()
endif(MSVC)


# Eigen - Library
# ==================
add_library(flxeigen ${FLX_LIB_LINKstat} flxMtx_Eigen.cpp flxMtx_Eigen_ARP.cpp flxMtx_Eigen_GSL.cpp )
if(MSVC)
  generate_export_header(flxeigen)
endif(MSVC)

if(UNIX)
  target_link_libraries(flxeigen ${FLXLIB_LIBRARIES} ${GSL_LIBRARIES} ${FLX_LIBS_GSL})
else()
  if("${FLX_USE_GSL}" STREQUAL "ON")
    if(MINGW)
      set(FLX_LIBS_GSL -lgsl)
    else(MINGW)
      set(FLX_LIBS_GSL gsl.lib gslcblas.lib)
    endif(MINGW)
  else("${FLX_USE_GSL}" STREQUAL "ON")
    set(FLX_LIBS_GSL  )
  endif("${FLX_USE_GSL}" STREQUAL "ON")
  target_link_libraries(flxeigen ${FLXLIB_LIBRARIES} ${FLX_LIBS_GSL})
endif()


# Installation
# ============
  set(FLX_LIBS flxeigen)
  set(FLX_EXEC )

  if(UNIX) 
    install(TARGETS ${FLX_LIBS} ${FLX_EXEC}
      RUNTIME DESTINATION bin
      LIBRARY DESTINATION lib
      ARCHIVE DESTINATION lib/static
    )
  else(UNIX)
    install(TARGETS ${FLX_LIBS} ${FLX_EXEC}
      RUNTIME DESTINATION ./
      LIBRARY DESTINATION ./
      ARCHIVE DESTINATION ./
    )
  endif(UNIX) 

  
#===================================================================================
# Install Header files
#===================================================================================

if("${FLX_INSTALL_HEADERS}" STREQUAL "ON")

  set(FLX_HEADERS 
    flxeigenversion.h
    flxMtx_Eigen.h
  )
  if(WIN32)
    install (FILES ${FLX_HEADERS} DESTINATION include)
    install (FILES ${PROJECT_BINARY_DIR}/src/flxeigen_export.h DESTINATION include)
  else()
    install (FILES ${FLX_HEADERS} DESTINATION include/fesslix)
  endif()
  
endif("${FLX_INSTALL_HEADERS}" STREQUAL "ON")