Verified Commit 516110e6 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

cmake: fix compatibility issue with Linux

parent 6a0094e9
Pipeline #13936 passed with stage
in 173 minutes and 36 seconds
......@@ -32,7 +32,9 @@ INCLUDE(${CMAKE_CURRENT_LIST_DIR}/cmake/boost.cmake)
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/cmake/python.cmake)
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/cmake/ide.cmake)
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/cmake/apple.cmake)
SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake/find-external/OpenMP ${CMAKE_MODULE_PATH})
IF(APPLE) # Use the handmade approach
SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake/find-external/OpenMP ${CMAKE_MODULE_PATH})
ENDIF(APPLE)
INCLUDE(CMakeDependentOption)
# If needed, set CMake policy for APPLE systems
......
......@@ -53,7 +53,7 @@ ENDIF(CPPADCG_FOUND)
IF(BUILD_WITH_OPENMP_SUPPORT)
ADD_BENCH(timings-parallel TRUE)
TARGET_LINK_LIBRARIES(timings-parallel PRIVATE OpenMP::OpenMP)
TARGET_LINK_LIBRARIES(timings-parallel PRIVATE OpenMP::OpenMP_CXX)
ENDIF(BUILD_WITH_OPENMP_SUPPORT)
# timings
......
......@@ -128,11 +128,11 @@ IF(BUILD_PYTHON_INTERFACE)
SET(PKG_CONFIG_PYWRAP_REQUIRES "eigenpy >= 2.6.2")
ADD_LIBRARY(${PYWRAP} SHARED ${${PYWRAP}_SOURCES} ${${PYWRAP}_HEADERS})
IF(BUILD_WITH_OPENMP_SUPPORT)
TARGET_COMPILE_OPTIONS(${PYWRAP} PRIVATE ${OpenMP_COMPILE_OPTIONS})
TARGET_COMPILE_OPTIONS(${PYWRAP} PRIVATE ${OpenMP_CXX_COMPILE_OPTIONS})
TARGET_COMPILE_DEFINITIONS(${PYWRAP} PRIVATE -DPINOCCHIO_PYTHON_INTERFACE_WITH_OPENMP)
TARGET_INCLUDE_DIRECTORIES(${PYWRAP} SYSTEM PRIVATE ${OpenMP_INCLUDE_DIR})
TARGET_INCLUDE_DIRECTORIES(${PYWRAP} SYSTEM PRIVATE ${OpenMP_CXX_INCLUDE_DIR})
IF(LINK_PYTHON_INTERFACE_TO_OPENM)
TARGET_LINK_LIBRARIES(${PYWRAP} PRIVATE ${OpenMP_LIBRARIES})
TARGET_LINK_LIBRARIES(${PYWRAP} PRIVATE ${OpenMP_CXX_LIBRARIES})
ENDIF(LINK_PYTHON_INTERFACE_TO_OPENM)
ENDIF(BUILD_WITH_OPENMP_SUPPORT)
ADD_DEPENDENCIES(python ${PYWRAP})
......
......@@ -49,7 +49,7 @@ MACRO(ADD_PINOCCHIO_PARALLEL_UNIT_TEST NAME)
IF(BUILD_WITH_OPENMP_SUPPORT)
ADD_PINOCCHIO_UNIT_TEST(${ARGV})
SET(TEST_NAME "test-cpp-${NAME}")
TARGET_LINK_LIBRARIES(${TEST_NAME} PRIVATE OpenMP::OpenMP)
TARGET_LINK_LIBRARIES(${TEST_NAME} PRIVATE OpenMP::OpenMP_CXX)
ENDIF()
ENDMACRO()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment