Commit ed5bb70c by Celine Mercier

CMake: setting compiler higher to avoid conflicts, and linking libopenmp

parent 22a5ae72
cmake_minimum_required(VERSION 3.10) cmake_minimum_required(VERSION 3.9)
SET(CMAKE_C_COMPILER gcc)
set(CMAKE_POSITION_INDEPENDENT_CODE ON) set(CMAKE_POSITION_INDEPENDENT_CODE ON)
SET(PYTHONLIB "po" CACHE STRING "Location of the python site-package directory") SET(PYTHONLIB "po" CACHE STRING "Location of the python site-package directory")
project (cobitools3) project (cobitools3 LANGUAGES C)
set(CMAKE_BUILD_TYPE Release)
SET(CMAKE_C_COMPILER gcc) set(CMAKE_BUILD_TYPE Release)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_CURRENT_SOURCE_DIR})
file(GLOB_RECURSE CSRC "*.c") file(GLOB_RECURSE CSRC "*.c")
add_library(cobitools3 SHARED obierrno.c add_library(cobitools3 SHARED obierrno.c
...@@ -61,6 +64,11 @@ add_library(cobitools3 SHARED obierrno.c ...@@ -61,6 +64,11 @@ add_library(cobitools3 SHARED obierrno.c
libecoPCR/ecoError.c libecoPCR/ecoError.c
obitypes.c obitypes.c
array_indexer.c) array_indexer.c)
find_package(OpenMP)
if(OpenMP_C_FOUND)
target_link_libraries(cobitools3 PUBLIC OpenMP::OpenMP_C)
endif()
install(TARGETS cobitools3 DESTINATION ${PYTHONLIB}) install(TARGETS cobitools3 DESTINATION ${PYTHONLIB})
\ No newline at end of file
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