A recent commit to kdelibs (sometime after b6c557e from May this year) introduced a change to the build system that causes the configure step to fail when cmake is invoked with -DKDE4_BUILD_TESTS=false . Reproducible: Always Steps to Reproduce: 1. fetch kdelibs (commit 8e81797) 2. mkdir build 3. (cd build ; cmake .. -Wno-dev -DKDE4_BUILD_TESTS=false) Actual Results: multiple copies of this error: CMake Error at cmake/modules/KDE4Macros.cmake:941 (add_custom_target): add_custom_target cannot create target "buildtests" because another target with the same name already exists. The existing target is a custom target created in source directory ".../kdelibs/kl-test/nepomuk/test". See documentation for policy CMP0002 for more details. Call Stack (most recent call first): kdecore/sonnet/tests/CMakeLists.txt:18 (kde4_add_unit_test) kdecore/sonnet/tests/CMakeLists.txt:23 (SONNET_UNIT_TESTS) Expected Results: Configure without error This error disappears when not disabling test builds. I'm classifying this as a major error because it makes the build process significantly more expensive, possibly breaking it on platforms other than Linux on which certain tests might fail (disabling tests is a known (least-resistance) workaround for several projects on OS X).
(In reply to RJVB from comment #0) > CMake Error at cmake/modules/KDE4Macros.cmake:941 (add_custom_target): > add_custom_target cannot create target "buildtests" because another target > with the same name already exists. The existing target is a custom target > created in source directory > ".../kdelibs/kl-test/nepomuk/test". See > documentation for policy CMP0002 for more details. > Call Stack (most recent call first): > kdecore/sonnet/tests/CMakeLists.txt:18 (kde4_add_unit_test) > kdecore/sonnet/tests/CMakeLists.txt:23 (SONNET_UNIT_TESTS) I see similar errors when building with -DKDE4_ENABLE_HTMLHANDBOOK=TRUE: CMake Error at cmake/modules/KDE4Macros.cmake:315 (add_custom_target): add_custom_target cannot create target "htmlhandbook" because another target with the same name already exists. The existing target is a custom target created in source directory "/var/tmp/paludis/build/kde-kdelibs-4.14.11/work/kdelibs-4.14.11/doc/kioslave/data". See documentation for policy CMP0002 for more details. Call Stack (most recent call first): doc/kioslave/webdav/CMakeLists.txt:2 (kde4_create_handbook) CMake version is 3.3.1
Git commit eaf92b8d2f5a058fbf575d733f0924c446eb93ee by Heiko Becker. Committed on 08/11/2015 at 15:40. Pushed by heikobecker into branch 'KDE/4.14'. Give each htmlhandbook target a unique name Since the CMP0002 warnings have been turned into errors it was impossible to build kdelibs with -DKDE4_ENABLE_HTMLHANDBOOK:BOOL=TRUE: "CMake Error at cmake/modules/KDE4Macros.cmake:315 (add_custom_target): add_custom_target cannot create target "htmlhandbook" because another target with the same name already exists...." The bug below is more about the similar error with -DKDE4_BUILD_TESTS but since it's still open (and I commented there about the htmlhandbook error ;-) I included it here. REVIEW: 125983 M +3 -1 cmake/modules/KDE4Macros.cmake http://commits.kde.org/kdelibs/eaf92b8d2f5a058fbf575d733f0924c446eb93ee