CMake: setting compiler higher to avoid conflicts, and linking libopenmp
This commit is contained in:
@ -1,14 +1,17 @@
|
|||||||
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_BUILD_TYPE Release)
|
||||||
|
|
||||||
SET(CMAKE_C_COMPILER gcc)
|
|
||||||
|
|
||||||
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
|
|||||||
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})
|
||||||
|
|
Reference in New Issue
Block a user