-
Notifications
You must be signed in to change notification settings - Fork 11
/
CMakeLists.txt
466 lines (363 loc) · 17 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
# CMAKE File for CISM building against an installed Trilinos
cmake_minimum_required(VERSION 2.8.4)
OPTION (CISM_BUILD_CISM_DRIVER "Toggle to build cism_driver, on by default" ON)
OPTION (CISM_USE_TRILINOS "Toggle to use Trilinos: defaults to OFF" OFF)
OPTION (CISM_MPI_MODE "Toggle to Configure with MPI: defaults to ON" ON)
OPTION (CISM_SERIAL_MODE "Toggle to Configure in Serial mode: defaults to OFF " OFF)
OPTION (CISM_USE_MPI_WITH_SLAP "Toggle to use mpi when using SLAP solver, only relevant if CISM_SERIAL_MODE=ON: defaults to OFF" OFF)
OPTION (CISM_BUILD_SIMPLE_GLIDE "Toggle to build simple_glide, OFF by default" OFF)
OPTION (CISM_ENABLE_BISICLES "Toggle to build a BISICLES-capable cism_driver, off by default" OFF)
OPTION (CISM_BUILD_EXTRA_EXECUTABLES "Toggle to other executables, off by default" OFF)
OPTION (CISM_USE_GPTL_INSTRUMENTATION "Toggle to use GPTL instrumentation, on by default " ON)
OPTION (CISM_COUPLED "Toggle to build CISM for use with CESM, off by default" OFF)
# OPTION (CISM_USE_CISM_FRONT_END "Toggle to use cism_driver or cism_cesm_interface with cism_front_end, off by default" OFF)
OPTION (CISM_STATIC_LINKING "Toggle to set static linking for executables, off by default" OFF)
OPTION (CISM_FORCE_FORTRAN_LINKER "Toggle to force using a fortran linker for building executables, off by default" OFF)
OPTION (CISM_INCLUDE_IMPLICIT_LINK_LIBRARIES "Toggle to explicitly include the CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES on the link line, on by default" ON)
MESSAGE("CISM_USE_TRILINOS = ${CISM_USE_TRILINOS}")
# override CISM_SERIAL_MODE setting, if it conflicts with CISM_MPI_MODE setting:
IF (CISM_MPI_MODE)
SET(CISM_SERIAL_MODE "OFF")
SET(CISM_BUILD_EXTRA_EXECUTABLES "OFF")
ENDIF()
IF (NOT CISM_MPI_MODE AND NOT CISM_SERIAL_MODE)
SET(CISM_MPI_MODE "ON")
ENDIF()
IF (CISM_BUILD_CISM_DRIVER)
SET(CISM_USE_CISM_FRONT_END "ON")
ENDIF()
# set (or override) other options, if CISM_COUPLED is ON:
IF (CISM_COUPLED)
SET(CISM_NO_EXECUTABLE "ON")
SET(CISM_BUILD_SIMPLE_GLIDE "OFF")
SET(CISM_ENABLE_BISICLES "OFF")
SET(CISM_USE_CISM_FRONT_END "OFF")
ADD_DEFINITIONS(-DCCSMCOUPLED)
ENDIF()
IF (NOT DEFINED CISM_BINARY_DIR)
SET(CISM_BINARY_DIR ${CMAKE_BINARY_DIR})
ENDIF()
MESSAGE("Building in: ${CISM_BINARY_DIR}")
IF (CISM_USE_TRILINOS)
OPTION(CISM_TRILINOS_DIR "Required path to installed Trilinos")
OPTION(CISM_NETCDF_DIR "Required path to installed Netcdf")
IF (CISM_USE_GPTL_INSTRUMENTATION)
IF (DEFINED CISM_TRILINOS_GPTL_DIR)
SET(CISM_TRILINOS_DIR ${CISM_TRILINOS_GPTL_DIR})
ENDIF()
ENDIF()
# Error check up front
IF (NOT DEFINED CISM_TRILINOS_DIR)
MESSAGE(FATAL_ERROR "\nCISM Error: cmake must define CISM_TRILINOS_DIR:
(-D CISM_TRILINOS_DIR=<trilinos_install_prefix>)!")
ENDIF()
# Get Trilinos as one entity
SET(CMAKE_PREFIX_PATH ${CISM_TRILINOS_DIR} ${CMAKE_PREFIX_PATH})
FIND_PACKAGE(Trilinos REQUIRED)
IF (${Trilinos_VERSION} VERSION_LESS 10.8.0)
MESSAGE(FATAL_ERROR "Trilinos version 10.8 or newer required!")
ENDIF()
MESSAGE("\nFound Trilinos! Here are the details: ")
MESSAGE(" Trilinos_DIR = ${Trilinos_DIR}")
MESSAGE(" Trilinos_VERSION = ${Trilinos_VERSION}")
MESSAGE(" Trilinos_PACKAGE_LIST = ${Trilinos_PACKAGE_LIST}")
MESSAGE(" Trilinos_LIBRARIES = ${Trilinos_LIBRARIES}")
MESSAGE(" Trilinos_INCLUDE_DIRS = ${Trilinos_INCLUDE_DIRS}")
MESSAGE(" Trilinos_LIBRARY_DIRS = ${Trilinos_LIBRARY_DIRS}")
MESSAGE(" Trilinos_TPL_LIST = ${Trilinos_TPL_LIST}")
MESSAGE(" Trilinos_TPL_INCLUDE_DIRS = ${Trilinos_TPL_INCLUDE_DIRS}")
MESSAGE(" Trilinos_TPL_LIBRARIES = ${Trilinos_TPL_LIBRARIES}")
MESSAGE(" Trilinos_TPL_LIBRARY_DIRS = ${Trilinos_TPL_LIBRARY_DIRS}")
MESSAGE(" Trilinos_BUILD_SHARED_LIBS = ${Trilinos_BUILD_SHARED_LIBS}")
MESSAGE(" Trilinos_CXX_COMPILER_FLAGS = ${Trilinos_CXX_COMPILER_FLAGS}")
MESSAGE(" Trilinos_Fortran_COMPILER_FLAGS = ${Trilinos_Fortran_COMPILER_FLAGS}")
MESSAGE("End of Trilinos details\n")
# Get libraries for link line from Trilinos build information
set(CISM_TRILINOS_LIBS ${Trilinos_LIBRARIES} ${Trilinos_TPL_LIBRARIES} ${Trilinos_EXTRA_LD_FLAGS})
IF (NOT DEFINED CMAKE_CXX_COMPILER AND NOT DEFINED ENV{CXX})
SET(CMAKE_CXX_COMPILER ${Trilinos_CXX_COMPILER})
ENDIF()
IF (NOT DEFINED CMAKE_C_COMPILER AND NOT DEFINED ENV{CC})
SET(CMAKE_C_COMPILER ${Trilinos_C_COMPILER})
ENDIF()
IF (NOT DEFINED CMAKE_Fortran_COMPILER AND NOT DEFINED ENV{FC})
SET(CMAKE_Fortran_COMPILER ${Trilinos_Fortran_COMPILER})
ENDIF()
ENDIF()
ENABLE_LANGUAGE(Fortran)
IF (CISM_INCLUDE_IMPLICIT_LINK_LIBRARIES)
# WJS (6-3-14) Until now, these Fortran_IMPLICIT_LINK_LIBRARIES were always
# included. However, explicitly appending these implicit link libraries breaks
# the build on yellowstone, for some reason. It could be because the trilinos
# build is old. I suspect these implicit link libraries are needed when you're
# linking with a C++ linker, which is not the case for yellowstone-intel. In
# any case, I'm providing an option to exclude these from the build, to allow
# the yellowstone-intel build to work.
#
# Also, note that, although these are added to the variable CISM_TRILINOS_LIBS,
# this variable is used even when building without trilinos. I am merely
# maintaining the old behavior in this respect.
LIST(APPEND CISM_TRILINOS_LIBS ${CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES})
#message("")
#message(" CMake detected the following libraries for linking Fortran with C++ compiler:")
#message(" ${CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES} ")
ENDIF()
# Only include C++ support if it's really needed, to avoid problems
# caused by broken C++ compilers.
#IK, 8/3/13: added simple_felix option
IF (CISM_USE_TRILINOS OR CISM_ENABLE_BISICLES)
ENABLE_LANGUAGE(CXX)
ENDIF()
MESSAGE(">> CISM_NETCDF_DIR set to : ${CISM_NETCDF_DIR}")
IF (NOT DEFINED CISM_NETCDF_DIR)
MESSAGE(FATAL_ERROR "\nCISM Error: cmake must define CISM_NETCDF_DIR:
(-D CISM_NETCDF_DIR=<netcdf_install_prefix>)!")
ENDIF()
FIND_PATH(CISM_NETCDFF_FOUND libnetcdff.a ${CISM_NETCDF_DIR}/lib)
#MESSAGE(" CISM_NETCDFF_FOUND = ${CISM_NETCDFF_FOUND}")
IF (${CISM_NETCDFF_FOUND} STREQUAL ${CISM_NETCDF_DIR}/lib )
SET(CISM_NETCDF_LIBS "netcdff;netcdf" CACHE STRING "Netcdf Library Names(s)")
ELSE()
SET(CISM_NETCDF_LIBS "netcdf" CACHE STRING "Netcdf Library Names(s)")
ENDIF()
MESSAGE(">> CISM_NETCDF_LIBS Library(s) set to : ${CISM_NETCDF_LIBS}")
IF (DEFINED CISM_MPI_BASE_DIR)
IF (NOT DEFINED CISM_MPI_LIB_DIR)
SET(CISM_MPI_LIB_DIR ${CISM_MPI_BASE_DIR}/lib)
ENDIF()
IF (NOT DEFINED CISM_MPI_INC_DIR)
SET(CISM_MPI_INC_DIR ${CISM_MPI_BASE_DIR}/include)
ENDIF()
ENDIF()
MESSAGE(">> CISM_MPI_LIB_DIR set to : ${CISM_MPI_LIB_DIR}")
MESSAGE(">> CISM_MPI_INC_DIR set to : ${CISM_MPI_INC_DIR}")
IF (NOT DEFINED CMAKE_Fortran_MODULE_DIRECTORY)
SET(CMAKE_Fortran_MODULE_DIRECTORY ${CISM_BINARY_DIR}/fortran_mod_files)
ENDIF()
INCLUDE_DIRECTORIES(${CMAKE_Fortran_MODULE_DIRECTORY})
# Note that C++ is excluded here -- we only include C++ support if
# it's really needed (see ENABLE_LANGUAGE(CXX) command above)
PROJECT(CISM Fortran C)
# Copy a few needed files to the build directory:
MESSAGE(">> Calling utils/build/autocopy-to-build-dir")
EXECUTE_PROCESS(COMMAND ${CISM_SOURCE_DIR}/utils/build/autocopy-to-build-dir
${CISM_SOURCE_DIR}
WORKING_DIRECTORY ${CISM_BINARY_DIR}
OUTPUT_FILE ${CISM_BINARY_DIR}/autocopy.log)
MESSAGE(">> see ${CISM_BINARY_DIR}/autocopy.log")
INCLUDE_DIRECTORIES(${CISM_BINARY_DIR}/fortran_autocopy_includes)
# End of setup and error checking
# NOTE: PROJECT command checks for compilers, so this statement
# is moved AFTER setting CMAKE_CXX_COMPILER from Trilinos
## Use CMAKE_CXX_FLAGS CMAKE_Fortran_FLAGS to override Trilinos flags
## USe CISM_CXX_FLAGS CISM_Fortran_FLAGS to append to Trilinos flags
IF (NOT CMAKE_CXX_FLAGS)
SET(CMAKE_CXX_FLAGS ${Trilinos_CXX_COMPILER_FLAGS} )
ENDIF()
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CISM_CXX_FLAGS}")
IF (NOT CMAKE_Fortran_FLAGS)
SET(CMAKE_Fortran_FLAGS ${Trilinos_Fortran_COMPILER_FLAGS} )
ENDIF()
SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${CISM_Fortran_FLAGS}")
IF (CISM_USE_TRILINOS)
## CISM requires Trilinos to include the Piro build
MESSAGE("-- Looking for Piro within Trilinos:")
MESSAGE("Trilinos pkg list: " ${Trilinos_PACKAGE_LIST})
LIST(FIND Trilinos_PACKAGE_LIST Piro Piro_List_ID)
IF (Piro_List_ID GREATER -1)
MESSAGE("-- Looking for Piro: -- found! Continuing.")
ELSE()
MESSAGE(FATAL_ERROR "-- Looking for Piro: -- not found! Rebuild Trilinos with Piro package.")
ENDIF()
ADD_DEFINITIONS(-DCISM_MPI -DTRILINOS)
ADD_DEFINITIONS(-DGLIMMER_MPI)
MESSAGE(">> Trilinos build: adding -DTRILINOS to compile lines")
include_directories(${CISM_NETCDF_DIR}/include)
link_directories(${CISM_NETCDF_DIR}/lib)
ELSE()
IF (${CISM_MPI_MODE})
ADD_DEFINITIONS(-DCISM_MPI)
ADD_DEFINITIONS(-DGLIMMER_MPI)
ENDIF()
include_directories(${CISM_NETCDF_DIR}/include ${CISM_MPI_INC_DIR})
link_directories(${CISM_NETCDF_DIR}/lib ${CISM_MPI_LIB_DIR} ${CISM_SCI_LIB_DIR}
${CISM_HDF5_LIB_DIR} )
ENDIF()
IF (CISM_ENABLE_BISICLES)
MESSAGE("\nBISICLES build configured.\n")
SET(CISM_DYCORE_DIR ${CISM_SOURCE_DIR}/libdycore)
SET(CISM_TO_DYCORE ${CISM_DYCORE_DIR}/glimmer_to_dycore.F90)
SET(CISM_BISICLES_DIR ${CISM_DYCORE_DIR}/BISICLES)
INCLUDE_DIRECTORIES(${CISM_DYCORE_DIR})
LINK_DIRECTORIES(${CISM_DYCORE_DIR} ${BISICLES_INTERFACE_DIR} )
ADD_DEFINITIONS(-DCISM_HAS_BISICLES)
ENDIF()
IF ( CISM_USE_GPTL_INSTRUMENTATION AND
(NOT CISM_SERIAL_MODE))
OPTION(CISM_GPTL_DIR "Optional path to installed gptl library")
IF (CISM_GPTL_DIR)
message(">> GPTL Library reqested, installed in ${CISM_GPTL_DIR}")
ADD_DEFINITIONS(-DCESMTIMERS)
include_directories(${CISM_GPTL_DIR})
link_directories(${CISM_GPTL_DIR})
SET(CISM_GPTL_LIB gptl)
ELSE()
message(">>GPTL Library not requested: can set CISM_GPTL_DIR to enable")
ENDIF()
ENDIF()
#####Build All Fortran Sources #####
#IF (CISM_USE_CISM_FRONT_END)
file(GLOB GLINT_SOURCES libglint/*.F90)
file(GLOB GLAD_SOURCES libglad/*.F90)
file(GLOB GLISSADE_SOURCES libglissade/*.F90)
#ENDIF()
file(GLOB FORTRANSOURCES
libglimmer-solve/SLAP/*.f
libglimmer-solve/*.F90
libglimmer/*.F90 libglimmer/writestats.c
libglide/*.F90
cism_driver/eismint_forcing.F90
cism_driver/testsfg.F90
${GLINT_SOURCES}
${GLAD_SOURCES}
${GLISSADE_SOURCES}
${CISM_TO_DYCORE})
set (FORTRAN_AUTOGEN_SOURCES ${CISM_BINARY_DIR}/fortran_autogen_srcs/glide_io.F90
${CISM_BINARY_DIR}/fortran_autogen_srcs/glint_io.F90
${CISM_BINARY_DIR}/fortran_autogen_srcs/glint_mbal_io.F90
${CISM_BINARY_DIR}/fortran_autogen_srcs/glad_io.F90
${CISM_BINARY_DIR}/fortran_autogen_srcs/glad_mbal_io.F90
${CISM_BINARY_DIR}/fortran_autogen_srcs/glimmer_vers.F90)
message("Autogenerated CISM sources: ${FORTRAN_AUTOGEN_SOURCES}")
LIST(REMOVE_ITEM FORTRANSOURCES
${CISM_SOURCE_DIR}/libglimmer-solve/SLAP/dlapqc.f )
IF (CISM_USE_TRILINOS OR CISM_MPI_MODE)
LIST(REMOVE_ITEM FORTRANSOURCES
${CISM_SOURCE_DIR}/libglimmer/parallel_slap.F90)
ELSE(${CISM_SERIAL_MODE})
LIST(REMOVE_ITEM FORTRANSOURCES
${CISM_SOURCE_DIR}/libglimmer/parallel_mpi.F90)
IF (CISM_USE_MPI_WITH_SLAP)
ADD_DEFINITIONS(-D_USE_MPI_WITH_SLAP)
ELSE()
LIST(REMOVE_ITEM FORTRANSOURCES
${CISM_SOURCE_DIR}/libglimmer/mpi_mod.F90)
ENDIF()
ENDIF()
# Auto-generate the *_io.F90 files in the build directory:
MESSAGE(">> Calling utils/build/autogenerate-in-build-dir")
ADD_CUSTOM_COMMAND(
OUTPUT fortran_autogen_srcs/glide_io.F90
COMMAND ${CISM_SOURCE_DIR}/utils/build/autogenerate-in-build-dir
${CISM_SOURCE_DIR}
DEPENDS ${CISM_SOURCE_DIR}/libglide/glide_vars.def
${CISM_SOURCE_DIR}/libglimmer/ncdf_template.F90.in
${CISM_SOURCE_DIR}/utils/build/generate_ncvars.py
${CISM_SOURCE_DIR}/utils/build/autogenerate-in-build-dir
)
# Auto-generate the *_io.F90 files in the build directory:
MESSAGE(">> Calling utils/build/autogen-for-glint-and-glad-in-build-dir")
ADD_CUSTOM_COMMAND(
OUTPUT fortran_autogen_srcs/glint_io.F90
fortran_autogen_srcs/glint_mbal_io.F90
fortran_autogen_srcs/glad_io.F90
fortran_autogen_srcs/glad_mbal_io.F90
COMMAND ${CISM_SOURCE_DIR}/utils/build/autogen-for-glint-and-glad-in-build-dir
${CISM_SOURCE_DIR}
DEPENDS ${CISM_SOURCE_DIR}/libglint/glint_vars.def
${CISM_SOURCE_DIR}/libglint/glint_mbal_vars.def
${CISM_SOURCE_DIR}/libglad/glad_vars.def
${CISM_SOURCE_DIR}/libglad/glad_mbal_vars.def
${CISM_SOURCE_DIR}/libglimmer/ncdf_template.F90.in
${CISM_SOURCE_DIR}/utils/build/generate_ncvars.py
${CISM_SOURCE_DIR}/utils/build/autogen-for-glint-and-glad-in-build-dir
)
# Get autogenerated source files, and add them to the FORTRANSOURCES list:
# changed to always do this:
#IF (CISM_COUPLED)
# Remove old versions of autogenerated F90 files that may be sitting
# around in the source tree from an old cmake-based build or an
# autotools-based build. (Now the cmake-based build doesn't place
# these in the source tree.)
# Unlike SOURCEMODFILES, we just hard-code the files to remove for
# simplicity.
# This can be removed once we switch to consistently using this new
# cmake-based build.
LIST(REMOVE_ITEM FORTRANSOURCES
${CISM_SOURCE_DIR}/libglide/glide_io.F90
${CISM_SOURCE_DIR}/libglide/glide_lithot_io.F90
${CISM_SOURCE_DIR}/libglint/glint_io.F90
${CISM_SOURCE_DIR}/libglint/glint_mbal_io.F90
${CISM_SOURCE_DIR}/libglimmer/glimmer_vers.F90 )
#ENDIF()
### (For CESM) Remove source files with names already in CISM_SOURCEMOD_DIR
OPTION(CISM_SOURCEMOD_DIR
"Path to SourceMod directory of F90 files to replace Glimmer files")
#MESSAGE("Fortran Source Files: ${FORTRANSOURCES}")
# Note that the following glob does NOT contain .cpp files, because
# those are built in a separate library - so for now, you can't put
# .cpp files in your sourceMod directory.
FILE(GLOB SOURCEMODFILES
${CISM_SOURCEMOD_DIR}/*.F90
${CISM_SOURCEMOD_DIR}/*.F
${CISM_SOURCEMOD_DIR}/*.f90
${CISM_SOURCEMOD_DIR}/*.f
${CISM_SOURCEMOD_DIR}/*.c)
# MESSAGE("glimmer_sourcemod_dir: " ${CISM_SOURCEMOD_DIR})
# MESSAGE("Fortran Mod Files: ${SOURCEMODFILES}")
FOREACH( MODFILE ${SOURCEMODFILES})
STRING(FIND ${MODFILE} / index REVERSE)
MATH(EXPR index ${index}+1)
STRING(SUBSTRING ${MODFILE} ${index} -1 filename)
FOREACH( SOURCEFILE ${FORTRANSOURCES})
STRING(REGEX MATCH ${filename} match_found ${SOURCEFILE})
IF(match_found)
MESSAGE("--SourceMod: removing ${SOURCEFILE} in favor of ${MODFILE}")
LIST(REMOVE_ITEM FORTRANSOURCES ${SOURCEFILE})
ENDIF()
ENDFOREACH()
ENDFOREACH()
###
#IF (CISM_COUPLED)
# enable removal of the autogenerated source files, when 'make clean' is done:
# commented out for now, since it may create more problems than it solves when building
# SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${FORTRAN_AUTOGEN_SOURCES}")
#ENDIF()
SET(CMAKE_INCLUDE_PATH ${CISM_BINARY_DIR}/include)
#message("Fortransource ${FORTRANSOURCES}")
# include-dirs: Binary: all the .mod files; SOURCE: config.inc;
# libglide: glide_mask.inc
include_directories (${CISM_BINARY_DIR} ${CISM_SOURCE_DIR}
${CISM_SOURCE_DIR}/libglide)
SET(LIBRARY_OUTPUT_PATH ${CISM_BINARY_DIR}/lib)
### Determine which fortran source files are fixed-form,
### which may require special compilation flags
FOREACH (SOURCEFILE ${FORTRANSOURCES} ${SOURCEMODFILES})
STRING(REGEX MATCH "\\.[fF]$" match_found ${SOURCEFILE})
IF(match_found)
LIST(APPEND FIXEDSOURCES ${SOURCEFILE})
ENDIF()
ENDFOREACH()
SET_SOURCE_FILES_PROPERTIES(${FIXEDSOURCES} PROPERTIES Fortran_FORMAT FIXED)
add_library(glimmercismfortran ${FORTRANSOURCES} ${FORTRAN_AUTOGEN_SOURCES} ${SOURCEMODFILES})
#####Build C++ Sources #####
IF (CISM_USE_TRILINOS)
add_subdirectory(libglimmer-trilinos)
ENDIF()
#####Build simple_glide executable (unless turned off) #####
OPTION(CISM_NO_EXECUTABLE "Set to ON to just build libraries (default:OFF)" OFF)
#IF (CISM_BUILD_SIMPLE_GLIDE AND (NOT CISM_NO_EXECUTABLE))
# add_subdirectory(example-drivers/simple_glide/src)
#ENDIF()
IF (CISM_USE_CISM_FRONT_END)
add_subdirectory(cism_driver)
ENDIF()
IF (CISM_ENABLE_BISICLES)
add_subdirectory(libdycore)
include_directories (${CISM_DYCORE_DIR}
${CISM_BISICLES_DIR})
message("glimmer src dir: ${CISM_SOURCE_DIR}")
message("glimmer dycore dir: ${CISM_DYCORE_DIR}")
get_property(inc_dirs DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
message("inc_dirs = ${inc_dirs}")
ENDIF()