<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - CMake: building with BUILD_QT4_TESTS=NO fails"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=103591">103591</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>CMake: building with BUILD_QT4_TESTS=NO fails
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>poppler
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux (All)
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>general
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>poppler-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>r.hieber@pengutronix.de
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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)</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>