Commit 90d5525b authored by Rémy Mozul's avatar Rémy Mozul
Browse files

CMake correction and fPIC flags for Linux

parent 0c1a937a
......@@ -8,6 +8,9 @@ set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/modules)
set(CMAKE_Fortran_FLAGS "-fPIC")
find_package(PythonLibs REQUIRED)
find_package(Numpy REQUIRED)
find_program(cython cython)
......@@ -15,16 +18,20 @@ find_program(cython cython)
add_library(f_dtype mod_dtype.f90)
add_custom_target(dtypec ALL ${cython} ${CMAKE_CURRENT_SOURCE_DIR}/dtype.pyx -o ${CMAKE_CURRENT_BINARY_DIR}/dtype.c
DEPENDS dtype dtype.h dtype.pxd
DEPENDS f_dtype dtype.h dtype.pxd
add_library(dtype SHARED dtype.c)
target_link_libraries(dtype f_dtype ${PYTHON_LIBRARIES})
add_dependencies(dtype dtypec)
set_source_files_properties(dtype.c PROPERTIES GENERATED TRUE )
set_target_properties(dtype PROPERTIES PREFIX "")
set_target_properties(dtype PROPERTIES SUFFIX ".so")
set_source_files_properties(dtype.c PROPERTIES GENERATED TRUE )
target_link_libraries(dtype f_dtype ${PYTHON_LIBRARIES})
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