Regression: OpenMP_FOUND broken in 3.9
On macOS with brew install llvm and llvm environment set up, 3.9 has stopped reporting OpenMP found with OpenMP_FOUND
even on a CXX
only project (but it still finds OpenMP and correctly sets the new OpenMP_CXX_FOUND
flag).
Example CMakeLists.txt:
cmake_minimum_required(VERSION 3.8)
project(EXAMPLE LANGUAGES CXX)
find_package(OpenMP)
message(STATUS "Overall: ${OpenMP_FOUND}")
message(STATUS "CXX: ${OpenMP_CXX_FOUND}")
Output:
-- The CXX compiler identification is Clang 4.0.1
-- Check for working CXX compiler: /usr/local/opt/llvm/bin/clang++
-- Check for working CXX compiler: /usr/local/opt/llvm/bin/clang++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenMP_CXX: -fopenmp=libomp (found version "3.1")
-- Overall:
-- CXX: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/user/tmp
Exactly the same, just with CMake 3.8.2:
-- The CXX compiler identification is Clang 4.0.1
-- Check for working CXX compiler: /usr/local/opt/llvm/bin/clang++
-- Check for working CXX compiler: /usr/local/opt/llvm/bin/clang++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Try OpenMP CXX flag = [-fopenmp=libomp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Found OpenMP: -fopenmp=libomp
-- Overall: TRUE
-- CXX:
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/user/tmp