find_mtl4.cmake 1.47 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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)

if (ENABLE_CXX11)
    target_compile_features(mtl4 INTERFACE
        cxx_rvalue_references
        cxx_auto_type 
        cxx_range_for 
        cxx_generalized_initializers
        cxx_static_assert
        cxx_defaulted_functions)
17
    
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
    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 ()
endif (ENABLE_CXX11)


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