Skip to content

Commit

Permalink
Fix CMake 3.31 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault authored and nyalldawson committed Dec 3, 2024
1 parent 3fca3fc commit 5665665
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 9 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ if(NOT "${CMAKE_VERSION}" VERSION_LESS "3.27")
# include(Dart) still used, as is the "Experimental" target
cmake_policy(SET CMP0145 OLD)
endif()
if("${CMAKE_VERSION}" VERSION_GREATER_EQUAL "3.31")
cmake_policy(SET CMP0177 NEW)
endif()

# don't relink it only the shared object changes
set(CMAKE_LINK_DEPENDS_NO_SHARED ON)
Expand Down
4 changes: 2 additions & 2 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ foreach(pyfile ${PY_FILES})
COMMAND ${CMAKE_COMMAND} -E make_directory "${QGIS_PYTHON_OUTPUT_DIRECTORY}"
COMMAND ${CMAKE_COMMAND} -E copy ${pyfile} "${QGIS_PYTHON_OUTPUT_DIRECTORY}"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS ${pyfile}
# DEPENDS ${pyfile}
)
PY_COMPILE(pyutils "${QGIS_PYTHON_OUTPUT_DIRECTORY}/${pyfile}")
endforeach(pyfile)
Expand Down Expand Up @@ -448,7 +448,7 @@ foreach(module ${PY_MODULES})
COMMAND ${CMAKE_COMMAND} -E make_directory "${QGIS_PYTHON_OUTPUT_DIRECTORY}/${subdir}"
COMMAND ${CMAKE_COMMAND} -E copy ${pyfile} "${QGIS_PYTHON_OUTPUT_DIRECTORY}/${subdir}"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS ${PY_FILES}
# DEPENDS ${PY_FILES}
)
endforeach(pyfile)
PY_COMPILE(py${module} "${QGIS_PYTHON_OUTPUT_DIRECTORY}/${module_name}")
Expand Down
4 changes: 2 additions & 2 deletions python/console/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ add_custom_command(TARGET pyconsole
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${UI_FILES} ${PYTHON_OUTPUT_DIRECTORY}/console
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS ${UI_FILES}
# DEPENDS ${UI_FILES}
)
foreach(pyfile ${PY_CONSOLE_FILES})
add_custom_command(TARGET pyconsole
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${pyfile} ${PYTHON_OUTPUT_DIRECTORY}/console
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS ${pyfile}
# DEPENDS ${pyfile}
)
endforeach(pyfile)
PY_COMPILE(pyconsole "${PYTHON_OUTPUT_DIRECTORY}/console")
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ macro (PLUGIN_INSTALL plugin subdir )
add_dependencies(zzz-${plugin}-stageinstall zzz-${plugin}-depend)

add_custom_command(TARGET zzz-${plugin}-stageinstall
COMMAND ${CMAKE_COMMAND} -P ${_cmake}
POST_BUILD COMMAND ${CMAKE_COMMAND} -P ${_cmake}
)

add_custom_target(clean-staged-${plugin}
Expand Down
2 changes: 1 addition & 1 deletion python/processing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ foreach(pyfile ${PY_FILES})
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${pyfile} "${QGIS_PYTHON_OUTPUT_DIRECTORY}/processing"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS ${pyfile}
# DEPENDS ${pyfile}
)
PY_COMPILE(pyutils "${QGIS_PYTHON_OUTPUT_DIRECTORY}/processing/${pyfile}")
endforeach(pyfile)
4 changes: 2 additions & 2 deletions python/pyplugin_installer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ add_custom_command(TARGET pyplugin-installer
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${UI_FILES} ${PYTHON_OUTPUT_DIRECTORY}/pyplugin_installer
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS ${UI_FILES}
# DEPENDS ${UI_FILES}
)

foreach(pyfile ${PY_PLUGININSTALLER_FILES})
add_custom_command(TARGET pyplugin-installer
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${pyfile} ${PYTHON_OUTPUT_DIRECTORY}/pyplugin_installer
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS ${pyfile}
# DEPENDS ${pyfile}
)
endforeach(pyfile)
PY_COMPILE(pyplugin-installer "${PYTHON_OUTPUT_DIRECTORY}/pyplugin_installer")
Expand Down
2 changes: 1 addition & 1 deletion python/testing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ foreach(pyfile ${PY_FILES})
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${pyfile} "${QGIS_PYTHON_OUTPUT_DIRECTORY}/testing"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS ${pyfile}
# DEPENDS ${pyfile}
)
PY_COMPILE(pyutils "${QGIS_PYTHON_OUTPUT_DIRECTORY}/testing/${pyfile}")
endforeach(pyfile)
Expand Down

0 comments on commit 5665665

Please sign in to comment.