target_enable_mtl4.cmake 1.03 KB
Newer Older
1
macro(target_enable_mtl4 _TARGET_ _SCOPE_)
2
3
4
5
6
  if (${ARGC} GREATER 2)
    set(LINK_EXECUTABLE ON)
  else ()
    set(LINK_EXECUTABLE OFF)
  endif ()
7

8
9
10
11
12
13
  if (LINK_EXECUTABLE)
    target_include_directories(${_TARGET_} ${_SCOPE_} ${AMDIS_INCLUDE_DIR}/mtl4)
  else ()
    target_include_directories(${_TARGET_} ${_SCOPE_} ${BASE_DIR}/lib/mtl4)
  endif (LINK_EXECUTABLE)
  target_compile_definitions(${_TARGET_} ${_SCOPE_} MTL_ASSERT_FOR_THROW=1)
14

15
16
17
18
  set (CXX_ELEVEN_FEATURE_LIST "MOVE" "AUTO" "RANGEDFOR" "INITLIST" "STATICASSERT" "DEFAULTIMPL")
  foreach (feature ${CXX_ELEVEN_FEATURE_LIST})
    target_compile_definitions(${_TARGET_} ${_SCOPE_} MTL_WITH_${feature})
  endforeach ()
19

20
21
22
23
24
25
26
27
28
  if (ENABLE_OPENMP)
      find_package(OpenMP REQUIRED)
      if (OPENMP_FOUND)
        target_compile_definitions(${_TARGET_} ${_SCOPE_} MTL_WITH_OPENMP)
        target_compile_options(${_TARGET_} ${_SCOPE_} ${OpenMP_CXX_FLAGS})
      else ()
        message(FATAL_ERROR "OpenMP not found")
      endif (OPENMP_FOUND)
  endif (ENABLE_OPENMP)
29
endmacro(target_enable_mtl4)