Commit 82bed219711f07c0fe43d849880963553122a84b
1 parent
7f2504ce
poprawka do poprzedniego
Showing
3 changed files
with
10 additions
and
10 deletions
morfeusz/wrappers/python2/CMakeLists.txt
... | ... | @@ -2,7 +2,9 @@ |
2 | 2 | # SWIG |
3 | 3 | #set(CMAKE_SWIG_OUTDIR swig) |
4 | 4 | #~ FIND_PACKAGE (SWIG REQUIRED) |
5 | -FIND_PACKAGE (PythonLibs ${PY} EXACT) | |
5 | +if (NOT PYTHON_INCLUDE_DIRS) | |
6 | + FIND_PACKAGE (PythonLibs ${PY} EXACT) | |
7 | +endif () | |
6 | 8 | #~ INCLUDE (${SWIG_USE_FILE}) |
7 | 9 | |
8 | 10 | set (PY2MORFEUSZ_VERSION "${Morfeusz_LIB_VERSION}") |
... | ... | @@ -98,7 +100,7 @@ elseif (${CMAKE_SYSTEM_NAME} MATCHES "Windows" AND CMAKE_CROSSCOMPILING) |
98 | 100 | DEPENDS generate_python2_setup_file generate_python2_wrapper |
99 | 101 | ) |
100 | 102 | add_custom_target (build_pyd2 |
101 | - COMMAND echo Building pyd2 using ${CMAKE_CXX_COMPILER} | |
103 | + COMMAND echo Building pyd2 using ${CMAKE_CXX_COMPILER} and ${PYTHON_LIBRARIES} | |
102 | 104 | COMMAND ${CMAKE_CXX_COMPILER} -pthread -static-libgcc -static-libstdc++ -std=c++98 -DNDEBUG -DMS_WIN64 -g -fwrapv -O2 -Wall -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fno-stack-protector -Wformat -Werror=format-security -fPIC -I${PROJECT_SOURCE_DIR}/morfeusz -I${PYTHON_INCLUDE_DIRS} -c ${CMAKE_CURRENT_BINARY_DIR}/swigPYTHON.cpp -o ${CMAKE_CURRENT_BINARY_DIR}/swigPYTHON.o |
103 | 105 | COMMAND ${CMAKE_CXX_COMPILER} -pthread -static-libgcc -static-libstdc++ -DMS_WIN64 -shared -Wl,-O1 -Wl,-Bsymbolic-functions -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wdate-time -D_FORTIFY_SOURCE=2 -g -fno-stack-protector -Wformat -Werror=format-security ${CMAKE_CURRENT_BINARY_DIR}/swigPYTHON.o -L${CMAKE_CURRENT_BINARY_DIR}/../.. -L${PYTHON_LIBRARIES} -lmorfeusz2 -lpython27 -o ${CMAKE_CURRENT_BINARY_DIR}/_morfeusz2.pyd |
104 | 106 | DEPENDS generate_python2_setup_file generate_python2_wrapper libmorfeusz |
... | ... | @@ -109,7 +111,7 @@ elseif (${CMAKE_SYSTEM_NAME} MATCHES "Windows" AND CMAKE_CROSSCOMPILING) |
109 | 111 | COMMAND mv morfeusz2.dist-info win-wheel/morfeusz2-${PY2MORFEUSZ_VERSION}.dist-info |
110 | 112 | COMMAND cp morfeusz2.py _morfeusz2.pyd ../../morfeusz2.dll win-wheel |
111 | 113 | COMMAND cp WHEEL win-wheel/morfeusz2-${PY2MORFEUSZ_VERSION}.dist-info/ |
112 | - COMMAND python2 -m wheel pack --build-number ${DICT_VERSION} --dest-dir ${TARGET_DIR} win-wheel/ | |
114 | + COMMAND python3 -m wheel pack --build-number ${DICT_VERSION} --dest-dir ${TARGET_DIR} win-wheel/ | |
113 | 115 | COMMAND rm -r win-wheel |
114 | 116 | DEPENDS package-python2-dist-info build_pyd2 |
115 | 117 | ) |
... | ... |
morfeusz/wrappers/python3/CMakeLists.txt
... | ... | @@ -101,7 +101,7 @@ elseif (${CMAKE_SYSTEM_NAME} MATCHES "Windows" AND CMAKE_CROSSCOMPILING) |
101 | 101 | DEPENDS generate_python3_setup_file generate_python3_wrapper |
102 | 102 | ) |
103 | 103 | add_custom_target (build_pyd |
104 | - COMMAND echo Building pyd using ${CMAKE_CXX_COMPILER} | |
104 | + COMMAND echo Building pyd using ${CMAKE_CXX_COMPILER} and ${PYTHON_LIBRARIES} | |
105 | 105 | COMMAND ${CMAKE_CXX_COMPILER} -pthread -static-libgcc -static-libstdc++ -std=c++98 -DNDEBUG -DMS_WIN64 -g -fwrapv -O2 -Wall -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fno-stack-protector -Wformat -Werror=format-security -fPIC -I${PROJECT_SOURCE_DIR}/morfeusz -I${PYTHON_INCLUDE_DIRS} -c ${CMAKE_CURRENT_BINARY_DIR}/swigPYTHON.cpp -o ${CMAKE_CURRENT_BINARY_DIR}/swigPYTHON.o |
106 | 106 | COMMAND ${CMAKE_CXX_COMPILER} -pthread -static-libgcc -static-libstdc++ -DMS_WIN64 -shared -Wl,-O1 -Wl,-Bsymbolic-functions -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wdate-time -D_FORTIFY_SOURCE=2 -g -fno-stack-protector -Wformat -Werror=format-security ${CMAKE_CURRENT_BINARY_DIR}/swigPYTHON.o -L${CMAKE_CURRENT_BINARY_DIR}/../.. -L${PYTHON_LIBRARIES} -lmorfeusz2 -lpython${PY_SHORT} -o ${CMAKE_CURRENT_BINARY_DIR}/_morfeusz2.pyd |
107 | 107 | DEPENDS generate_python3_setup_file generate_python3_wrapper libmorfeusz |
... | ... |
toolchains/Toolchain-Windows-i386.cmake
... | ... | @@ -11,13 +11,11 @@ set (CMAKE_SYSTEM_PROCESSOR "x86") |
11 | 11 | set (WIN32_ROOT ${CROSSMORFEUSZ_ROOT}/windows32) |
12 | 12 | set (PYTHON_ROOT ${WIN32_ROOT}/Python27) |
13 | 13 | if(${PY}) |
14 | - if("${PY}" MATCHES "3.*") | |
15 | - string(REPLACE "." "" PY_SHORT "${PY}") | |
14 | + string(REPLACE "." "" PY_SHORT "${PY}") | |
16 | 15 | |
17 | - set (PYTHON_ROOT ${WIN32_ROOT}/Python36) | |
18 | - set (PYTHON_LIBRARIES ${PYTHON_ROOT}/libs) | |
19 | - set (PYTHON_INCLUDE_DIRS ${PYTHON_ROOT}/include) | |
20 | - endif() | |
16 | + set (PYTHON_ROOT ${WIN32_ROOT}/Python${PY_SHORT}) | |
17 | + set (PYTHON_LIBRARIES ${PYTHON_ROOT}/libs) | |
18 | + set (PYTHON_INCLUDE_DIRS ${PYTHON_ROOT}/include) | |
21 | 19 | endif() |
22 | 20 | set (JAVA_ROOT ${WIN32_ROOT}/Java/jdk1.7.0_45) |
23 | 21 | set (CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32 ${JAVA_ROOT} ${PYTHON_ROOT}) |
... | ... |