target_enable_mtl4.cmake 939 Bytes
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
  if (ENABLE_OPENMP)
21 22 23
    find_package(OpenMP REQUIRED)
    target_compile_definitions(${_TARGET_} ${_SCOPE_} MTL_WITH_OPENMP HAVE_OPENMP)
    target_compile_options(${_TARGET_} ${_SCOPE_} ${OpenMP_CXX_FLAGS})
24
  endif (ENABLE_OPENMP)
25
endmacro(target_enable_mtl4)