Fix macOS OpenMP build error when using a build folder name with spaces.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Thu, 28 Feb 2019 23:25:53 +0000 (00:25 +0100)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Thu, 28 Feb 2019 23:26:42 +0000 (00:26 +0100)
Patch by Campbell.

build_files/cmake/platform/platform_apple.cmake

index 1b3b844..c9acaa2 100644 (file)
@@ -390,9 +390,9 @@ if(WITH_OPENMP)
                message(STATUS "Using ${LIBDIR}/openmp for OpenMP")
                set(OPENMP_CUSTOM ON)
                set(OPENMP_FOUND ON)
-               set(OpenMP_C_FLAGS "-Xclang -fopenmp -I${LIBDIR}/openmp/include")
-               set(OpenMP_CXX_FLAGS "-Xclang -fopenmp -I${LIBDIR}/openmp/include")
-               set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${LIBDIR}/openmp/lib -lomp")
+               set(OpenMP_C_FLAGS "-Xclang -fopenmp -I\"${LIBDIR}/openmp/include\"")
+               set(OpenMP_CXX_FLAGS "-Xclang -fopenmp -I\"${LIBDIR}/openmp/include\"")
+               set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L\"${LIBDIR}/openmp/lib\" -lomp")
 
                # Copy libomp.dylib to allow executables like datatoc to work.
                execute_process(