Blame view

cainlib/CMakeLists.txt 815 Bytes
c121b914   Hacene SI HADJ MOHAND   adding cain lib
1
2
cmake_minimum_required(VERSION 2.6)

14af65f9   Hacene SI HADJ MOHAND   lib ok validation ko
3
PROJECT(cainlib CXX Fortran)
c121b914   Hacene SI HADJ MOHAND   adding cain lib
4
5
6
7
8
9
10

add_definitions( -DLINUX )

set(CMAKE_BUILD_TYPE Release)

set(CMAKE_CXX_FLAGS "-O3 -fPIC -fno-align-commons -fbounds-check -fbacktrace -ffixed-form")

9bcb7350   Benjamin Renard   Improve libcain c...
11
12
13
14
15
16
17
18
19
20
21
if(NOT DEFINED ENV{CAIN_COEF_DIR})
    set(CAIN_COEF_DIR "${CMAKE_SOURCE_DIR}/src/")
else()
    set(CAIN_COEF_DIR "$ENV{CAIN_COEF_DIR}")
endif()

configure_file (
 "${CMAKE_SOURCE_DIR}/src/cain.f90.in"
 "${CMAKE_SOURCE_DIR}/src/cain.f90"
)

c121b914   Hacene SI HADJ MOHAND   adding cain lib
22
23
24
file(
		GLOB
		source_files
14af65f9   Hacene SI HADJ MOHAND   lib ok validation ko
25
		src/*.f90
c121b914   Hacene SI HADJ MOHAND   adding cain lib
26
27
)

14af65f9   Hacene SI HADJ MOHAND   lib ok validation ko
28
add_library(cainlib SHARED ${source_files})
c121b914   Hacene SI HADJ MOHAND   adding cain lib
29

14af65f9   Hacene SI HADJ MOHAND   lib ok validation ko
30
31
32
33
SET_TARGET_PROPERTIES(cainlib PROPERTIES LINKER_LANGUAGE CXX)

install (TARGETS cainlib DESTINATION lib)
install (FILES src/include/cainlib.hh DESTINATION include)
9bcb7350   Benjamin Renard   Improve libcain c...
34
35
36
if(DEFINED ENV{CAIN_COEF_DIR})
    install (FILES src/FSU_mars90 DESTINATION ${CAIN_COEF_DIR})
endif()