From 97f64686630ce6ee50ca8fbcbc27f4ae20905d8d Mon Sep 17 00:00:00 2001 From: Dennis Luxen Date: Thu, 29 Jan 2015 17:29:03 +0100 Subject: [PATCH] yet another try to unhack libgomp linking: use OpenMP binding if and only if present --- CMakeLists.txt | 7 ++++--- cmake/FindGomp.cmake | 18 ------------------ 2 files changed, 4 insertions(+), 21 deletions(-) delete mode 100644 cmake/FindGomp.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 834031b15..8c70efb56 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -272,9 +272,10 @@ target_link_libraries(OSRM ${STXXL_LIBRARY}) target_link_libraries(osrm-extract ${STXXL_LIBRARY}) target_link_libraries(osrm-prepare ${STXXL_LIBRARY}) -find_package(Gomp REQUIRED) -if(LIBGOMP_FOUND) - target_link_libraries(osrm-extract gomp) +find_package(OpenMP) +if(OPENMP_FOUND) + message(STATUS "OpenMP support found. Linking just in case for stxxl") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") endif() find_package(OSMPBF REQUIRED) diff --git a/cmake/FindGomp.cmake b/cmake/FindGomp.cmake deleted file mode 100644 index 3721e8156..000000000 --- a/cmake/FindGomp.cmake +++ /dev/null @@ -1,18 +0,0 @@ -# - Try to find Libgomp -# Once done this will define -# LIBGOMP_FOUND - System has Libgomp -# LIBGOMP_INCLUDE_DIRS - The Libgomp include directories -# LIBGOMP_DEFINITIONS - Compiler switches required for using Libgomp - -message(STATUS "Checking if libgomp is present") - -find_library(LIBGOMP_LIBRARY NAMES gomp libgomp - HINTS ${PC_LIBXML_LIBDIR} ${PC_LIBXML_LIBRARY_DIRS} ) - -set(LIBGOMP_LIBRARIES ${LIBGOMP_LIBRARY} ) - -include(FindPackageHandleStandardArgs) -# handle the QUIETLY and REQUIRED arguments and set LIBGOMP_FOUND to TRUE -# if all listed variables are TRUE -#find_package_handle_standard_args(Libgomp DEFAULT_MSG -# LIBGOMP_LIBRARY LIBGOMP_INCLUDE_DIR)