Skip to content

Commit

Permalink
CMake: replace FindPythonIntp with FindPython3
Browse files Browse the repository at this point in the history
The earlier were deprecated since CMake 3.12.
Since CMake 3.27 this causes deprecation warnings.
Should be safe nowadays to require CMake 3.12.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
  • Loading branch information
flichtenheld authored and dsommers committed Aug 2, 2023
1 parent 964b7cb commit bb61350
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.12)
cmake_policy(SET CMP0048 NEW)

project(OpenVPN3-core VERSION 3)
Expand Down
4 changes: 2 additions & 2 deletions client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ if (${BUILD_SWIG_LIB})
)

add_core_dependencies(ovpnclilib)
target_link_libraries(ovpnclilib ${PYTHON_LIBRARIES})
target_include_directories(ovpnclilib PRIVATE ${PYTHON_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(ovpnclilib ${Python3_LIBRARIES})
target_include_directories(ovpnclilib PRIVATE ${Python3_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR})

# Use proper python library name to generate _ovpncli.so/dylib/dll
set_target_properties(ovpnclilib PROPERTIES OUTPUT_NAME "_ovpncli")
Expand Down
5 changes: 2 additions & 3 deletions cmake/findswigdeps.cmake
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
find_package(PythonInterp)
find_package(PythonLibs)
find_package(Python3 COMPONENTS Interpreter Development)

FIND_PACKAGE(SWIG 3.0)

# We test building this library with python instead of java since that is easier to do and both languages should work

if (PYTHONLIBS_FOUND AND SWIG_FOUND)
if (Python3_Development_FOUND AND SWIG_FOUND)
if (NOT WIN32)
set(BUILD_SWIG_LIB TRUE)
elseif("${CMAKE_EXE_LINKER_FLAGS}" MATCHES "x64")
Expand Down

0 comments on commit bb61350

Please sign in to comment.