changeset 23:874a3fef26ff

fix suffix of Windows library
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 03 Apr 2020 11:28:04 +0200
parents 04b8a44b2717
children 3bed39e4b85f
files CMakeLists.txt
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/CMakeLists.txt	Fri Apr 03 10:47:01 2020 +0200
+++ b/CMakeLists.txt	Fri Apr 03 11:28:04 2020 +0200
@@ -25,7 +25,13 @@
 endif()
 
 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
-  set(PYTHON_LIBRARY_NAME libpython${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}.a)
+  if (MSVC)
+    set(Suffix ".lib")
+  else()
+    set(Suffix ".a")
+  endif()
+  
+  set(PYTHON_LIBRARY_NAME libpython${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}.${Suffix})
   set(PYTHON_INCLUDE_DIRS ${PYTHON_WINDOWS_ROOT}/include)
   set(PYTHON_LIBRARIES ${PYTHON_WINDOWS_ROOT}/libs/${PYTHON_LIBRARY_NAME})