CMakeLists.txt 2.45 KB
Newer Older
1 2 3 4 5
###
#
# @copyright (c) 2009-2014 The University of Tennessee and The University
#                          of Tennessee Research Foundation.
#                          All rights reserved.
PRUVOST Florent's avatar
@all  
PRUVOST Florent committed
6
# @copyright (c) 2012-2017 Inria. All rights reserved.
7
# @copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
8 9 10 11 12 13 14 15 16 17 18 19 20
#
###
#
#  @file CMakeLists.txt
#
#  @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.
#
21
#  @version 0.9.0
22 23 24
#  @author Cedric Castagnede
#  @author Emmanuel Agullo
#  @author Mathieu Faverge
PRUVOST Florent's avatar
@all  
PRUVOST Florent committed
25
#  @author Florent Pruvost
26 27 28 29 30 31 32
#  @date 13-07-2012
#
###


# Generate the morse headers for all possible precisions
# ------------------------------------------------------
33
set(CHAMELEON_HDRS_GENERATED "")
34 35 36 37 38 39 40
set(ZHDR
    morse_z.h
    morse_zc.h
    runtime_z.h
    runtime_zc.h
)

41
precisions_rules_py(CHAMELEON_HDRS_GENERATED "${ZHDR}"
42 43
                    PRECISIONS "z;c;d;s;zc;ds")

PRUVOST Florent's avatar
@all  
PRUVOST Florent committed
44 45
configure_file("chameleon_config.h.in"
               "chameleon_config.h"
46
               @ONLY)
47 48 49 50
configure_file("morse.h.in"
               "morse.h"
               @ONLY)

51 52
# Define the list of headers
# --------------------------
53
set(CHAMELEON_HDRS
PRUVOST Florent's avatar
@all  
PRUVOST Florent committed
54
    chameleon_config.h
55 56 57 58 59 60
    morse_constants.h
    morse_kernels.h
    morse_simulate.h
    morse_struct.h
    morse_types.h
    morse.h
61
    morse_mangling.h
62
    runtime.h
63
    ${CHAMELEON_HDRS_GENERATED}
64
    )
PRUVOST Florent's avatar
PRUVOST Florent committed
65

66
set(flags_to_add "")
67
foreach(_prec ${CHAMELEON_PRECISION})
68
    set(flags_to_add "${flags_to_add} -DPRECISION_${_prec}")
69
endforeach()
70
set_source_files_properties(runtime.h PROPERTIES COMPILE_FLAGS "${flags_to_add}")
71 72 73

# Force generation of headers
# ---------------------------
74
add_custom_target(chameleon_include ALL SOURCES ${CHAMELEON_HDRS})
75 76 77

set(HDR_INSTALL
    morse_constants.h
PRUVOST Florent's avatar
PRUVOST Florent committed
78
    morse_fortran.h
79 80 81 82 83 84
    morse_kernels.h
    morse_simulate.h
    morse_struct.h
    morse_types.h
    runtime.h
    )
85
foreach( hdr_file ${CHAMELEON_HDRS_GENERATED} )
86 87
    list(APPEND HDR_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/${hdr_file})
endforeach()
88 89 90 91 92
list(APPEND
     HDR_INSTALL
     ${CMAKE_CURRENT_BINARY_DIR}/morse.h
     ${CMAKE_CURRENT_BINARY_DIR}/morse_mangling.h
     ${CMAKE_CURRENT_BINARY_DIR}/chameleon_config.h)
93 94 95 96

# installation
# ------------
install(FILES ${HDR_INSTALL}
97
        DESTINATION include/chameleon)
98 99 100 101

###
### END CMakeLists.txt
###