Created attachment 134499 [details] [review] possible solution cmake fails when called with these flags: -DENABLE_TESTING=0 -DBUILD_GTK_TESTS=0 -DBUILD_QT4_TESTS=0 -DBUILD_QT5_TESTS=0 -DBUILD_CPP_TESTS=0 Output: CMake Error at cmake/modules/PopplerMacros.cmake:18 (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 "/usr/src/poppler-git/test". See documentation for policy CMP0002 for more details. Call Stack (most recent call first): cpp/tests/CMakeLists.txt:13 (poppler_add_test) cpp/tests/CMakeLists.txt:21 (cpp_add_simpletest) Solution: patch is attached.
The patch doesn't make any sense to me, we're already setting CMP0002 to old, no? ./modules/PopplerDefaults.cmake:12:cmake_policy(SET CMP0002 OLD) Also ideally we should be moving from all those OLD settings and having proper fixes.
Agree with proper fixes, like moving back to autotools, hehe. But the patch works for me (for now). (In reply to Albert Astals Cid from comment #1) > The patch doesn't make any sense to me, we're already setting CMP0002 to > old, no? > > ./modules/PopplerDefaults.cmake:12:cmake_policy(SET CMP0002 OLD) > > Also ideally we should be moving from all those OLD settings and having > proper fixes.
(In reply to Pavel Vinogradov from comment #2) > Agree with proper fixes, like moving back to autotools, hehe. Ahhh, the smart-ass answer, you just made me lose any interest i had in helping you. Congratulations. > But the patch works for me (for now). That doesn't mean it's correct, you could remove all the tests and the patch would work for you too. > > (In reply to Albert Astals Cid from comment #1) > > The patch doesn't make any sense to me, we're already setting CMP0002 to > > old, no? > > > > ./modules/PopplerDefaults.cmake:12:cmake_policy(SET CMP0002 OLD) > > > > Also ideally we should be moving from all those OLD settings and having > > proper fixes.
*** Bug 103591 has been marked as a duplicate of this bug. ***
Created attachment 135259 [details] [review] CMake: add the custom buildtests target only once Here is a better patch which makes BUILDTESTS_ADDED a global property, so the `buildtests` target gets added only once. As far as I understood, this seems to fulfil the requirements of CMP0002.
works for me too. thanks. (In reply to Roland Hieber from comment #5) > Created attachment 135259 [details] [review] [review] > CMake: add the custom buildtests target only once > > Here is a better patch which makes BUILDTESTS_ADDED a global property, so > the `buildtests` target gets added only once. As far as I understood, this > seems to fulfil the requirements of CMP0002.
Pushed
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.