-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
39 lines (32 loc) · 1.07 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
cmake_minimum_required(VERSION 3.5)
project(readgsa LANGUAGES C Fortran)
find_package (Python3 COMPONENTS Interpreter)
enable_testing()
# GNU COMPILERS
if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU")
set(ENV{FC} "gfortran")
set(ENV{FFLAGS} " " ) # ADDITIONAL OPTIONAL FLAGS
set(Fortran_FLAGS -Wcpp -O3 -w)
add_compile_options( ${Fortran_FLAGS} ${FFLAGS})
#endif()
elseif (CMAKE_C_COMPILER_ID MATCHES "GNU")
set(ENV{CC} "gcc")
set(ENV{CFLAGS} " " ) # ADDITIONAL OPTIONAL FLAGS
set(C_FLAGS -Wcpp -O3 -w)
add_compile_options( ${C_FLAGS} ${CFLAGS} )
endif()
# INTEL COMPILERS
if(CMAKE_Fortran_COMPILER_ID MATCHES "Intel")
set (ENV{FC} "ifort" )
set (ENV{FFLAGS} "" )
set (ENV{Fortran_FLAGS} -fPIC -g -w )
add_compile_options(${Fortran_FLAGS} ${FFLAGS})
#endif()
elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
set (ENV{CC} "icc" )
set (ENV{CFLAGS} "" )
set (ENV{C_FLAGS} -fPIC -g -w )
add_compile_options(${Fortran_FLAGS} ${CFLAGS} )
endif()
# COMPILE THE FORTRAN ROUTINE
add_subdirectory ( src )