Commit 4994976a authored by PRUVOST Florent's avatar PRUVOST Florent

synchro chameleon with Xavier's work on modules

parent b0f37ee5
#-------------------------------------------------------------------
macro( array2d_get_item out_value offset )
math( EXPR _finalindex "${_array2d_index}+${offset}" )
list( GET _array2d_array ${_finalindex} _item )
set( ${out_value} "${_item}" )
endmacro()
#-------------------------------------------------------------------
macro( array2d_begin_loop out_advanced array width var_names )
set( _array2d_out_advanced ${out_advanced} )
set( _array2d_index 0 )
set( _array2d_array ${array} )
set( _array2d_width ${width} )
set( _array2d_var_names ${var_names} )
array2d_advance()
endmacro()
#-------------------------------------------------------------------
macro( array2d_advance )
if( NOT _array2d_array )
set( ${_array2d_out_advanced} false )
else()
list( LENGTH _array2d_array _size )
math( EXPR _remaining "${_size}-${_array2d_index}" )
if( (_array2d_width LESS 1) OR (_size LESS _array2d_width) OR (_remaining LESS _array2d_width) )
set( ${_array2d_out_advanced} false )
else()
math( EXPR _adjusted_width "${_array2d_width}-1" )
foreach( offset RANGE ${_adjusted_width} )
list( GET _array2d_var_names ${offset} _var_name )
array2d_get_item( ${_var_name} ${offset} )
endforeach()
math( EXPR _index "${_array2d_index}+${_array2d_width}" )
set( _array2d_index ${_index} )
set( ${_array2d_out_advanced} true )
endif()
endif()
endmacro()
#-------------------------------------------------------------------
\ No newline at end of file
###
#
# @copyright (c) 2009-2014 The University of Tennessee and The University
# of Tennessee Research Foundation.
# All rights reserved.
# @copyright (c) 2012-2014 Inria. All rights reserved.
# @copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
#
###
#
# @file AuxilaryFlags.cmake
#
# @project MORSE
# MORSE is a software package provided by:
# Inria Bordeaux - Sud-Ouest,
# Univ. of Tennessee,
# King Abdullah Univesity of Science and Technology
# Univ. of California Berkeley,
# Univ. of Colorado Denver.
#
# @version 0.9.0
# @author Xavier Lacoste
# @date 30-01-2015
#
# Define auxilary variables:
# - CMAKE_Fortran_PREPROCESS_FLAGS : force C preprocessor.
# - CMAKE_Fortran_FREEFORM_FLAG : Force free format.
###
IF(CMAKE_Fortran_COMPILER_ID MATCHES GNU)
list(APPEND CMAKE_Fortran_FLAGS "-cpp -ffree-form")
ELSEIF(CMAKE_Fortran_COMPILER_ID MATCHES Intel)
list(APPEND CMAKE_Fortran_PREPROCESS_FLAG "-fpp")
ENDIF()
......@@ -40,6 +40,9 @@ include(FindHeadersAndLibs)
# PrintFindStatus.cmake is in cmake_modules/morse/find directory
include(PrintFindStatus)
# Define some auxilary flags
include(AuxilaryFlags)
# Add the path where we handle our FindFOO.cmake to seek for liraries
list(APPEND CMAKE_MODULE_PATH ${MORSE_CMAKE_MODULE_PATH}/find)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment