OSX/CMAKE: make linking and bundling of clang omp lib work,

Cmake will still not find -fopenmp working, so the user must set
WITH_OPENMP and flags manually
This commit is contained in:
Jens Verwiebe
2014-02-18 23:38:48 +01:00
parent ace071f99e
commit ad4c12fe01
2 changed files with 14 additions and 1 deletions

View File

@@ -1854,6 +1854,12 @@ elseif(APPLE)
message(STATUS "OSL not found")
endif()
endif()
if(WITH_OPENMP AND CMAKE_C_COMPILER_ID MATCHES "Clang" AND NOT ${CMAKE_C_COMPILER_VERSION} VERSION_LESS '3.4')
include_directories(${LIBDIR}/openmp/include)
LINK_DIRECTORIES(${LIBDIR}/openmp/lib)
execute_process(COMMAND cp ${LIBDIR}/openmp/lib/libiomp5.dylib ${CMAKE_BINARY_DIR}/bin/libiomp5.dylib) # needed for imtermediate binaries, due lib id is @loader_path
endif()
set(EXETYPE MACOSX_BUNDLE)