Skip to content

Commit

Permalink
Merge pull request #60032 from m-kuhn/cleanup_cmake
Browse files Browse the repository at this point in the history
[cmake] Cleanup python libraries and includes
  • Loading branch information
m-kuhn authored Dec 31, 2024
2 parents 489b8f7 + 072aca8 commit 834b94b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 57 deletions.
7 changes: 1 addition & 6 deletions cmake/SIPMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,8 @@ MACRO(BUILD_SIP_PYTHON_MODULE MODULE_NAME SIP_FILES EXTRA_OBJECTS)
ENDIF (${SIP_VERSION_STR} VERSION_LESS 5.0.0)

SET_TARGET_PROPERTIES(${_logical_name} PROPERTIES CXX_VISIBILITY_PRESET default)
IF (NOT APPLE)
TARGET_LINK_LIBRARIES(${_logical_name} ${Python_LIBRARIES})
ENDIF (NOT APPLE)
TARGET_LINK_LIBRARIES(${_logical_name} Python::Python)
TARGET_LINK_LIBRARIES(${_logical_name} ${EXTRA_LINK_LIBRARIES})
IF (APPLE)
SET_TARGET_PROPERTIES(${_logical_name} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
ENDIF (APPLE)
SET_TARGET_PROPERTIES(${_logical_name} PROPERTIES PREFIX "" OUTPUT_NAME ${_child_module_name})

IF (WIN32)
Expand Down
43 changes: 0 additions & 43 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,46 +65,6 @@ add_subdirectory(ext-libs)
add_subdirectory(testing)
add_subdirectory(processing)

include_directories(SYSTEM
${Python_INCLUDE_DIRS}
${QT_QTCORE_INCLUDE_DIR}
${QT_QTGUI_INCLUDE_DIR}
${QT_QTNETWORK_INCLUDE_DIR}
${QT_QTSERIALPORT_INCLUDE_DIR}
${QT_QTSVG_INCLUDE_DIR}
${QT_QTXML_INCLUDE_DIR}
${QWT_INCLUDE_DIR}
${QCA_INCLUDE_DIR}
${QTKEYCHAIN_INCLUDE_DIR}
${SPATIALINDEX_INCLUDE_DIR}
)

if (${SIP_VERSION_STR} VERSION_LESS 5)
include_directories(SYSTEM
${SIP_INCLUDE_DIR}
)
endif()

if (WITH_GUI)
include_directories(SYSTEM
${QSCINTILLA_INCLUDE_DIR}
)
endif()

include_directories(
${CMAKE_SOURCE_DIR}/src/plugins

${CMAKE_BINARY_DIR} # qgsconfig.h, qgsversion.h
${CMAKE_BINARY_DIR}/src/ui
${CMAKE_BINARY_DIR}/src/analysis
)

if (WITH_GUI)
include_directories(

)
endif()

if(NOT ENABLE_TESTS)
set(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} TESTS)
endif()
Expand Down Expand Up @@ -252,9 +212,6 @@ endif()

# 3D module
if (WITH_3D)
include_directories(
${QT5_3DEXTRA_INCLUDE_DIR}
)
set(PY_MODULES ${PY_MODULES} 3d)

file(GLOB_RECURSE sip_files_3d ${BINDING_FILES_ROOT_DIR}/3d/*.sip ${BINDING_FILES_ROOT_DIR}/3d/*.sip.in)
Expand Down
9 changes: 1 addition & 8 deletions src/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@ target_include_directories(qgispython PUBLIC
${CMAKE_SOURCE_DIR}/src/python
${CMAKE_BINARY_DIR}/src/python
)
target_include_directories(qgispython SYSTEM PRIVATE
${Python_INCLUDE_DIRS}
)

set_target_properties(qgispython PROPERTIES
CLEAN_DIRECT_OUTPUT 1
)

#generate unversioned libs for android
if (NOT ANDROID)
Expand All @@ -27,7 +20,7 @@ endif()

target_link_libraries(qgispython
qgis_core
${Python_LIBRARIES}
Python::Python
${OPENPTY_LIBRARY}
)

Expand Down

0 comments on commit 834b94b

Please sign in to comment.