[Poppler-bugs] [Bug 102230] New: Unable to build Poppler (with CMake) as a subproject

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Aug 15 09:02:18 UTC 2017


https://bugs.freedesktop.org/show_bug.cgi?id=102230

            Bug ID: 102230
           Summary: Unable to build Poppler (with CMake) as a subproject
           Product: poppler
           Version: unspecified
          Hardware: Other
                OS: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: general
          Assignee: poppler-bugs at lists.freedesktop.org
          Reporter: freedesktop at akikoskinen.info

Poppler fails to build when used as a subproject. Say I have a project at
directory ${CWD} where I have a CMakeLists.txt file for my project. Poppler
sources are in ${CWD}/poppler. In my CMakeLists.txt I have a line:

add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/poppler"
"${CMAKE_CURRENT_BINARY_DIR}/poppler")

When configuring my project with CMake, it fails because it can't find the
needed CMake modules within Poppler sources. These modules are included in
Poppler's CMakeLists.txt starting from line 7.

The root cause of this is that on line 5 in Poppler's CMakeLists.txt there is
this:

set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)

That works fine when Poppler is built by itself. But when Poppler sources are
in a subdirectory under another project, then ${CMAKE_SOURCE_DIR} points to the
main project's source directory.

I suggest changing the line 5 in CMakeLists.txt to this:

set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake/modules)

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/poppler-bugs/attachments/20170815/92a28dad/attachment.html>


More information about the Poppler-bugs mailing list