Skip to content

Commit

Permalink
Correct issue over previous commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
viferga committed Aug 23, 2023
1 parent 01ab2a0 commit 108c3fc
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions source/loaders/py_loader/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,17 @@ endif()
# TODO: https://gist.github.com/micahsnyder/5d98ac8548b429309ec5a35bca9366da
include(Portability)

if(PROJECT_OS_WIN)
string(REGEX REPLACE "[.]lib$" ".dll" Python3_LIBRARY_NAME ${Python3_LIBRARY})
elseif(PROJECT_OS_MINGW)
string(REGEX REPLACE "[.]a$" ".dll" Python3_LIBRARY_NAME ${Python3_LIBRARY})
if(Python3_LIBRARIES)
if(PROJECT_OS_WIN)
string(REGEX REPLACE "[.]lib$" ".dll" Python3_LIBRARIES_NAME ${Python3_LIBRARIES})
elseif(PROJECT_OS_MINGW)
string(REGEX REPLACE "[.]a$" ".dll" Python3_LIBRARIES_NAME ${Python3_LIBRARIES})
endif()
endif()

if(Python3_LIBRARY_NAME)
if(Python3_LIBRARIES_NAME)
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_OUTPUT_DIR})
file(COPY ${Python3_LIBRARY_NAME} DESTINATION ${PROJECT_OUTPUT_DIR})
file(COPY ${Python3_LIBRARIES_NAME} DESTINATION ${PROJECT_OUTPUT_DIR})
endif()

#
Expand Down Expand Up @@ -216,9 +218,9 @@ install(TARGETS ${target}
# Runtime (pack Python DLL in windows)
# TODO: https://cmake.org/cmake/help/latest/command/file.html#get-runtime-dependencies
# TODO: https://gist.github.com/micahsnyder/5d98ac8548b429309ec5a35bca9366da
if(Python3_LIBRARY_NAME)
if(Python3_LIBRARIES_NAME)
install(FILES
${Python3_LIBRARY_NAME}
${Python3_LIBRARIES_NAME}
DESTINATION ${INSTALL_LIB}
COMPONENT runtime
)
Expand Down

0 comments on commit 108c3fc

Please sign in to comment.