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(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)
|
||||
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
file(GLOB_RECURSE CSRC "*.c")
|
||||
|
||||
add_library(cobitools3 SHARED obierrno.c
|
||||
@ -62,5 +65,10 @@ add_library(cobitools3 SHARED obierrno.c
|
||||
obitypes.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})
|
||||
|
Reference in New Issue
Block a user