Skip to content
Snippets Groups Projects
Commit d3af6152 authored by Sergey Yakubov's avatar Sergey Yakubov
Browse files

python for windows

parent b5e7587b
No related branches found
No related tags found
No related merge requests found
Showing
with 1956 additions and 46 deletions
# Find the Python NumPy package
# PYTHON_NUMPY_INCLUDE_DIR
# PYTHON_NUMPY_FOUND
# will be set by this script
cmake_minimum_required(VERSION 2.6)
if(NOT Python3_EXECUTABLE)
if(NumPy_FIND_QUIETLY)
find_package(Python3 QUIET)
else()
find_package(Python3)
set(__numpy_out 1)
endif()
endif()
if (Python3_EXECUTABLE)
# Find out the include path
execute_process(
COMMAND "${Python3_EXECUTABLE}" -c
"from __future__ import print_function\ntry: import numpy; print(numpy.get_include(), end='')\nexcept:pass\n"
OUTPUT_VARIABLE __numpy_path)
# And the version
execute_process(
COMMAND "${Python3_EXECUTABLE}" -c
"from __future__ import print_function\ntry: import numpy; print(numpy.__version__, end='')\nexcept:pass\n"
OUTPUT_VARIABLE __numpy_version)
elseif(__numpy_out)
message(STATUS "Python executable not found.")
endif(Python3_EXECUTABLE)
find_path(PYTHON_NUMPY_INCLUDE_DIR numpy/arrayobject.h
HINTS "${__numpy_path}" "${PYTHON_INCLUDE_PATH}" NO_DEFAULT_PATH)
if(PYTHON_NUMPY_INCLUDE_DIR)
set(PYTHON_NUMPY_FOUND 1 CACHE INTERNAL "Python numpy found")
endif(PYTHON_NUMPY_INCLUDE_DIR)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(NumPy REQUIRED_VARS PYTHON_NUMPY_INCLUDE_DIR
VERSION_VAR __numpy_version)
\ No newline at end of file
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#[=======================================================================[.rst:
FindPython
----------
Find Python interpreter, compiler and development environment (include
directories and libraries).
Three components are supported:
* ``Interpreter``: search for Python interpreter.
* ``Compiler``: search for Python compiler. Only offered by IronPython.
* ``Development``: search for development artifacts (include directories and
libraries).
* ``NumPy``: search for NumPy include directories.
If no ``COMPONENTS`` is specified, ``Interpreter`` is assumed.
To ensure consistent versions between components ``Interpreter``, ``Compiler``,
``Development`` and ``NumPy``, specify all components at the same time::
find_package (Python COMPONENTS Interpreter Development)
This module looks preferably for version 3 of Python. If not found, version 2
is searched.
To manage concurrent versions 3 and 2 of Python, use :module:`FindPython3` and
:module:`FindPython2` modules rather than this one.
.. note::
If components ``Interpreter`` and ``Development`` are both specified, this
module search only for interpreter with same platform architecture as the one
defined by ``CMake`` configuration. This contraint does not apply if only
``Interpreter`` component is specified.
Imported Targets
^^^^^^^^^^^^^^^^
This module defines the following :ref:`Imported Targets <Imported Targets>`
(when :prop_gbl:`CMAKE_ROLE` is ``PROJECT``):
``Python::Interpreter``
Python interpreter. Target defined if component ``Interpreter`` is found.
``Python::Compiler``
Python compiler. Target defined if component ``Compiler`` is found.
``Python::Python``
Python library. Target defined if component ``Development`` is found.
``Python::NumPy``
NumPy Python library. Target defined if component ``NumPy`` is found.
Result Variables
^^^^^^^^^^^^^^^^
This module will set the following variables in your project
(see :ref:`Standard Variable Names <CMake Developer Standard Variable Names>`):
``Python_FOUND``
System has the Python requested components.
``Python_Interpreter_FOUND``
System has the Python interpreter.
``Python_EXECUTABLE``
Path to the Python interpreter.
``Python_INTERPRETER_ID``
A short string unique to the interpreter. Possible values include:
* Python
* ActivePython
* Anaconda
* Canopy
* IronPython
``Python_STDLIB``
Standard platform independent installation directory.
Information returned by
``distutils.sysconfig.get_python_lib(plat_specific=False,standard_lib=True)``.
``Python_STDARCH``
Standard platform dependent installation directory.
Information returned by
``distutils.sysconfig.get_python_lib(plat_specific=True,standard_lib=True)``.
``Python_SITELIB``
Third-party platform independent installation directory.
Information returned by
``distutils.sysconfig.get_python_lib(plat_specific=False,standard_lib=False)``.
``Python_SITEARCH``
Third-party platform dependent installation directory.
Information returned by
``distutils.sysconfig.get_python_lib(plat_specific=True,standard_lib=False)``.
``Python_Compiler_FOUND``
System has the Python compiler.
``Python_COMPILER``
Path to the Python compiler. Only offered by IronPython.
``Python_COMPILER_ID``
A short string unique to the compiler. Possible values include:
* IronPython
``Python_Development_FOUND``
System has the Python development artifacts.
``Python_INCLUDE_DIRS``
The Python include directories.
``Python_LIBRARIES``
The Python libraries.
``Python_LIBRARY_DIRS``
The Python library directories.
``Python_RUNTIME_LIBRARY_DIRS``
The Python runtime library directories.
``Python_VERSION``
Python version.
``Python_VERSION_MAJOR``
Python major version.
``Python_VERSION_MINOR``
Python minor version.
``Python_VERSION_PATCH``
Python patch version.
``Python_NumPy_FOUND``
System has the NumPy.
``Python_NumPy_INCLUDE_DIRS``
The NumPy include directries.
``Python_NumPy_VERSION``
The NumPy version.
Hints
^^^^^
``Python_ROOT_DIR``
Define the root directory of a Python installation.
``Python_USE_STATIC_LIBS``
* If not defined, search for shared libraries and static libraries in that
order.
* If set to TRUE, search **only** for static libraries.
* If set to FALSE, search **only** for shared libraries.
``Python_FIND_REGISTRY``
On Windows the ``Python_FIND_REGISTRY`` variable determine the order
of preference between registry and environment variables.
the ``Python_FIND_REGISTRY`` variable can be set to empty or one of the
following:
* ``FIRST``: Try to use registry before environment variables.
This is the default.
* ``LAST``: Try to use registry after environment variables.
* ``NEVER``: Never try to use registry.
``CMAKE_FIND_FRAMEWORK``
On OS X the :variable:`CMAKE_FIND_FRAMEWORK` variable determine the order of
preference between Apple-style and unix-style package components.
.. note::
Value ``ONLY`` is not supported so ``FIRST`` will be used instead.
.. note::
If a Python virtual environment is configured, set variable
``Python_FIND_REGISTRY`` (Windows) or ``CMAKE_FIND_FRAMEWORK`` (macOS) with
value ``LAST`` or ``NEVER`` to select it preferably.
Commands
^^^^^^^^
This module defines the command ``Python_add_library`` (when
:prop_gbl:`CMAKE_ROLE` is ``PROJECT``), which has the same semantics as
:command:`add_library`, but takes care of Python module naming rules
(only applied if library is of type ``MODULE``), and adds a dependency to target
``Python::Python``::
Python_add_library (my_module MODULE src1.cpp)
If library type is not specified, ``MODULE`` is assumed.
#]=======================================================================]
set (_PYTHON_PREFIX Python)
if (DEFINED Python_FIND_VERSION)
set (_Python_REQUIRED_VERSION_MAJOR ${Python_FIND_VERSION_MAJOR})
include (${CMAKE_CURRENT_LIST_DIR}/FindPython/Support.cmake)
else()
# iterate over versions in quiet and NOT required modes to avoid multiple
# "Found" messages and prematurally failure.
set (_Python_QUIETLY ${Python_FIND_QUIETLY})
set (_Python_REQUIRED ${Python_FIND_REQUIRED})
set (Python_FIND_QUIETLY TRUE)
set (Python_FIND_REQUIRED FALSE)
set (_Python_REQUIRED_VERSIONS 3 2)
set (_Python_REQUIRED_VERSION_LAST 2)
foreach (_Python_REQUIRED_VERSION_MAJOR IN LISTS _Python_REQUIRED_VERSIONS)
set (Python_FIND_VERSION ${_Python_REQUIRED_VERSION_MAJOR})
include (${CMAKE_CURRENT_LIST_DIR}/FindPython/Support.cmake)
if (Python_FOUND OR
_Python_REQUIRED_VERSION_MAJOR EQUAL _Python_REQUIRED_VERSION_LAST)
break()
endif()
# clean-up some CACHE variables to ensure look-up restart from scratch
foreach (_Python_ITEM IN LISTS _Python_CACHED_VARS)
unset (${_Python_ITEM} CACHE)
endforeach()
endforeach()
unset (Python_FIND_VERSION)
set (Python_FIND_QUIETLY ${_Python_QUIETLY})
set (Python_FIND_REQUIRED ${_Python_REQUIRED})
if (Python_FIND_REQUIRED OR NOT Python_FIND_QUIETLY)
# call again validation command to get "Found" or error message
find_package_handle_standard_args (Python HANDLE_COMPONENTS
REQUIRED_VARS ${_Python_REQUIRED_VARS}
VERSION_VAR Python_VERSION)
endif()
endif()
if (COMMAND __Python_add_library)
macro (Python_add_library)
__Python_add_library (Python ${ARGV})
endmacro()
endif()
unset (_PYTHON_PREFIX)
\ No newline at end of file
This diff is collapsed.
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#[=======================================================================[.rst:
FindPython3
-----------
Find Python 3 interpreter, compiler and development environment (include
directories and libraries).
Three components are supported:
* ``Interpreter``: search for Python 3 interpreter
* ``Compiler``: search for Python 3 compiler. Only offered by IronPython.
* ``Development``: search for development artifacts (include directories and
libraries)
* ``NumPy``: search for NumPy include directories.
If no ``COMPONENTS`` is specified, ``Interpreter`` is assumed.
To ensure consistent versions between components ``Interpreter``, ``Compiler``,
``Development`` and ``NumPy``, specify all components at the same time::
find_package (Python3 COMPONENTS Interpreter Development)
This module looks only for version 3 of Python. This module can be used
concurrently with :module:`FindPython2` module to use both Python versions.
The :module:`FindPython` module can be used if Python version does not matter
for you.
.. note::
If components ``Interpreter`` and ``Development`` are both specified, this
module search only for interpreter with same platform architecture as the one
defined by ``CMake`` configuration. This contraint does not apply if only
``Interpreter`` component is specified.
Imported Targets
^^^^^^^^^^^^^^^^
This module defines the following :ref:`Imported Targets <Imported Targets>`
(when :prop_gbl:`CMAKE_ROLE` is ``PROJECT``):
``Python3::Interpreter``
Python 3 interpreter. Target defined if component ``Interpreter`` is found.
``Python3::Compiler``
Python 3 compiler. Target defined if component ``Compiler`` is found.
``Python3::Python``
Python 3 library. Target defined if component ``Development`` is found.
``Python3::NumPy``
NumPy library for Python 3. Target defined if component ``NumPy`` is found.
Result Variables
^^^^^^^^^^^^^^^^
This module will set the following variables in your project
(see :ref:`Standard Variable Names <CMake Developer Standard Variable Names>`):
``Python3_FOUND``
System has the Python 3 requested components.
``Python3_Interpreter_FOUND``
System has the Python 3 interpreter.
``Python3_EXECUTABLE``
Path to the Python 3 interpreter.
``Python3_INTERPRETER_ID``
A short string unique to the interpreter. Possible values include:
* Python
* ActivePython
* Anaconda
* Canopy
* IronPython
``Python3_STDLIB``
Standard platform independent installation directory.
Information returned by
``distutils.sysconfig.get_python_lib(plat_specific=False,standard_lib=True)``.
``Python3_STDARCH``
Standard platform dependent installation directory.
Information returned by
``distutils.sysconfig.get_python_lib(plat_specific=True,standard_lib=True)``.
``Python3_SITELIB``
Third-party platform independent installation directory.
Information returned by
``distutils.sysconfig.get_python_lib(plat_specific=False,standard_lib=False)``.
``Python3_SITEARCH``
Third-party platform dependent installation directory.
Information returned by
``distutils.sysconfig.get_python_lib(plat_specific=True,standard_lib=False)``.
``Python3_Compiler_FOUND``
System has the Python 3 compiler.
``Python3_COMPILER``
Path to the Python 3 compiler. Only offered by IronPython.
``Python3_COMPILER_ID``
A short string unique to the compiler. Possible values include:
* IronPython
``Python3_Development_FOUND``
System has the Python 3 development artifacts.
``Python3_INCLUDE_DIRS``
The Python 3 include directories.
``Python3_LIBRARIES``
The Python 3 libraries.
``Python3_LIBRARY_DIRS``
The Python 3 library directories.
``Python3_RUNTIME_LIBRARY_DIRS``
The Python 3 runtime library directories.
``Python3_VERSION``
Python 3 version.
``Python3_VERSION_MAJOR``
Python 3 major version.
``Python3_VERSION_MINOR``
Python 3 minor version.
``Python3_VERSION_PATCH``
Python 3 patch version.
``Python3_NumPy_FOUND``
System has the NumPy.
``Python3_NumPy_INCLUDE_DIRS``
The NumPy include directries.
``Python3_NumPy_VERSION``
The NumPy version.
Hints
^^^^^
``Python3_ROOT_DIR``
Define the root directory of a Python 3 installation.
``Python3_USE_STATIC_LIBS``
* If not defined, search for shared libraries and static libraries in that
order.
* If set to TRUE, search **only** for static libraries.
* If set to FALSE, search **only** for shared libraries.
``Python3_FIND_REGISTRY``
On Windows the ``Python3_FIND_REGISTRY`` variable determine the order
of preference between registry and environment variables.
the ``Python3_FIND_REGISTRY`` variable can be set to empty or one of the
following:
* ``FIRST``: Try to use registry before environment variables.
This is the default.
* ``LAST``: Try to use registry after environment variables.
* ``NEVER``: Never try to use registry.
``CMAKE_FIND_FRAMEWORK``
On OS X the :variable:`CMAKE_FIND_FRAMEWORK` variable determine the order of
preference between Apple-style and unix-style package components.
.. note::
Value ``ONLY`` is not supported so ``FIRST`` will be used instead.
.. note::
If a Python virtual environment is configured, set variable
``Python_FIND_REGISTRY`` (Windows) or ``CMAKE_FIND_FRAMEWORK`` (macOS) with
value ``LAST`` or ``NEVER`` to select it preferably.
Commands
^^^^^^^^
This module defines the command ``Python3_add_library`` (when
:prop_gbl:`CMAKE_ROLE` is ``PROJECT``), which has the same semantics as
:command:`add_library`, but takes care of Python module naming rules
(only applied if library is of type ``MODULE``), and adds a dependency to target
``Python3::Python``::
Python3_add_library (my_module MODULE src1.cpp)
If library type is not specified, ``MODULE`` is assumed.
#]=======================================================================]
set (_PYTHON_PREFIX Python3)
set (_Python3_REQUIRED_VERSION_MAJOR 3)
include (${CMAKE_CURRENT_LIST_DIR}/FindPython/Support.cmake)
if (COMMAND __Python3_add_library)
macro (Python3_add_library)
__Python3_add_library (Python3 ${ARGV})
endmacro()
endif()
unset (_PYTHON_PREFIX)
\ No newline at end of file
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#[=======================================================================[.rst:
SelectLibraryConfigurations
---------------------------
.. code-block:: cmake
select_library_configurations(basename)
This macro takes a library base name as an argument, and will choose
good values for the variables
::
basename_LIBRARY
basename_LIBRARIES
basename_LIBRARY_DEBUG
basename_LIBRARY_RELEASE
depending on what has been found and set.
If only ``basename_LIBRARY_RELEASE`` is defined, ``basename_LIBRARY`` will
be set to the release value, and ``basename_LIBRARY_DEBUG`` will be set
to ``basename_LIBRARY_DEBUG-NOTFOUND``. If only ``basename_LIBRARY_DEBUG``
is defined, then ``basename_LIBRARY`` will take the debug value, and
``basename_LIBRARY_RELEASE`` will be set to ``basename_LIBRARY_RELEASE-NOTFOUND``.
If the generator supports configuration types, then ``basename_LIBRARY``
and ``basename_LIBRARIES`` will be set with debug and optimized flags
specifying the library to be used for the given configuration. If no
build type has been set or the generator in use does not support
configuration types, then ``basename_LIBRARY`` and ``basename_LIBRARIES``
will take only the release value, or the debug value if the release one
is not set.
#]=======================================================================]
# This macro was adapted from the FindQt4 CMake module and is maintained by Will
# Dicharry <wdicharry@stellarscience.com>.
macro(select_library_configurations basename)
if(NOT ${basename}_LIBRARY_RELEASE)
set(${basename}_LIBRARY_RELEASE "${basename}_LIBRARY_RELEASE-NOTFOUND" CACHE FILEPATH "Path to a library.")
endif()
if(NOT ${basename}_LIBRARY_DEBUG)
set(${basename}_LIBRARY_DEBUG "${basename}_LIBRARY_DEBUG-NOTFOUND" CACHE FILEPATH "Path to a library.")
endif()
get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if( ${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE AND
NOT ${basename}_LIBRARY_DEBUG STREQUAL ${basename}_LIBRARY_RELEASE AND
( _isMultiConfig OR CMAKE_BUILD_TYPE ) )
# if the generator is multi-config or if CMAKE_BUILD_TYPE is set for
# single-config generators, set optimized and debug libraries
set( ${basename}_LIBRARY "" )
foreach( _libname IN LISTS ${basename}_LIBRARY_RELEASE )
list( APPEND ${basename}_LIBRARY optimized "${_libname}" )
endforeach()
foreach( _libname IN LISTS ${basename}_LIBRARY_DEBUG )
list( APPEND ${basename}_LIBRARY debug "${_libname}" )
endforeach()
elseif( ${basename}_LIBRARY_RELEASE )
set( ${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} )
elseif( ${basename}_LIBRARY_DEBUG )
set( ${basename}_LIBRARY ${${basename}_LIBRARY_DEBUG} )
else()
set( ${basename}_LIBRARY "${basename}_LIBRARY-NOTFOUND")
endif()
set( ${basename}_LIBRARIES "${${basename}_LIBRARY}" )
if( ${basename}_LIBRARY )
set( ${basename}_FOUND TRUE )
endif()
mark_as_advanced( ${basename}_LIBRARY_RELEASE
${basename}_LIBRARY_DEBUG
)
endmacro()
\ No newline at end of file
......@@ -3,6 +3,5 @@ find_package(Threads)
add_subdirectory(process_folder)
add_subdirectory(getnext_broker)
IF (UNIX)
add_subdirectory(getnext_broker_python)
ENDIF()
add_subdirectory(getnext_broker_python)
......@@ -3,8 +3,11 @@ set(TARGET_NAME getnext_broker_python)
prepare_asapo()
get_target_property(PYTHON_LIBS python-lib2 BINARY_DIR)
if (UNIX)
get_target_property(PYTHON_LIBS python-lib2 BINARY_DIR)
else()
get_target_property(PYTHON_LIBS asapo_worker BINARY_DIR)
endif()
add_script_test("${TARGET_NAME}" ${PYTHON_LIBS} nomem)
......
......@@ -12,8 +12,14 @@ ping 1.0.0.0 -n 10 -w 100 > nul
for /l %%x in (1, 1, 3) do echo db.data.insert({"_id":%%x,"size":100,"name":"%%x","lastchange":1,"source":"none","buf_id":0}) | %mongo_exe% %database_name% || goto :error
set PYTHONPATH=%1
python3 getnext.py 127.0.0.1:8400 %source_path% %database_name% %token_test_run% > out
type out
type out | findstr /c:"100" || goto :error
type out | findstr /c:"\"id_\": 1" || goto :error
"%1" 127.0.0.1:8400 %source_path% %database_name% 1 %token_test_run% 1000 1 | findstr /c:"Processed 3 file" || goto :error
goto :clean
:error
......
add_subdirectory(api/cpp)
IF (UNIX)
add_subdirectory(api/python)
ENDIF()
add_subdirectory(api/python)
if(BUILD_WORKER_TOOLS)
set (BUILD_MONGODB ON)
......
......@@ -3,37 +3,18 @@ get_property(ASAPO_WORKER_LIB TARGET asapo-worker PROPERTY LOCATION)
set (ASAPO_WORKER_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../cpp/include)
if ((CMAKE_BUILD_TYPE STREQUAL "Debug") AND (CMAKE_C_COMPILER_ID STREQUAL "GNU"))
set (EXTRA_COMPILE_ARGS "['--std=c++11']")
set (EXTRA_LINK_ARGS "['--coverage','-fprofile-arcs','-ftest-coverage','-static-libgcc','-static-libstdc++']")
ELSE()
set (EXTRA_COMPILE_ARGS "['--std=c++11']")
set (EXTRA_LINK_ARGS "['-static-libgcc','-static-libstdc++']")
ENDIF()
configure_files(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} @ONLY)
ADD_CUSTOM_TARGET(python-lib2 ALL
COMMAND python setup.py build_ext --inplace)
ADD_CUSTOM_TARGET(python-lib3 ALL
COMMAND python3 setup.py build_ext --inplace)
ADD_DEPENDENCIES(python-lib2 asapo-worker)
ADD_DEPENDENCIES(python-lib3 asapo-worker)
if (WIN32)
set (suf "dll")
ELSE()
if (UNIX)
include(CMakeLists_Linux.cmake)
set (suf "so")
ELSEIF(CMAKE_BUILD_TYPE STREQUAL "Release")
set (suf "pyd")
include(CMakeLists_Windows.cmake)
ENDIF()
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ DESTINATION lib/python/
FILES_MATCHING PATTERN "*.${suf}"
PATTERN "build" EXCLUDE
PATTERN "dist" EXCLUDE
PATTERN "source_dist_linux" EXCLUDE
PATTERN "CMakeFiles" EXCLUDE
)
add_subdirectory(dist)
\ No newline at end of file
if ((CMAKE_BUILD_TYPE STREQUAL "Debug") AND (CMAKE_C_COMPILER_ID STREQUAL "GNU"))
set (EXTRA_COMPILE_ARGS "['--std=c++11']")
set (EXTRA_LINK_ARGS "['--coverage','-fprofile-arcs','-ftest-coverage','-static-libgcc','-static-libstdc++']")
ELSE()
set (EXTRA_COMPILE_ARGS "['--std=c++11']")
set (EXTRA_LINK_ARGS "['-static-libgcc','-static-libstdc++']")
ENDIF()
configure_files(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} @ONLY)
ADD_CUSTOM_TARGET(python-lib2 ALL
COMMAND python setup.py build_ext --inplace)
ADD_CUSTOM_TARGET(python-lib3 ALL
COMMAND python3 setup.py build_ext --inplace)
ADD_DEPENDENCIES(python-lib2 asapo-worker)
ADD_DEPENDENCIES(python-lib3 asapo-worker)
add_subdirectory(source_dist_linux)
configure_files(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} @ONLY)
find_package (Python3 REQUIRED COMPONENTS Development)
find_package (Numpy REQUIRED)
message (" Python libaries:" ${Python3_LIBRARIES})
message (" Python includes:" ${Python3_INCLUDE_DIRS})
message (" Numpy:" ${PYTHON_NUMPY_INCLUDE_DIR})
add_custom_command(OUTPUT asapo_worker.cpp
COMMAND ${Python3_EXECUTABLE} cythonize.py
DEPENDS asapo-worker)
set(TARGET_NAME asapo_worker)
set(SOURCE_FILES
asapo_worker.cpp)
add_library(${TARGET_NAME} SHARED ${SOURCE_FILES})
set_target_properties(${TARGET_NAME} PROPERTIES SUFFIX ".pyd")
target_link_libraries(${TARGET_NAME} asapo-worker ${Python3_LIBRARIES})
target_include_directories(${TARGET_NAME} PUBLIC include ${Python3_INCLUDE_DIRS} ${PYTHON_NUMPY_INCLUDE_DIR})
add_subdirectory(binary_dist_windows)
#distutils: language=c++
cimport asapo_worker
import numpy as np
cimport numpy as np
......
configure_file(setup.py.in setup.py @ONLY)
ADD_CUSTOM_TARGET(windows-bdist ALL
COMMAND ${Python3_EXECUTABLE} setup.py bdist_wheel
)
ADD_CUSTOM_TARGET(copy_python_bdist ALL
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/asapo_worker
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/../asapo_worker.pyd ${CMAKE_CURRENT_BINARY_DIR}/asapo_worker/
)
ADD_DEPENDENCIES(copy_python_bdist asapo_worker)
ADD_DEPENDENCIES(windows-bdist copy_python_bdist)
import setuptools
setuptools.setup(
name ="asapo_worker",
version = "@ASAPO_VERSION@",
install_requires=['numpy'],
include_package_data=True,
packages=['asapo_worker'],
package_data={
'asapo_worker': ['asapo_worker.pyd'],
},
)
from Cython.Build import cythonize
cythonize(["asapo_worker.pyx"])
from distutils.core import setup
from distutils.core import Extension
import setuptools
from Cython.Build import cythonize
import numpy
......@@ -14,14 +14,6 @@ module = Extension("asapo_worker", ["asapo_worker.pyx"],
language="c++",
)
setup(ext_modules=cythonize("asapo_worker.pyx", extra_objects=['@ASAPO_WORKER_LIB@',
'@CURL_LIBRARIES@'],
include_dirs=["@ASAPO_CXX_COMMON_INCLUDE_DIR@","@ASAPO_WORKER_INCLUDE_DIR@",numpy.get_include()],
extra_compile_args=@EXTRA_COMPILE_ARGS@,
extra_link_args=@EXTRA_LINK_ARGS@,
language="c++",
build_dir="build"),
script_args=['build'],
options={'build':{'build_lib':'.'}})
ext_modules = cythonize([module])
setup(ext_modules = ext_modules)
......@@ -13,7 +13,7 @@ ext_modules = [
]
setup(
name ="asapo_worker_py",
name ="asapo_worker",
ext_modules = ext_modules,
version = "@ASAPO_VERSION@",
setup_requires=["numpy"],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment