0
0
mirror of https://github.com/OpenVPN/openvpn3.git synced 2024-09-19 19:52:15 +02:00
openvpn3/cmake/findswigdeps.cmake
Frank Lichtenheld 72275db1d5
client: Switch to UseSWIG instead of manual custom command
On modern CMake this gets us swig dependency management,
which should reduce problems for incremental builds.
Also it is just cleaner.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2023-11-08 21:10:19 +01:00

23 lines
703 B
CMake

find_package(Python3 COMPONENTS Interpreter Development)
FIND_PACKAGE(SWIG 3.0)
include(UseSWIG)
if (CMAKE_VERSION VERSION_GREATER "3.20")
set(SWIG_USE_SWIG_DEPENDENCIES TRUE)
endif()
# We test building this library with python instead of java since that is easier to do and both languages should work
if (Python3_Development_FOUND AND SWIG_FOUND)
if (NOT WIN32)
set(BUILD_SWIG_LIB TRUE)
elseif("${CMAKE_EXE_LINKER_FLAGS}" MATCHES "x64")
set(BUILD_SWIG_LIB TRUE)
else()
MESSAGE(INFO " Skipping swig builds on non-x64 Windows: ${CMAKE_EXE_LINKER_FLAGS}")
endif()
else()
MESSAGE(INFO " Python libraries or swig not found, skipping swig builds")
endif()