diff --git a/CMakeLists.txt b/CMakeLists.txt index f9bfbe9fe8b0c38812962fc094a5b0b0f905b04f..1c7af52e2e35af2c48aee44506797424475305b1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,6 +17,7 @@ set(THREADS_PREFER_PTHREAD_FLAG ON) set(CMAKE_COLOR_MAKEFILE ON) include(TestBigEndian) # Needed for endianness tests +include(FindOpenMP) # Test OpenMP support include(GNUInstallDirs) # Needed for installation things set(${CMAKE_C_COMPILER_ID}_C_FLAGS) @@ -233,15 +234,21 @@ set(SQL_SOURCE_FILES ### ### try_compile(OPENMP_SUPPORT_OK - ${CMAKE_BINARY_DIR/___openmp_test_ok + ${CMAKE_BINARY_DIR}/___openmp_test_ok ${CMAKE_CURRENT_SOURCE_DIR}/utils/cmake/TestOpenMP.c} LINK_LIBRARIES -fopenmp ) if(OPENMP_SUPPORT_OK) - message(STATUS "Compiler has OpenMP support") + message(STATUS "Compiler has OpenMP support (test program compiles)") else() - message(FATAL_ERROR "Compiler doesn't have OpenMP support") + message(FATAL_ERROR "Compiler doesn't have OpenMP support (test program doesn't compile)") +endif() + +if(OpenMP_FOUND) + message(STATUS "OpenMP found by CMake for C and C++") +else() + message(FATAL_ERROR "OpenMP not found by CMake for C and C++") endif() ### ###