find_mtl4.cmake 1.45 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
10
11
12
13
14
15
16
17
18
include(test_compile_features)
test_compile_features(MTL_ENABLE_CXX11 mtl4 INTERFACE
    cxx_rvalue_references
    cxx_auto_type
    cxx_range_for
    cxx_generalized_initializers
    cxx_static_assert
    cxx_defaulted_functions)

if (MTL_ENABLE_CXX11)
19
20
21
22
    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 ()
23
endif (MTL_ENABLE_CXX11)
24
25
26
27
28
29
30
31
32
33
34
35
36
37


if (ENABLE_OPENMP)
	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)
endif (ENABLE_OPENMP)


if (NOT IS_AMDISCONFIG)
38
39
    # specify how to install this target:
    # -----------------------------------
40
41
42
43
44
45
46
47
48
49
    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)