pptk-revived 0.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. pptk_revived-0.1.1/CMakeLists.txt +58 -0
  2. pptk_revived-0.1.1/LICENSE +22 -0
  3. pptk_revived-0.1.1/MANIFEST.in +11 -0
  4. pptk_revived-0.1.1/PKG-INFO +15 -0
  5. pptk_revived-0.1.1/README.md +138 -0
  6. pptk_revived-0.1.1/cmake/CopyAppleDependencies.cmake +41 -0
  7. pptk_revived-0.1.1/cmake/CopyLinuxDependencies.cmake +26 -0
  8. pptk_revived-0.1.1/cmake/CopyWindowsDependencies.cmake +19 -0
  9. pptk_revived-0.1.1/cmake/FindEigen.cmake +6 -0
  10. pptk_revived-0.1.1/cmake/FindNumpy.cmake +11 -0
  11. pptk_revived-0.1.1/cmake/FindTBB.cmake +28 -0
  12. pptk_revived-0.1.1/cmake/UsefulMacros.cmake +91 -0
  13. pptk_revived-0.1.1/licenses/CMakeLists.txt +32 -0
  14. pptk_revived-0.1.1/licenses/COPYING.apache2.txt +206 -0
  15. pptk_revived-0.1.1/licenses/COPYING.gcc_rle31.txt +77 -0
  16. pptk_revived-0.1.1/licenses/COPYING.gpl3.txt +679 -0
  17. pptk_revived-0.1.1/licenses/COPYING.lgpl3.txt +170 -0
  18. pptk_revived-0.1.1/licenses/LICENSE.linux.txt +33 -0
  19. pptk_revived-0.1.1/licenses/LICENSE.mac.txt +31 -0
  20. pptk_revived-0.1.1/licenses/LICENSE.win.txt +31 -0
  21. pptk_revived-0.1.1/pptk/CMakeLists.txt +8 -0
  22. pptk_revived-0.1.1/pptk/LICENSE +22 -0
  23. pptk_revived-0.1.1/pptk/__init__.py +11 -0
  24. pptk_revived-0.1.1/pptk/_add_path.py +23 -0
  25. pptk_revived-0.1.1/pptk/colors.py +43 -0
  26. pptk_revived-0.1.1/pptk/dimreduce.py +38 -0
  27. pptk_revived-0.1.1/pptk/include/pptk_dll_export.h +14 -0
  28. pptk_revived-0.1.1/pptk/include/progress_bar.h +50 -0
  29. pptk_revived-0.1.1/pptk/include/python_util.h +612 -0
  30. pptk_revived-0.1.1/pptk/include/timer.h +33 -0
  31. pptk_revived-0.1.1/pptk/kdtree/CMakeLists.txt +37 -0
  32. pptk_revived-0.1.1/pptk/kdtree/__init__.py +0 -0
  33. pptk_revived-0.1.1/pptk/kdtree/kdtree_wrapper.cpp +444 -0
  34. pptk_revived-0.1.1/pptk/kdtree/src/accumulator.h +30 -0
  35. pptk_revived-0.1.1/pptk/kdtree/src/box.h +248 -0
  36. pptk_revived-0.1.1/pptk/kdtree/src/kdtree-impl.h +1026 -0
  37. pptk_revived-0.1.1/pptk/kdtree/src/kdtree.h +254 -0
  38. pptk_revived-0.1.1/pptk/kdtree/src/node.h +40 -0
  39. pptk_revived-0.1.1/pptk/kdtree/src/small_node.h +59 -0
  40. pptk_revived-0.1.1/pptk/libs/CMakeLists.txt +58 -0
  41. pptk_revived-0.1.1/pptk/libs/qt_plugins/CMakeLists.txt +2 -0
  42. pptk_revived-0.1.1/pptk/libs/qt_plugins/platforms/CMakeLists.txt +7 -0
  43. pptk_revived-0.1.1/pptk/libs/qt_plugins/xcbglintegrations/CMakeLists.txt +6 -0
  44. pptk_revived-0.1.1/pptk/points/CMakeLists.txt +3 -0
  45. pptk_revived-0.1.1/pptk/points/__init__.py +0 -0
  46. pptk_revived-0.1.1/pptk/points/expr.py +424 -0
  47. pptk_revived-0.1.1/pptk/points/points.py +263 -0
  48. pptk_revived-0.1.1/pptk/processing/CMakeLists.txt +2 -0
  49. pptk_revived-0.1.1/pptk/processing/__init__.py +0 -0
  50. pptk_revived-0.1.1/pptk/processing/estimate_normals/CMakeLists.txt +42 -0
  51. pptk_revived-0.1.1/pptk/processing/estimate_normals/__init__.py +0 -0
  52. pptk_revived-0.1.1/pptk/processing/estimate_normals/estimate_normals.cpp +376 -0
  53. pptk_revived-0.1.1/pptk/projection.py +28 -0
  54. pptk_revived-0.1.1/pptk/vfuncs/CMakeLists.txt +31 -0
  55. pptk_revived-0.1.1/pptk/vfuncs/__init__.py +0 -0
  56. pptk_revived-0.1.1/pptk/vfuncs/vfuncs.cpp +1370 -0
  57. pptk_revived-0.1.1/pptk/viewer/CMakeLists.txt +38 -0
  58. pptk_revived-0.1.1/pptk/viewer/__init__.py +0 -0
  59. pptk_revived-0.1.1/pptk/viewer/background.h +98 -0
  60. pptk_revived-0.1.1/pptk/viewer/box3.h +108 -0
  61. pptk_revived-0.1.1/pptk/viewer/camera.h +211 -0
  62. pptk_revived-0.1.1/pptk/viewer/camera_dolly.h +255 -0
  63. pptk_revived-0.1.1/pptk/viewer/comm_funcs.h +158 -0
  64. pptk_revived-0.1.1/pptk/viewer/floor_grid.h +535 -0
  65. pptk_revived-0.1.1/pptk/viewer/look_at.h +101 -0
  66. pptk_revived-0.1.1/pptk/viewer/main.cpp +19 -0
  67. pptk_revived-0.1.1/pptk/viewer/octree.h +875 -0
  68. pptk_revived-0.1.1/pptk/viewer/opengl_funcs.h +80 -0
  69. pptk_revived-0.1.1/pptk/viewer/point_attributes.h +263 -0
  70. pptk_revived-0.1.1/pptk/viewer/point_cloud.h +694 -0
  71. pptk_revived-0.1.1/pptk/viewer/qt.conf +2 -0
  72. pptk_revived-0.1.1/pptk/viewer/qt_camera.h +177 -0
  73. pptk_revived-0.1.1/pptk/viewer/selection_box.h +114 -0
  74. pptk_revived-0.1.1/pptk/viewer/splines.h +227 -0
  75. pptk_revived-0.1.1/pptk/viewer/text.h +222 -0
  76. pptk_revived-0.1.1/pptk/viewer/timer.h +35 -0
  77. pptk_revived-0.1.1/pptk/viewer/viewer.h +938 -0
  78. pptk_revived-0.1.1/pptk/viewer/viewer.py +749 -0
  79. pptk_revived-0.1.1/pptk_revived/__init__.py +2 -0
  80. pptk_revived-0.1.1/pptk_revived.egg-info/PKG-INFO +15 -0
  81. pptk_revived-0.1.1/pptk_revived.egg-info/SOURCES.txt +96 -0
  82. pptk_revived-0.1.1/pptk_revived.egg-info/dependency_links.txt +1 -0
  83. pptk_revived-0.1.1/pptk_revived.egg-info/requires.txt +3 -0
  84. pptk_revived-0.1.1/pptk_revived.egg-info/top_level.txt +2 -0
  85. pptk_revived-0.1.1/pyproject.toml +29 -0
  86. pptk_revived-0.1.1/setup.cfg +4 -0
  87. pptk_revived-0.1.1/setup.py +200 -0
  88. pptk_revived-0.1.1/tests/test_animate.py +39 -0
  89. pptk_revived-0.1.1/tests/test_append.py +42 -0
  90. pptk_revived-0.1.1/tests/test_build.py +218 -0
  91. pptk_revived-0.1.1/tests/test_estimate_normals.py +186 -0
  92. pptk_revived-0.1.1/tests/test_expr.py +16 -0
  93. pptk_revived-0.1.1/tests/test_label_colors.py +79 -0
  94. pptk_revived-0.1.1/tests/test_points.py +324 -0
  95. pptk_revived-0.1.1/tests/test_projection.py +30 -0
  96. pptk_revived-0.1.1/tests/test_reduce_dims.py +29 -0
  97. pptk_revived-0.1.1/tests/test_uv_compat.py +20 -0
  98. pptk_revived-0.1.1/tests/test_vfuncs.py +499 -0
