diff --git a/src/aliceVision/CMakeLists.txt b/src/aliceVision/CMakeLists.txt index 6fddca66a7..7fcc52e1e8 100644 --- a/src/aliceVision/CMakeLists.txt +++ b/src/aliceVision/CMakeLists.txt @@ -85,20 +85,20 @@ endif() if(ALICEVISION_BUILD_SWIG_BINDING) set(UseSWIG_TARGET_NAME_PREFERENCE STANDARD) set_property(SOURCE aliceVision.i PROPERTY CPLUSPLUS ON) - set_property(SOURCE aliceVision.i PROPERTY SWIG_MODULE_NAME aliceVision) + set_property(SOURCE aliceVision.i PROPERTY SWIG_MODULE_NAME pyAliceVision) - swig_add_library(aliceVision + swig_add_library(pyAliceVision TYPE MODULE LANGUAGE python SOURCES aliceVision.i ) set_property( - TARGET aliceVision + TARGET pyAliceVision PROPERTY SWIG_COMPILE_OPTIONS -doxygen ) - target_include_directories(aliceVision + target_include_directories(pyAliceVision PRIVATE ../include ${ALICEVISION_ROOT}/include @@ -106,27 +106,28 @@ if(ALICEVISION_BUILD_SWIG_BINDING) ${Python3_NumPy_INCLUDE_DIRS} ) set_property( - TARGET aliceVision + TARGET pyAliceVision PROPERTY SWIG_USE_TARGET_INCLUDE_DIRECTORIES ON ) set_property( - TARGET aliceVision + TARGET pyAliceVision PROPERTY COMPILE_OPTIONS -std=c++17 ) - target_link_libraries(aliceVision + target_link_libraries(pyAliceVision PUBLIC aliceVision_numeric + ${Python3_LIBRARIES} ) install( TARGETS - aliceVision + pyAliceVision DESTINATION ${CMAKE_INSTALL_PREFIX} ) install( FILES - ${CMAKE_CURRENT_BINARY_DIR}/aliceVision.py + ${CMAKE_CURRENT_BINARY_DIR}/pyAliceVision.py DESTINATION ${CMAKE_INSTALL_PREFIX} ) diff --git a/src/aliceVision/camera/CMakeLists.txt b/src/aliceVision/camera/CMakeLists.txt index fa91af94be..024014f1a4 100644 --- a/src/aliceVision/camera/CMakeLists.txt +++ b/src/aliceVision/camera/CMakeLists.txt @@ -90,6 +90,7 @@ if (ALICEVISION_BUILD_SWIG_BINDING) target_link_libraries(camera PUBLIC aliceVision_camera + ${Python3_LIBRARIES} ) install( diff --git a/src/aliceVision/camera/Camera.i b/src/aliceVision/camera/Camera.i index 2ebe3fbb4c..7ce47e3458 100644 --- a/src/aliceVision/camera/Camera.i +++ b/src/aliceVision/camera/Camera.i @@ -4,7 +4,7 @@ // v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. -%module (module="aliceVision") camera +%module (module="pyAliceVision") camera %include diff --git a/src/aliceVision/global.i b/src/aliceVision/global.i index 31d3cf37f0..7c0452f0ba 100644 --- a/src/aliceVision/global.i +++ b/src/aliceVision/global.i @@ -23,7 +23,7 @@ %} %inline %{ - typedef long unsigned int size_t; + //typedef long unsigned int size_t; typedef uint32_t IndexT; %} @@ -37,7 +37,9 @@ %template(IndexTSet) std::set; -%template(SizeTPair) std::pair; +//%template(SizeTPair) std::pair; +%template(LongUintPair) std::pair; +%template(UintPair) std::pair; // As defined in aliceVision/types.hpp %template(Pair) std::pair; diff --git a/src/aliceVision/hdr/CMakeLists.txt b/src/aliceVision/hdr/CMakeLists.txt index c97d80a0ab..4870e32444 100644 --- a/src/aliceVision/hdr/CMakeLists.txt +++ b/src/aliceVision/hdr/CMakeLists.txt @@ -89,6 +89,7 @@ if (ALICEVISION_BUILD_SWIG_BINDING) aliceVision_numeric aliceVision_image aliceVision_sfmData + ${Python3_LIBRARIES} ) install( diff --git a/src/aliceVision/hdr/Hdr.i b/src/aliceVision/hdr/Hdr.i index d0405d1234..2acf8169a3 100644 --- a/src/aliceVision/hdr/Hdr.i +++ b/src/aliceVision/hdr/Hdr.i @@ -4,6 +4,6 @@ // v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. -%module (module="aliceVision") hdr +%module (module="pyAliceVision") hdr %include \ No newline at end of file diff --git a/src/aliceVision/sensorDB/CMakeLists.txt b/src/aliceVision/sensorDB/CMakeLists.txt index 07318334c8..6bc4906a39 100644 --- a/src/aliceVision/sensorDB/CMakeLists.txt +++ b/src/aliceVision/sensorDB/CMakeLists.txt @@ -63,6 +63,7 @@ if (ALICEVISION_BUILD_SWIG_BINDING) target_link_libraries(sensorDB PUBLIC aliceVision_sensorDB + ${Python3_LIBRARIES} ) install( diff --git a/src/aliceVision/sensorDB/SensorDB.i b/src/aliceVision/sensorDB/SensorDB.i index 32214c5a2e..110a1eebef 100644 --- a/src/aliceVision/sensorDB/SensorDB.i +++ b/src/aliceVision/sensorDB/SensorDB.i @@ -4,7 +4,7 @@ // v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. -%module (module="aliceVision") sensorDB +%module (module="pyAliceVision") sensorDB %include diff --git a/src/aliceVision/sfmData/CMakeLists.txt b/src/aliceVision/sfmData/CMakeLists.txt index 8815dad4cf..96eef53c44 100644 --- a/src/aliceVision/sfmData/CMakeLists.txt +++ b/src/aliceVision/sfmData/CMakeLists.txt @@ -88,6 +88,7 @@ if (ALICEVISION_BUILD_SWIG_BINDING) PUBLIC aliceVision_sfmData aliceVision_camera + ${Python3_LIBRARIES} ) install( diff --git a/src/aliceVision/sfmData/SfMData.i b/src/aliceVision/sfmData/SfMData.i index e36c5fd6bf..e372212d37 100644 --- a/src/aliceVision/sfmData/SfMData.i +++ b/src/aliceVision/sfmData/SfMData.i @@ -4,7 +4,7 @@ // v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. -%module (module="aliceVision") sfmData +%module (module="pyAliceVision") sfmData %include %include diff --git a/src/aliceVision/sfmDataIO/CMakeLists.txt b/src/aliceVision/sfmDataIO/CMakeLists.txt index b0059d23e6..e1af671f11 100644 --- a/src/aliceVision/sfmDataIO/CMakeLists.txt +++ b/src/aliceVision/sfmDataIO/CMakeLists.txt @@ -131,6 +131,7 @@ if (ALICEVISION_BUILD_SWIG_BINDING) target_link_libraries(sfmDataIO PUBLIC aliceVision_sfmDataIO + ${Python3_LIBRARIES} ) install( diff --git a/src/aliceVision/sfmDataIO/SfMDataIO.i b/src/aliceVision/sfmDataIO/SfMDataIO.i index d14d5a49ae..d41d7a9269 100644 --- a/src/aliceVision/sfmDataIO/SfMDataIO.i +++ b/src/aliceVision/sfmDataIO/SfMDataIO.i @@ -4,7 +4,7 @@ // v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. -%module (module="aliceVision") sfmDataIO +%module (module="pyAliceVision") sfmDataIO %include %include