find_mtl4.cmake 1.32 KB
Newer Older
1
2
3
4
5
6
7
8
add_library(mtl4 INTERFACE)

if (IS_AMDISCONFIG)
    target_include_directories(mtl4 INTERFACE ${AMDIS_INCLUDE_DIR}/mtl4)
else ()
    target_include_directories(mtl4 INTERFACE ${BASE_DIR}/lib/mtl4)
endif (IS_AMDISCONFIG)

9
include(test_compile_features)
10
target_enable_cxx11(MTL_ENABLE_CXX11 mtl4 INTERFACE)
11
12

if (MTL_ENABLE_CXX11)
13
14
15
16
    set (CXX_ELEVEN_FEATURE_LIST "MOVE" "AUTO" "RANGEDFOR" "INITLIST" "STATICASSERT" "DEFAULTIMPL")
    foreach (feature ${CXX_ELEVEN_FEATURE_LIST})
        target_compile_definitions(mtl4 INTERFACE MTL_WITH_${feature})
    endforeach ()
17
endif (MTL_ENABLE_CXX11)
18
19
20


if (ENABLE_OPENMP)
Praetorius, Simon's avatar
Praetorius, Simon committed
21
22
23
24
25
26
27
    find_package(OpenMP REQUIRED)
    if (OPENMP_FOUND)
    target_compile_definitions(mtl4 INTERFACE MTL_WITH_OPENMP)
    target_compile_options(mtl4 INTERFACE ${OpenMP_CXX_FLAGS})
    else ()
            message(FATAL_ERROR "OpenMP not found")
    endif (OPENMP_FOUND)
28
29
30
31
endif (ENABLE_OPENMP)


if (NOT IS_AMDISCONFIG)
32
33
    # specify how to install this target:
    # -----------------------------------
34
35
36
37
38
39
40
41
42
43
    install(DIRECTORY ${BASE_DIR}/lib/mtl4/
        DESTINATION include/amdis/mtl4/
        FILES_MATCHING PATTERN "*.hpp"
        PATTERN ".svn" EXCLUDE
        PATTERN ".svn/*" EXCLUDE
        PATTERN "mtl4/libs" EXCLUDE
        PATTERN "mtl4/extern" EXCLUDE)
endif (NOT IS_AMDISCONFIG)

target_link_libraries(amdis_base INTERFACE mtl4)