Skip to content

Commit

Permalink
Improve python3 dll copy in windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
viferga committed Aug 23, 2023
1 parent 6385d99 commit 8e07327
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions source/loaders/py_loader/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,17 @@ endif()
include(Portability)

if(Python3_LIBRARIES)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(Python3_LIBRARY_PATTERN "[.]lib$")
set(Python3_LIBRARY_REPLACE ".dll")
else()
set(Python3_LIBRARY_PATTERN "_d[.]lib$")
set(Python3_LIBRARY_REPLACE "_d.dll")
endif()

foreach(library ${Python3_LIBRARIES})
if(${library} MATCHES "[.].dll$")
set(Python3_LIBRARY_NAME ${library})
if(${library} MATCHES ${Python3_LIBRARY_PATTERN})
string(REGEX REPLACE ${Python3_LIBRARY_PATTERN} ${Python3_LIBRARY_REPLACE} Python3_LIBRARY_NAME ${library})
break()
endif()
endforeach()
Expand Down

0 comments on commit 8e07327

Please sign in to comment.