Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Scientific Software
CrysFML
Commits
b6a93dc1
Unverified
Commit
b6a93dc1
authored
Jul 10, 2021
by
Simon Ward
Committed by
GitHub
Jul 10, 2021
Browse files
Update with not linking against libpython
parent
aa7b5265
Changes
1
Hide whitespace changes
Inline
Side-by-side
Python_API/Src/CMakeLists.txt
View file @
b6a93dc1
...
...
@@ -41,27 +41,27 @@ else()
message
(
STATUS
"using Python interpreter provided with PYTHON_INTERPRETER_PATH variable: "
${
PYTHON_INTERPRETER_PATH
}
)
endif
()
if
(
NOT PYTHON_LIBRARY_PATH
)
set
(
Python_ADDITIONAL_VERSIONS
${
COMPATIBLE_VERSIONS
}
)
find_package
(
PythonLibs REQUIRED
)
set
(
PYTHON_LIBRARY_PATH
${
PYTHON_LIBRARY
}
)
message
(
STATUS
${
PYTHON_LIBRARY_PATH
}
)
else
()
message
(
STATUS
"Linking Python extension with provided PYTHON_LIBRARY_PATH variable: "
${
PYTHON_LIBRARY_PATH
}
)
endif
()
if
(
UNIX
)
add_library
(
Python3_LIB SHARED IMPORTED
)
set_property
(
TARGET Python3_LIB PROPERTY IMPORTED_LOCATION
${
PYTHON_LIBRARY_PATH
}
)
elseif
(
WIN32
)
add_library
(
Python3_LIB STATIC IMPORTED
)
set_property
(
TARGET Python3_LIB PROPERTY IMPORTED_LOCATION
${
PYTHON_LIBRARY_PATH
}
)
endif
()
#
if (NOT PYTHON_LIBRARY_PATH)
#
set(Python_ADDITIONAL_VERSIONS ${COMPATIBLE_VERSIONS})
#
find_package(PythonLibs REQUIRED)
#
set(PYTHON_LIBRARY_PATH ${PYTHON_LIBRARY})
#
message(STATUS ${PYTHON_LIBRARY_PATH})
#
else()
#
message(STATUS "Linking Python extension with provided PYTHON_LIBRARY_PATH variable: " ${PYTHON_LIBRARY_PATH})
#
endif()
#
if (UNIX)
#
add_library(Python3_LIB SHARED IMPORTED)
#
set_property(TARGET Python3_LIB PROPERTY IMPORTED_LOCATION ${PYTHON_LIBRARY_PATH})
#
elseif(WIN32)
#
add_library(Python3_LIB STATIC IMPORTED)
#
set_property(TARGET Python3_LIB PROPERTY IMPORTED_LOCATION ${PYTHON_LIBRARY_PATH})
#
endif()
# Set include and linking
include_directories
(
${
CRYSFML_COMMON_MODULE_DIRECTORY
}
)
target_link_libraries
(
${
LIBRARY_NAME
}
crysfml_common
)
target_link_libraries
(
${
LIBRARY_NAME
}
Python3_LIB
)
#
target_link_libraries(${LIBRARY_NAME} Python3_LIB)
# Set library extension
set_target_properties
(
${
LIBRARY_NAME
}
PROPERTIES PREFIX
""
OUTPUT_NAME
${
LIBRARY_NAME
}
)
...
...
@@ -150,4 +150,4 @@ install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../Examples/Data" DESTINATION ${P
install
(
DIRECTORY
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../Tests"
DESTINATION
${
PYTHON_API_PREFIX
}
FILES_MATCHING PATTERN
"*.py"
)
# Installing documentation files
install
(
DIRECTORY
"
${
CMAKE_CURRENT_BINARY_DIR
}
/doxygen/html"
DESTINATION
${
PYTHON_API_PREFIX
}
/Doc OPTIONAL
)
\ No newline at end of file
install
(
DIRECTORY
"
${
CMAKE_CURRENT_BINARY_DIR
}
/doxygen/html"
DESTINATION
${
PYTHON_API_PREFIX
}
/Doc OPTIONAL
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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