OpenMP

    1. # For CMake < 3.9, we need to make the target ourselves
    2. if(NOT TARGET OpenMP::OpenMP_CXX)
    3. find_package(Threads REQUIRED)
    4. set_property(TARGET OpenMP::OpenMP_CXX
    5. PROPERTY INTERFACE_COMPILE_OPTIONS ${OpenMP_CXX_FLAGS})
    6. # Only works if the same flag is passed to the linker; use CMake 3.9+ otherwise (Intel, AppleClang)
    7. PROPERTY INTERFACE_LINK_LIBRARIES ${OpenMP_CXX_FLAGS} Threads::Threads)
    8. endif()