Unverified Commit b6a93dc1 authored by Simon Ward's avatar Simon Ward Committed by GitHub
Browse files

Update with not linking against libpython

parent aa7b5265
......@@ -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)
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