include(ExternalProject)

ExternalProject_Add(
  openmp
  GIT_REPOSITORY "https://github.com/llvm-mirror/openmp"
  GIT_TAG "b76842e"
  UPDATE_COMMAND ""
  PATCH_COMMAND ""
  SOURCE_DIR ${CMAKE_SOURCE_DIR}/openmp
  CMAKE_ARGS -DCMAKE_INSTALL_LIBDIR=lib
             -DBUILD_SHARED_LIBS=ON
             -DCMAKE_BUILD_TYPE=Release
             -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
             -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
             -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
             -DOPENMP_STANDALONE_BUILD=ON
             -DLIBOMP_ENABLE_SHARED=TRUE
             -DOPENMP_ENABLE_LIBOMPTARGET=OFF
  BUILD_COMMAND ${CMAKE_MAKE_PROGRAM}
  INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
  INSTALL_COMMAND ${CMAKE_MAKE_PROGRAM} install
  TEST_COMMAND "")