@@ -0,0 +1,58 @@
1
+ cmake_minimum_required(VERSION 3.1)
2
+ project(pptk)
3
+
4
+ set(CMAKE_BUILD_TYPE Release)
5
+ set(CMAKE_MODULE_PATH
6
+ "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_CURRENT_SOURCE_DIR})
7
+
8
+ find_package(Python3 REQUIRED COMPONENTS Interpreter Development)
9
+ set(PYTHON_INCLUDE_DIR ${Python3_INCLUDE_DIRS})
10
+ set(PYTHON_LIBRARY ${Python3_LIBRARIES})
11
+ find_package(OpenGL REQUIRED)
12
+ find_package(Numpy REQUIRED)
13
+ find_package(TBB REQUIRED)
14
+ find_package(Eigen REQUIRED)
15
+ find_package(Qt5 CONFIG REQUIRED COMPONENTS Widgets Network OpenGL Core)
16
+ find_package(OpenMP)
17
+
18
+ # get root Qt5 folder (i.e. contains bin, lib, plugins, etc.)
19
+ get_target_property(Qt5_DIR Qt5::qmake LOCATION)
20
+ get_filename_component(Qt5_DIR ${Qt5_DIR} DIRECTORY)
21
+ get_filename_component(Qt5_DIR ${Qt5_DIR} DIRECTORY)
22
+ set(Qt5_PLUGINS_DIR ${Qt5_DIR}/plugins)
23
+
24
+ # localize all dependencies (.dll, .so, or .dylib) in the following folder
25
+ set(PPTK_LIBS_DIR ${PROJECT_BINARY_DIR}/pptk/libs)
26
+
27
+ # use the following variable to store a list of .dll paths required by targets
28
+ # built in pptk; this is useful only for building on Windows platform
29
+ get_filename_component(TBB_RUNTIME_DIR ${TBB_tbb_RUNTIME} DIRECTORY)
30
+ set(PPTK_DLL_DIRS
31
+ ${TBB_RUNTIME_DIR}
32
+ ${Qt5_DIR}/bin
33
+ CACHE INTERNAL "Additional folder paths for finding .dll's")
34
+
35
+ # use patchelf to modify binary RPATH when building pptk on Linux
36
+ if(UNIX AND NOT APPLE)
37
+ find_program(PPTK_PATCHELF patchelf)
38
+ if (NOT PPTK_PATCHELF)
39
+ message(FATAL_ERROR
40
+ "patchelf needed for localizing library dependencies; \
41
+ please manually set the PPTK_PATCHELF variable.")
42
+ endif()
43
+ endif()
44
+
45
+ # adds -std=gnu++11 flag when compiling with gcc
46
+ set(CMAKE_CXX_STANDARD 11)
47
+
48
+ include(UsefulMacros)
49
+
50
+ # following lines specifies the CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS variable
51
+ set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE)
52
+ set(CMAKE_INSTALL_OPENMP_LIBRARIES TRUE) # requires cmake 3.1
53
+ include(InstallRequiredSystemLibraries)
54
+
55
+ copy_file(setup.py)
56
+ copy_file(LICENSE)
57
+ add_subdirectory(pptk)
58
+ add_subdirectory(licenses)
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (C) 2011-2017 HERE Europe B.V.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
@@ -0,0 +1,11 @@
1
+ # Include CMake build system files so that `uv build` / `pip wheel` can
2
+ # compile C++ extensions from the source distribution (sdist).
3
+
4
+ include CMakeLists.txt
5
+ recursive-include cmake *.cmake
6
+ recursive-include pptk CMakeLists.txt *.cmake *.cpp *.h *.cu
7
+ # Pre-compiled artifacts — included when present so the sdist-to-wheel build
8
+ # can skip cmake. setuptools silently ignores missing files in MANIFEST.in.
9
+ recursive-include pptk *.so *.so.* *.pyd *.dylib
10
+ include pptk/viewer/viewer
11
+ recursive-include licenses *
@@ -0,0 +1,15 @@
1
+ Metadata-Version: 2.4
2
+ Name: pptk-revived
3
+ Version: 0.1.1
4
+ Summary: A Python package for facilitating point cloud processing.
5
+ Author: Nikolaas Steenbergen
6
+ License-Expression: MIT
7
+ Project-URL: Source, https://github.com/nikste/pptk_revived
8
+ Classifier: Intended Audience :: Science/Research
9
+ Classifier: Topic :: Scientific/Engineering
10
+ Requires-Python: >=3.9
11
+ License-File: LICENSE
12
+ Requires-Dist: numpy<2
13
+ Requires-Dist: pillow
14
+ Requires-Dist: scikit-learn
15
+ Dynamic: license-file
@@ -0,0 +1,138 @@
1
+ # pptk-revived - Point Processing Toolkit
2
+
3
+ This is a fork of [heremaps/pptk](https://github.com/heremaps/pptk) maintained by [Nikolaas Steenbergen](https://github.com/nikste), updated to build and run on modern Python (3.12+) and CMake (3.28+).
4
+
5
+ Source: https://github.com/nikste/pptk_revived
6
+
7
+ Copyright (C) 2011-2018 HERE Europe B.V.
8
+
9
+ The Point Processing Toolkit (pptk) is a Python package for visualizing and processing 2-d/3-d point clouds.
10
+
11
+ At present, pptk consists of the following features.
12
+
13
+ * A 3-d point cloud viewer that
14
+ - accepts any 3-column numpy array as input,
15
+ - renders tens of millions of points interactively using an octree-based level of detail mechanism,
16
+ - supports point selection for inspecting and annotating point data.
17
+ * A fully parallelized point k-d tree that supports k-nearest neighbor queries and r-near range queries
18
+ (both build and queries have been parallelized).
19
+ * A normal estimation routine based on principal component analysis of point cloud neighborhoods.
20
+
21
+ [Homepage](https://heremaps.github.io/pptk/index.html)
22
+
23
+ ![pptk screenshots](/docs/source/tutorials/viewer/images/tutorial_banner.png)
24
+
25
+ The screenshots above show various point datasets visualized using pptk.
26
+ The `bildstein1` Lidar point cloud from Semantic3D (left),
27
+ Beijing GPS trajectories from Geolife (middle left),
28
+ `DistrictofColumbia.geojson` 2-d polygons from US building footprints (middle right),
29
+ and a Mobius strip (right).
30
+ For details, see the [tutorials](https://heremaps.github.io/pptk/tutorial.html).
31
+
32
+ ## License
33
+
34
+ Unless otherwise noted in `LICENSE` files for specific files or directories,
35
+ the [LICENSE](LICENSE) in the root applies to all content in this repository.
36
+
37
+ ## Install
38
+
39
+ Install from PyPI:
40
+
41
+ ```
42
+ pip install pptk-revived
43
+ ```
44
+
45
+ or from a locally built wheel (see [Build](#build)):
46
+
47
+ ```
48
+ pip install <.whl file>
49
+ ```
50
+
51
+ ## Quickstart
52
+
53
+ Both `import pptk` and `import pptk_revived` work and are identical:
54
+
55
+ ```python
56
+ import numpy as np
57
+ import pptk # or: import pptk_revived
58
+
59
+ x = np.random.rand(100, 3)
60
+ v = pptk.viewer(x)
61
+ ```
62
+
63
+ Set point size to 0.01.
64
+
65
+ ```python
66
+ v.set(point_size=0.01)
67
+ ```
68
+
69
+ For more advanced examples, see [tutorials](https://heremaps.github.io/pptk/tutorial.html).
70
+
71
+ ## Build
72
+
73
+ pptk-revived contains C++ extensions (Qt viewer, k-d tree, normal estimator)
74
+ that must be compiled before packaging. The build process is:
75
+
76
+ 1. Compile C++ extensions with CMake
77
+ 2. Package the compiled artifacts into a wheel
78
+
79
+ ### System requirements
80
+
81
+ * [Python](https://www.python.org/) 3.9+
82
+ * [Qt5](https://www.qt.io/)
83
+ * [TBB](https://github.com/oneapi-src/oneTBB) (libtbb-dev)
84
+ * [Eigen](http://eigen.tuxfamily.org) 3.x (libeigen3-dev)
85
+ * [Numpy](http://www.numpy.org/)
86
+ * CMake 3.5+
87
+ * patchelf (Linux only)
88
+
89
+ On Ubuntu/Debian:
90
+
91
+ ```bash
92
+ sudo apt install build-essential cmake patchelf libtbb-dev libeigen3-dev qtbase5-dev libqt5opengl5-dev
93
+ ```
94
+
95
+ ### Build with uv (recommended)
96
+
97
+ ```bash
98
+ # 1. Compile C++ extensions
99
+ mkdir _cmake_build && cd _cmake_build
100
+ cmake .. -DCMAKE_BUILD_TYPE=Release
101
+ cmake --build . -- -j$(nproc)
102
+ cd ..
103
+
104
+ # 2. Package into a wheel (uv detects the pre-compiled .so files and skips cmake)
105
+ uv build
106
+
107
+ # 3. Install the wheel
108
+ uv pip install dist/pptk_revived-*.whl
109
+ ```
110
+
111
+ ### Build with pip / venv
112
+
113
+ ```bash
114
+ # 1. Create a venv
115
+ python3 -m venv venv && source venv/bin/activate
116
+ pip install numpy
117
+
118
+ # 2. Compile C++ extensions
119
+ mkdir _cmake_build && cd _cmake_build
120
+ cmake .. -DCMAKE_BUILD_TYPE=Release -DPython3_EXECUTABLE=$(which python)
121
+ cmake --build . -- -j$(nproc)
122
+ cd ..
123
+
124
+ # 3. Package and install
125
+ python setup.py bdist_wheel
126
+ pip install dist/pptk_revived-*.whl --force-reinstall
127
+ ```
128
+
129
+ ### Windows
130
+
131
+ ```bat
132
+ mkdir _cmake_build && cd _cmake_build
133
+ cmake -G "NMake Makefiles" ..
134
+ nmake
135
+ cd ..
136
+ python setup.py bdist_wheel
137
+ pip install dist\pptk_revived-*.whl
138
+ ```
@@ -0,0 +1,41 @@
1
+ # usage: cmake -P CopyAppleDependencies.cmake
2
+ # <target file path> <copy folder path>
3
+ # paths assumed to be existing full paths
4
+
5
+ include(BundleUtilities)
6
+
7
+ find_program(_install_name_tool "install_name_tool")
8
+ set(_target ${CMAKE_ARGV3})
9
+ set(_copy_folder ${CMAKE_ARGV4})
10
+ set(_paths "/usr/bin")
11
+ get_item_rpaths(${_target} _rpaths)
12
+ get_prerequisites(${_target} _prereqs 1 1 "" "${_paths}" "${_rpaths}")
13
+
14
+ # delete existing rpaths in _target and
15
+ # add relative path to _copy_folder as new rpath
16
+ foreach(p ${_rpaths})
17
+ execute_process(COMMAND ${_install_name_tool} -delete_rpath ${p} ${_target})
18
+ endforeach()
19
+ get_filename_component(_target_folder ${_target} DIRECTORY)
20
+ file(RELATIVE_PATH _new_rpath ${_target_folder} ${_copy_folder})
21
+ execute_process(COMMAND
22
+ ${_install_name_tool} -add_rpath "@loader_path/${_new_rpath}" ${_target})
23
+
24
+ # copy _target's dependencies to _copy_folder
25
+ foreach(p ${_prereqs})
26
+ get_filename_component(y ${p} NAME)
27
+ set(dst ${_copy_folder}/${y})
28
+ gp_resolve_item(${_target} ${p} "" "${_paths}" src "${_rpaths}")
29
+ execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst})
30
+ execute_process(COMMAND ${_install_name_tool} -id @rpath/${y} ${dst})
31
+ if (IS_ABSOLUTE ${p})
32
+ execute_process(COMMAND ${_install_name_tool} -change ${p} @rpath/${y} ${_target})
33
+ endif()
34
+ get_prerequisites(${dst} _prereqs_of_prereqs 1 0 "" "")
35
+ foreach (pp ${_prereqs_of_prereqs})
36
+ get_filename_component(yy ${pp} NAME)
37
+ if (IS_ABSOLUTE ${pp})
38
+ execute_process(COMMAND ${_install_name_tool} -change ${pp} @rpath/${yy} ${dst})
39
+ endif()
40
+ endforeach()
41
+ endforeach()
@@ -0,0 +1,26 @@
1
+ # usage: cmake -P CopyLinuxDependencies.cmake
2
+ # <target file (orig)> <target file (copy)> <libs folder> <patchelf path>
3
+ # assumes full existing paths
4
+
5
+ include(GetPrerequisites)
6
+
7
+ set(_target_file_orig ${CMAKE_ARGV3})
8
+ set(_target_file_copy ${CMAKE_ARGV4})
9
+ set(_libs_folder ${CMAKE_ARGV5})
10
+ set(_patchelf_cmd ${CMAKE_ARGV6})
11
+
12
+ get_prerequisites(${_target_file_orig} _prereqs 1 1 "" "")
13
+ foreach(p ${_prereqs})
14
+ gp_resolve_item("" ${p} "" "" src)
15
+ get_filename_component(x ${src} NAME)
16
+ set(dst ${_libs_folder}/${x})
17
+ execute_process(COMMAND
18
+ ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst})
19
+ execute_process(COMMAND
20
+ ${_patchelf_cmd} --set-rpath \$ORIGIN ${dst})
21
+ endforeach()
22
+
23
+ get_filename_component(y ${_target_file_copy} DIRECTORY)
24
+ file(RELATIVE_PATH _libs_folder_r ${y} ${_libs_folder})
25
+ execute_process(COMMAND
26
+ ${_patchelf_cmd} --set-rpath \$ORIGIN/${_libs_folder_r} ${_target_file_copy})
@@ -0,0 +1,19 @@
1
+ # usage: cmake -P CopyWindowsDependencies.cmake
2
+ # <target file path> <copy folder path> <.dll folder paths>
3
+ # assumes full existing paths
4
+ # .dll folder paths are semicolon-separated
5
+
6
+ include(GetPrerequisites)
7
+
8
+ set(_target_file ${CMAKE_ARGV3})
9
+ set(_copy_folder ${CMAKE_ARGV4})
10
+ set(_dll_paths ${CMAKE_ARGV5})
11
+ get_prerequisites(${_target_file} _prereqs 1 1 "" "${_dll_paths}")
12
+ foreach(p ${_prereqs})
13
+ if(NOT (p MATCHES "python[0-9]*.dll"))
14
+ gp_resolve_item("" ${p} "" "${_dll_paths}" src)
15
+ set(dst ${_copy_folder})
16
+ execute_process(COMMAND
17
+ ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst})
18
+ endif()
19
+ endforeach()
@@ -0,0 +1,6 @@
1
+ include(FindPackageHandleStandardArgs)
2
+
3
+ find_path(Eigen_INCLUDE_DIR Eigen/Core
4
+ PATHS /usr/include/eigen3 /usr/local/include/eigen3 /usr/include /usr/local/include)
5
+
6
+ find_package_handle_standard_args(Eigen REQUIRED_VARS Eigen_INCLUDE_DIR)
@@ -0,0 +1,11 @@
1
+ include(FindPackageHandleStandardArgs)
2
+
3
+ if(NOT Numpy_INCLUDE_DIR)
4
+ execute_process(
5
+ COMMAND ${Python3_EXECUTABLE} -c "import numpy; print(numpy.get_include())"
6
+ OUTPUT_VARIABLE Numpy_INCLUDE_DIR
7
+ OUTPUT_STRIP_TRAILING_WHITESPACE
8
+ ERROR_QUIET)
9
+ endif()
10
+
11
+ find_package_handle_standard_args(Numpy REQUIRED_VARS Numpy_INCLUDE_DIR)
@@ -0,0 +1,28 @@
1
+ include(FindPackageHandleStandardArgs)
2
+
3
+ find_path(TBB_INCLUDE_DIR tbb/tbb.h
4
+ PATHS /usr/include /usr/local/include)
5
+
6
+ find_library(TBB_tbb_LIBRARY tbb
7
+ PATHS /usr/lib /usr/local/lib /usr/lib/x86_64-linux-gnu)
8
+
9
+ find_library(TBB_tbbmalloc_LIBRARY tbbmalloc
10
+ PATHS /usr/lib /usr/local/lib /usr/lib/x86_64-linux-gnu)
11
+
12
+ # On Linux/Mac the runtime library is the same as the link library
13
+ if(WIN32)
14
+ find_file(TBB_tbb_RUNTIME tbb.dll)
15
+ find_file(TBB_tbbmalloc_RUNTIME tbbmalloc.dll)
16
+ else()
17
+ set(TBB_tbb_RUNTIME ${TBB_tbb_LIBRARY} CACHE FILEPATH "Path to tbb runtime library")
18
+ set(TBB_tbbmalloc_RUNTIME ${TBB_tbbmalloc_LIBRARY} CACHE FILEPATH "Path to tbbmalloc runtime library")
19
+ endif()
20
+
21
+ find_package_handle_standard_args(TBB
22
+ REQUIRED_VARS
23
+ TBB_INCLUDE_DIR
24
+ TBB_tbb_LIBRARY
25
+ TBB_tbbmalloc_LIBRARY
26
+ TBB_tbb_RUNTIME
27
+ TBB_tbbmalloc_RUNTIME
28
+ )
@@ -0,0 +1,91 @@
1
+
2
+ macro(set_target_python_module_name target)
3
+ set_target_properties(${target} PROPERTIES PREFIX "")
4
+ if (WIN32)
5
+ set_target_properties(${target} PROPERTIES SUFFIX ".pyd")
6
+ elseif(APPLE)
7
+ set_target_properties(${target} PROPERTIES SUFFIX ".so")
8
+ endif (WIN32)
9
+ endmacro()
10
+
11
+ macro(set_target_rpath target path)
12
+ if (APPLE)
13
+ set_target_properties(${target} PROPERTIES INSTALL_RPATH "@loader_path/${path}" BUILD_WITH_INSTALL_RPATH TRUE)
14
+ elseif (UNIX)
15
+ set_target_properties(${target} PROPERTIES INSTALL_RPATH "$ORIGIN/${path}" BUILD_WITH_INSTALL_RPATH TRUE)
16
+ endif(APPLE)
17
+ endmacro()
18
+
19
+ macro(copy_target x)
20
+ set(src $<TARGET_FILE:${x}>)
21
+ set(dst ${CMAKE_CURRENT_BINARY_DIR})
22
+ add_custom_command(
23
+ TARGET ${x}
24
+ POST_BUILD
25
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
26
+ COMMENT "Copying ${src} to ${dst}")
27
+ unset(src)
28
+ unset(dst)
29
+ endmacro()
30
+
31
+ function(copy_target_dependencies x)
32
+ if(ARGC GREATER 1)
33
+ set(_target_file ${ARGV1})
34
+ get_filename_component(_target_file_name ${_target_file} NAME)
35
+ else()
36
+ set(_target_file $<TARGET_FILE:${x}>)
37
+ set(_target_file_name $<TARGET_FILE_NAME:${x}>)
38
+ endif()
39
+ if(WIN32)
40
+ add_custom_command(TARGET ${x} POST_BUILD
41
+ COMMAND ${CMAKE_COMMAND} -P
42
+ ${PROJECT_SOURCE_DIR}/cmake/CopyWindowsDependencies.cmake
43
+ ${CMAKE_CURRENT_BINARY_DIR}/${_target_file_name}
44
+ ${PPTK_LIBS_DIR} "${PPTK_DLL_DIRS}")
45
+ elseif(APPLE)
46
+ add_custom_command(TARGET ${x} POST_BUILD
47
+ COMMAND ${CMAKE_COMMAND} -P
48
+ ${PROJECT_SOURCE_DIR}/cmake/CopyAppleDependencies.cmake
49
+ ${CMAKE_CURRENT_BINARY_DIR}/${_target_file_name} ${PPTK_LIBS_DIR})
50
+ elseif(UNIX)
51
+ add_custom_command(TARGET ${x} POST_BUILD
52
+ COMMAND ${CMAKE_COMMAND} -P
53
+ ${PROJECT_SOURCE_DIR}/cmake/CopyLinuxDependencies.cmake
54
+ ${_target_file}
55
+ ${CMAKE_CURRENT_BINARY_DIR}/${_target_file_name}
56
+ ${PPTK_LIBS_DIR} ${PPTK_PATCHELF})
57
+ endif()
58
+ endfunction()
59
+
60
+ macro(current_source_dir x)
61
+ string(CONCAT ${x} "^" ${PROJECT_SOURCE_DIR} "/?")
62
+ string(REGEX REPLACE ${${x}} "" ${x} ${CMAKE_CURRENT_SOURCE_DIR})
63
+ endmacro()
64
+
65
+ function(copy_file x)
66
+ # x should be a file path, and should not be a variable
67
+ # i.e. copy_file(${var}), not copy_file(var)
68
+ get_filename_component(name ${x} NAME)
69
+ file(RELATIVE_PATH temp ${PROJECT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
70
+ if (NOT (temp STREQUAL ""))
71
+ string(REGEX REPLACE "(/|\\\\)" "." temp "${temp}")
72
+ string(CONCAT name "${temp}" "." "${name}")
73
+ endif()
74
+ if (ARGC EQUAL 2)
75
+ set(${ARGV1} ${name} PARENT_SCOPE)
76
+ endif()
77
+ if (NOT IS_ABSOLUTE ${x})
78
+ set(src ${CMAKE_CURRENT_SOURCE_DIR}/${x})
79
+ else()
80
+ set(src ${x})
81
+ endif()
82
+ set(dst ${CMAKE_CURRENT_BINARY_DIR})
83
+ add_custom_target(${name} ALL
84
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
85
+ COMMENT "Copying ${src} to ${dst}")
86
+ endfunction()
87
+
88
+ function(copy_file_with_dependencies x)
89
+ copy_file(${x} _target_name)
90
+ copy_target_dependencies(${_target_name} ${x})
91
+ endfunction()
@@ -0,0 +1,32 @@
1
+
2
+ macro(remove_header x)
3
+ string(REGEX REPLACE "^[^-]+" "" ${x} "${${x}}")
4
+ endmacro(remove_header)
5
+
6
+ macro(read_text x y)
7
+ file(READ ${x} ${y})
8
+ remove_header(${y})
9
+ endmacro(read_text)
10
+
11
+ macro(append_text x y)
12
+ # reads text in file specified by x, removes header from text,
13
+ # and then appends results to y
14
+ # assumes x is a file
15
+ read_text(${x} temp)
16
+ string(CONCAT ${y} "${${y}}" "${temp}")
17
+ endmacro(append_text)
18
+
19
+ if(WIN32)
20
+ read_text(LICENSE.win.txt added_text)
21
+ elseif(APPLE)
22
+ read_text(LICENSE.mac.txt added_text)
23
+ append_text(COPYING.gcc_rle31.txt added_text)
24
+ elseif(UNIX)
25
+ read_text(LICENSE.linux.txt added_text)
26
+ endif()
27
+
28
+ append_text(COPYING.lgpl3.txt added_text)
29
+ append_text(COPYING.gpl3.txt added_text)
30
+ append_text(COPYING.apache2.txt added_text)
31
+
32
+ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/LICENSE.append.txt "${added_text}")