add explicit cmake checking step for libgomp

This commit is contained in:
Dennis Luxen 2015-01-29 17:01:08 +01:00
parent 36aadc21a7
commit a883b73981
2 changed files with 22 additions and 1 deletions

View File

@ -272,7 +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)
endif()
find_package(OSMPBF REQUIRED)
include_directories(${OSMPBF_INCLUDE_DIR})

18
cmake/FindGomp.cmake Normal file
View File

@ -0,0 +1,18 @@
# - 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)