Permalink
Browse files

On windows, ensure python module are located in "Lib" folder.

This is required by the code associated to the 'get_python_lib' function
in Lib/distutils/sysconfig.py

Considering that the function 'get_python_lib' is used when building
external package like Numpy, it is particularly important to be compliant
with the file organization imposed by the implementation of the 'get_python_lib'
function.
  • Loading branch information...
1 parent 7a2fdd2 commit e94feac01b1a754619b0847fa7bef1d851898a6c @jcfr jcfr committed Mar 28, 2013
Showing with 8 additions and 2 deletions.
  1. +8 −2 CMakeLists.txt
View
@@ -105,12 +105,18 @@ if(NOT BUILD_SHARED AND NOT BUILD_STATIC)
endif(NOT BUILD_SHARED AND NOT BUILD_STATIC)
# Set PYTHONHOME
-set(LIBDIR "lib")
+set(LIBDIR "Lib") # See Lib/distutils/sysconfig.py - function 'get_python_lib'
+if(UNIX)
+ set(LIBDIR "lib")
+endif()
if(USE_LIB64)
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS ON)
set(LIBDIR "lib64")
endif()
-set(PYTHONHOME "${LIBDIR}/${LIBPYTHON}")
+set(PYTHONHOME "${LIBDIR}")
+if(UNIX)
+ set(PYTHONHOME "${PYTHONHOME}/${LIBPYTHON}")
+endif()
# Install tree directory
set(BIN_INSTALL_DIR bin) # Contains the python executable

0 comments on commit e94feac

Please sign in to comment.