Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Scientific Software
CrysFML
Commits
91a53a72
Unverified
Commit
91a53a72
authored
Jul 15, 2021
by
Simon Ward
Browse files
Try again
parent
84fceb6e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Python_API/Src/CMakeLists.txt
View file @
91a53a72
...
...
@@ -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
...
...
setup.py
View file @
91a53a72
...
...
@@ -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"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment