Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[build] SwigBinding: Add support for the Python binding with SWIG on Windows #1661

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/aliceVision/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,13 @@ if(ALICEVISION_BUILD_SWIG_BINDING)
SOURCES aliceVision.i
)

if (CMAKE_SYSTEM_NAME MATCHES "Linux")
list(APPEND SWIG_EXTRA_COMPILE_OPTIONS "-DSWIGWORDSIZE64")
endif()

set_property(
TARGET pyalicevision
PROPERTY SWIG_COMPILE_OPTIONS -doxygen
PROPERTY SWIG_COMPILE_OPTIONS -doxygen ${SWIG_EXTRA_COMPILE_OPTIONS}
)

target_include_directories(pyalicevision
Expand All @@ -117,10 +121,12 @@ if(ALICEVISION_BUILD_SWIG_BINDING)
target_link_libraries(pyalicevision
PUBLIC
aliceVision_numeric
${Python3_LIBRARIES}
)
install(
TARGETS
pyalicevision

DESTINATION
${CMAKE_INSTALL_PREFIX}
)
Expand Down
7 changes: 6 additions & 1 deletion src/aliceVision/camera/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,13 @@ if (ALICEVISION_BUILD_SWIG_BINDING)
SOURCES Camera.i
)

if (CMAKE_SYSTEM_NAME MATCHES "Linux")
list(APPEND SWIG_EXTRA_COMPILE_OPTIONS "-DSWIGWORDSIZE64")
endif()

set_property(
TARGET camera
PROPERTY SWIG_COMPILE_OPTIONS -doxygen
PROPERTY SWIG_COMPILE_OPTIONS -doxygen ${SWIG_EXTRA_COMPILE_OPTIONS}
)

target_include_directories(camera
Expand All @@ -93,6 +97,7 @@ if (ALICEVISION_BUILD_SWIG_BINDING)
target_link_libraries(camera
PUBLIC
aliceVision_camera
${Python3_LIBRARIES}
)

install(
Expand Down
7 changes: 6 additions & 1 deletion src/aliceVision/geometry/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,13 @@ if (ALICEVISION_BUILD_SWIG_BINDING)
SOURCES Geometry.i
)

if (CMAKE_SYSTEM_NAME MATCHES "Linux")
list(APPEND SWIG_EXTRA_COMPILE_OPTIONS "-DSWIGWORDSIZE64")
endif()

set_property(
TARGET geometry
PROPERTY SWIG_COMPILE_OPTIONS -doxygen
PROPERTY SWIG_COMPILE_OPTIONS -doxygen ${SWIG_EXTRA_COMPILE_OPTIONS}
)

target_include_directories(geometry
Expand All @@ -72,6 +76,7 @@ if (ALICEVISION_BUILD_SWIG_BINDING)
target_link_libraries(geometry
PUBLIC
aliceVision_geometry
${Python3_LIBRARIES}
)

install(
Expand Down
9 changes: 7 additions & 2 deletions src/aliceVision/global.i
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
%}

%inline %{
typedef long unsigned int size_t;
#if defined(SWIGWORDSIZE64)
typedef long unsigned int size_t;
#endif
typedef uint32_t IndexT;
%}

Expand All @@ -37,7 +39,10 @@

%template(IndexTSet) std::set<IndexT>;

%template(SizeTPair) std::pair<size_t, size_t>;
namespace std {
%template(SizeTPair) pair<size_t, size_t>;
}
%template(LongUintPair) std::pair<long unsigned int, long unsigned int>;

// As defined in aliceVision/types.hpp
%template(Pair) std::pair<IndexT, IndexT>;
Expand Down
7 changes: 6 additions & 1 deletion src/aliceVision/hdr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,13 @@ if (ALICEVISION_BUILD_SWIG_BINDING)
SOURCES Hdr.i
)

if (CMAKE_SYSTEM_NAME MATCHES "Linux")
list(APPEND SWIG_EXTRA_COMPILE_OPTIONS "-DSWIGWORDSIZE64")
endif()

set_property(
TARGET hdr
PROPERTY SWIG_COMPILE_OPTIONS -doxygen
PROPERTY SWIG_COMPILE_OPTIONS -doxygen ${SWIG_EXTRA_COMPILE_OPTIONS}
)

target_include_directories(hdr
Expand All @@ -89,6 +93,7 @@ if (ALICEVISION_BUILD_SWIG_BINDING)
aliceVision_numeric
aliceVision_image
aliceVision_sfmData
${Python3_LIBRARIES}
)

install(
Expand Down
7 changes: 6 additions & 1 deletion src/aliceVision/sensorDB/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,13 @@ if (ALICEVISION_BUILD_SWIG_BINDING)
SOURCES SensorDB.i
)

if (CMAKE_SYSTEM_NAME MATCHES "Linux")
list(APPEND SWIG_EXTRA_COMPILE_OPTIONS "-DSWIGWORDSIZE64")
endif()

set_property(
TARGET sensorDB
PROPERTY SWIG_COMPILE_OPTIONS -doxygen
PROPERTY SWIG_COMPILE_OPTIONS -doxygen ${SWIG_EXTRA_COMPILE_OPTIONS}
)

target_include_directories(sensorDB
Expand All @@ -63,6 +67,7 @@ if (ALICEVISION_BUILD_SWIG_BINDING)
target_link_libraries(sensorDB
PUBLIC
aliceVision_sensorDB
${Python3_LIBRARIES}
)

install(
Expand Down
7 changes: 6 additions & 1 deletion src/aliceVision/sfmData/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,13 @@ if (ALICEVISION_BUILD_SWIG_BINDING)
SOURCES SfMData.i
)

if (CMAKE_SYSTEM_NAME MATCHES "Linux")
list(APPEND SWIG_EXTRA_COMPILE_OPTIONS "-DSWIGWORDSIZE64")
endif()

set_property(
TARGET sfmData
PROPERTY SWIG_COMPILE_OPTIONS -doxygen
PROPERTY SWIG_COMPILE_OPTIONS -doxygen ${SWIG_EXTRA_COMPILE_OPTIONS}
)

target_include_directories(sfmData
Expand All @@ -88,6 +92,7 @@ if (ALICEVISION_BUILD_SWIG_BINDING)
PUBLIC
aliceVision_sfmData
aliceVision_camera
${Python3_LIBRARIES}
)

install(
Expand Down
7 changes: 6 additions & 1 deletion src/aliceVision/sfmDataIO/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,13 @@ if (ALICEVISION_BUILD_SWIG_BINDING)
SOURCES SfMDataIO.i
)

if (CMAKE_SYSTEM_NAME MATCHES "Linux")
list(APPEND SWIG_EXTRA_COMPILE_OPTIONS "-DSWIGWORDSIZE64")
endif()

set_property(
TARGET sfmDataIO
PROPERTY SWIG_COMPILE_OPTIONS -doxygen
PROPERTY SWIG_COMPILE_OPTIONS -doxygen ${SWIG_EXTRA_COMPILE_OPTIONS}
)

target_include_directories(sfmDataIO
Expand All @@ -132,6 +136,7 @@ if (ALICEVISION_BUILD_SWIG_BINDING)
target_link_libraries(sfmDataIO
PUBLIC
aliceVision_sfmDataIO
${Python3_LIBRARIES}
)

install(
Expand Down
7 changes: 6 additions & 1 deletion src/aliceVision/stl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,13 @@ if (ALICEVISION_BUILD_SWIG_BINDING)
SOURCES Stl.i
)

if (CMAKE_SYSTEM_NAME MATCHES "Linux")
list(APPEND SWIG_EXTRA_COMPILE_OPTIONS "-DSWIGWORDSIZE64")
endif()

set_property(
TARGET stl
PROPERTY SWIG_COMPILE_OPTIONS -doxygen
PROPERTY SWIG_COMPILE_OPTIONS -doxygen ${SWIG_EXTRA_COMPILE_OPTIONS}
)

target_include_directories(stl
Expand All @@ -55,6 +59,7 @@ if (ALICEVISION_BUILD_SWIG_BINDING)
aliceVision_stl
aliceVision_system
Boost::container
${Python3_LIBRARIES}
)

install(
Expand Down
Loading