Unverified Commit 91a53a72 authored by Simon Ward's avatar Simon Ward
Browse files

Try again

parent 84fceb6e
......@@ -32,15 +32,18 @@ set_source_files_properties(forpy_mod.f90 PROPERTIES COMPILE_FLAG "-cpp")
# See https://gitlab.kitware.com/cmake/cmake/-/issues/19226 for linking
add_dependencies(${LIBRARY_NAME} crysfml_common)
set(Python3_USE_STATIC_LIBS, ON)
find_package(Python3 COMPONENTS Interpreter Development)
set(PYTHON_INTERPRETER_PATH ${Python3_EXECUTABLE})
if(WIN32 OR MSYS)
FIND_PACKAGE(PythonLibs REQUIRED)
set(PYTHON_LIBRARY_PATH ${PYTHON_LIBRARIES})
message(STATUS ${PYTHON_LIBRARY_PATH})
add_library(Python3_LIB STATIC IMPORTED)
set_property(TARGET Python3_LIB PROPERTY IMPORTED_LOCATION ${PYTHON_LIBRARY_PATH})
# FIND_PACKAGE(PythonLibs REQUIRED)
# set(PYTHON_LIBRARY_PATH ${PYTHON_LIBRARIES})
# message(STATUS ${PYTHON_LIBRARY_PATH})
# add_library(Python3_LIB STATIC IMPORTED)
# set_property(TARGET Python3_LIB PROPERTY IMPORTED_LOCATION ${Python3::Python})
target_link_libraries(${LIBRARY_NAME} Python3::Python)
endif()
# Set -Wl,-undefined,dynamic_lookup to OTHER_LDFLAGS
......@@ -50,8 +53,6 @@ target_link_libraries(${LIBRARY_NAME} crysfml_common)
# Fix a problem on Mac OS X when building shared libraries
if(APPLE)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -undefined dynamic_lookup")
elseif(WIN32 OR MSYS)
target_link_libraries(${LIBRARY_NAME} Python3_LIB)
endif()
# Set library extension
......
......@@ -219,8 +219,6 @@ class BuildCMakeExt(build_ext):
'-H' + SOURCE_DIR,
'-B' + self.build_temp,
"-DPYTHON_EXECUTABLE:FILEPATH={}".format(sys.executable),
"-DPYTHON_LIBRARY={}".format(os.path.join(os.path.split(sys.executable)[0], 'lib')),
"-DPYTHON_INCLUDE_DIR={}".format(os.path.join(os.path.split(sys.executable)[0], 'include')),
"-DARCH32=OFF",
"-DCMAKE_Fortran_COMPILER={}".format(COMPILER),
"-DPYTHON_API=ON",
......
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