-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
60 lines (42 loc) · 2.2 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
49
50
51
52
53
54
55
56
57
58
59
60
cmake_minimum_required(VERSION 3.13)
project(Mawaqit Fortran)
set( PrayerTimes_MAJOR_VERSION 0 )
set( PrayerTimes_MINOR_VERSION 1 )
set( PrayerTimes_VERSION ${PrayerTimes_MAJOR_VERSION}.${PrayerTimes_MINOR_VERSION} )
set ( CMAKE_CONFIGURATION_TYPES "Debug" "Release" "CodeCoverage" "Fast" )
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" )
if(NOT CMAKE_BUILD_TYPE)
set( CMAKE_BUILD_TYPE "Release" )
message(STATUS "No CMAKE_BUILD_TYPE selected, default to ${CMAKE_BUILD_TYPE}")
endif()
option( OpenMP "Enable OpenMP" OFF )
if( OpenMP )
find_package( OpenMP REQUIRED )
endif()
if( "${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU" )
set( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Wall -Wimplicit-procedure -Wunused-parameter -std=f2018" )
set( CMAKE_Fortran_FLAGS_FAST "-Ofast -flto" )
set( CMAKE_Fortran_FLAGS_RELEASE "-O3 -flto" )
set( CMAKE_Fortran_FLAGS_DEBUG "-O0 -g -fcheck=all -ffpe-trap=zero,overflow,invalid -fbacktrace" )
set ( CMAKE_Fortran_FLAGS_CODECOVERAGE "--coverage -g -O0" )
elseif( "${CMAKE_Fortran_COMPILER_ID}" MATCHES "Intel" )
set( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -warn all -stand f18 -standard-semantics -assume nostd_mod_proc_name" )
set( CMAKE_Fortran_FLAGS_FAST "-Ofast -ipo" )
set( CMAKE_Fortran_FLAGS_RELEASE "-O3 -ipo" )
set( CMAKE_Fortran_FLAGS_DEBUG "-O0 -g -check all -fpe-all=0 -traceback" )
set ( CMAKE_Fortran_FLAGS_CODECOVERAGE "-prof-gen:srcpos -prof-dir=${CMAKE_BINARY_DIR}/prof/ -g -O0" )
elseif( "${CMAKE_Fortran_COMPILER_ID}" MATCHES "Flang" )
set( CMAKE_Fortran_FLAGS_FAST "${CMAKE_Fortran_FLAGS} -Ofast" )
set( CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS} -O3" )
set( CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS} -O0 -g -Wall" )
elseif( "${CMAKE_Fortran_COMPILER_ID}" MATCHES "PGI" )
set( CMAKE_Fortran_FLAGS_FAST "${CMAKE_Fortran_FLAGS} -Mallocatable=03 -fast" )
set( CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS} -Mallocatable=03 -O3" )
set( CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS} -Minform=inform -Mallocatable=03 -Mstandard -O0 -g -C" )
endif()
add_subdirectory(src)
file(COPY data.dat DESTINATION ./ )
option( LOCAL_DATA "Use Local DATA" OFF )
if( LOCAL_DATA )
file(COPY data DESTINATION ./ )
endif()