I would like to verify that the current compiler can build with openmp support. The application has do deploy across a wide variety of unix systems, some of which might hav
OpenMP support has been improved in CMake 3.9+
cmake_minimum_required(VERSION 3.9)
project(openmp_test) # you can change the project name
find_package(OpenMP)
add_executable(openmp_para_test main.cpp) # you can change the excutable name
if(OpenMP_CXX_FOUND)
target_link_libraries(openmp_para_test PUBLIC OpenMP::OpenMP_CXX)
endif()
This way will correctly set the library link line differently from the compile line if needed.
Source.