forked from andreww/fox
-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
107 lines (81 loc) · 2.85 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
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
104
105
106
PROJECT(fox Fortran)
SET(CMAKE_VERBOSE_MAKEFILE FALSE)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
#======================#
# set another compiler #
#======================#
# to set another compiler than the default,
# do the usual from within the build directory:
# $ FC=g95
# $ rm -rf * && cmake ../
# $ make
#=====================#
# verbose make output #
#=====================#
# to see out all commands used during building,
# do as follows:
# $ rm -rf * && cmake ../
# $ make VERBOSE=1
#======================#
# speed up compilation #
#======================#
# to speed up compilation by using multiple cores/processors,
# do the following:
# $ rm -rf * && cmake ../
# $ make -j
#==============================#
# get the machine architecture #
#==============================#
SET(OS ${CMAKE_SYSTEM})
SET(MACHINE_ARCH ${CMAKE_SYSTEM_PROCESSOR})
MESSAGE(STATUS "determining operating system and architecture:")
MESSAGE(" -> your operating system is : ${OS}")
MESSAGE(" -> your architecture is : ${MACHINE_ARCH}")
#==========================#
# check if m4 is available #
#==========================#
MESSAGE(STATUS "Searching for m4 scripting language")
FIND_PROGRAM(M4_PROGRAM m4)
IF(${M4_PROGRAM} MATCHES "NOTFOUND")
MESSAGE(" -> WARNING : could not find m4, cannot generate fortran files from m4 sources")
ELSE(${M4_PROGRAM} MATCHES "NOTFOUND")
MESSAGE(" -> ${M4_PROGRAM}")
ENDIF(${M4_PROGRAM} MATCHES "NOTFOUND")
#============================#
# set some other definitions #
#============================#
# file name extensions
SET(m4_ext .m4)
SET(f90pp_ext .F90)
SET(f90_ext .f90)
###===================================###
###===================================###
### determine some preprocessor flags ###
###===================================###
###===================================###
#===========================================================#
# determine end-of-line character based on operating system #
#===========================================================#
INCLUDE(./cmake/DetermineEOL.cmake)
#============================================#
# determine if and how FLUSH intrinsic works #
#============================================#
INCLUDE(./cmake/CheckFlushIntrinsic.cmake)
#=====================================================#
# check for 'associated in restricted expression' bug #
#=====================================================#
INCLUDE(./cmake/CheckAssociatedBug.cmake)
#============================================#
# determine if and how ABORT intrinsic works #
#============================================#
INCLUDE(./cmake/CheckAbortIntrinsic.cmake)
SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${FPPFLAGS}")
ADD_SUBDIRECTORY(fsys)
ADD_SUBDIRECTORY(utils)
ADD_SUBDIRECTORY(common)
ADD_SUBDIRECTORY(wxml)
ADD_SUBDIRECTORY(wcml)
ADD_SUBDIRECTORY(wkml)
ADD_SUBDIRECTORY(sax)
ADD_SUBDIRECTORY(dom)
ADD_SUBDIRECTORY(examples)