Bug 103591 - CMake: building with BUILD_QT4_TESTS=NO fails
Summary: CMake: building with BUILD_QT4_TESTS=NO fails
Status: RESOLVED DUPLICATE of bug 103003
Alias: None
Product: poppler
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other Linux (All)
: medium normal
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-06 14:08 UTC by Roland Hieber
Modified: 2017-11-06 14:33 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Roland Hieber 2017-11-06 14:08:52 UTC
Hi,

I want to explicitely disable tests in poppler-0.60.1 because I don't need them when building for embedded systems. However, when calling CMake I get the following error message:

	$ rm CMakeCache.txt; cmake -DENABLE_QT4=ON -DBUILD_QT4_TESTS=NO
	[...]
	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 "/ptx/work/bohne/rhi/poppler/qt4/tests".  See
	  documentation for policy CMP0002 for more details.
	Call Stack (most recent call first):
	  qt4/demos/CMakeLists.txt:27 (poppler_add_test)


	Building Poppler with support for:
	  font configuration:   fontconfig
	  splash output:        yes
	  cairo output:         yes
	  qt4 wrapper:          yes
	  qt5 wrapper:          yes
	  glib wrapper:         yes
	    introspection:      no
	    gtk-doc:            no
	  cpp wrapper:          yes
	  use libjpeg:          yes
	  use libpng:           yes
	  use libtiff:          yes
	  use zlib compress:    yes
	  use zlib uncompress:  no
	  use nss3:             no
	  use curl:             yes
	  use libopenjpeg:      yes
	      with openjpeg2
	  use cms:              yes
	      with lcms2
	  command line utils:   yes
	  test data dir:        /ptx/work/bohne/rhi/poppler/../test
	-- Configuring incomplete, errors occurred!
	See also "/ptx/work/bohne/rhi/poppler/CMakeFiles/CMakeOutput.log".
	See also "/ptx/work/bohne/rhi/poppler/CMakeFiles/CMakeError.log".

CMakeOutput.log and CMakeError.log don't seem to contain related errors, so I have left them out for now.

I have tried some print-debugging, the error happens when calling `poppler_add_test(poppler_qt4viewer, BUILD_QT4_TESTS)` in qt4/demos/CMakeLists.txt. However, the calls to poppler_add_test() from qt4/test/CMakeLists.txt, which are executed before that, are successful.

The same error also happens with the Qt5 version:

	$ cmake -DENABLE_QT5=ON -DBUILD_QT5_TESTS=NO
	[...]
	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 "/ptx/work/bohne/rhi/poppler/qt5/tests".  See
	  documentation for policy CMP0002 for more details.
	Call Stack (most recent call first):
	  qt5/demos/CMakeLists.txt:35 (poppler_add_test)
Comment 1 Roland Hieber 2017-11-06 14:33:01 UTC
Sorry, I just now see that this is already known.

*** This bug has been marked as a duplicate of bug 103003 ***


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.