DevHeads.net

cmake/modules: Only create and install man pages if using CMake < 3.0

Git commit 804d35394c3667ae4e9fe20321b6365cd8467e7d by Stephen Kelly.
Committed on 18/10/2013 at 15:33.
Pushed by skelly into branch 'KDE/4.11'.

Only create and install man pages if using CMake < 3.0

CMake documentation changes in CMake 3.0.0 such that running
cmake --help-custom-modules no longer has any effect.

<a href="http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/8144" title="http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/8144">http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/8144</a>

It is still possible to document custom modules with CMake 3.0,
but this patch only fixes the build so that we don't attempt to
install man pages which were not created.

Other CI-tested code may rely on 2.8-era behavior of CMake also. When
build.kde.org updates the CMake checkout on Sunday, other projects may
break, and the solution will be similar.

CCMAIL: <a href="mailto:kde-core- ... at kde dot org">kde-core- ... at kde dot org</a>

M +5 -3 cmake/modules/CMakeLists.txt

<a href="http://commits.kde.org/kdelibs/804d35394c3667ae4e9fe20321b6365cd8467e7d" title="http://commits.kde.org/kdelibs/804d35394c3667ae4e9fe20321b6365cd8467e7d">http://commits.kde.org/kdelibs/804d35394c3667ae4e9fe20321b6365cd8467e7d</a>

diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt
index b4a56f1..4443a5e 100644
--- a/cmake/modules/CMakeLists.txt
+++ b/cmake/modules/CMakeLists.txt
@@ -171,6 +171,8 @@ install(FILES ${cmakeFiles}
# file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/remove_files.cmake "exec_program( ${CMAKE_COMMAND} ARGS -E remove ${_current_FILE} OUTPUT_VARIABLE _dummy)\n" )
#endforeach ( _current_FILE)

-# create and install a man page for the kdelibs cmake modules
-add_custom_target(KDECMakeModulesManPage ALL COMMAND ${CMAKE_COMMAND} -DCMAKE_MODULE_PATH=${CMAKE_CURRENT_SOURCE_DIR} --help-custom-modules ${CMAKE_CURRENT_BINARY_DIR}/kdecmake.1)
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/kdecmake.1 DESTINATION "${MAN_INSTALL_DIR}/man1")
+if(CMAKE_VERSION VERSION_LESS 3.0.0)
+ # create and install a man page for the kdelibs cmake modules
+ add_custom_target(KDECMakeModulesManPage ALL COMMAND ${CMAKE_COMMAND} -DCMAKE_MODULE_PATH=${CMAKE_CURRENT_SOURCE_DIR} --help-custom-modules ${CMAKE_CURRENT_BINARY_DIR}/kdecmake.1)
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/kdecmake.1 DESTINATION "${MAN_INSTALL_DIR}/man1")
+endif()