CMake error: file for target mongoc_static does not exist

Bug #1886175 reported by Thomas Thulesen
24
This bug affects 5 people
Affects Status Importance Assigned to Milestone
mongo-c-driver (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

In Ubuntu focal I get the following CMake error when using find_package(mongoc-1.0) in CMake:

CMake Error at /usr/lib/x86_64-linux-gnu/cmake/mongoc-1.0/mongoc-targets.cmake:98 (message):
  The imported target "mongo::mongoc_static" references the file

     "/usr/lib/x86_64-linux-gnu/libmongoc-static-1.0.a"

  but this file does not exist. Possible reasons include:

  * The file was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and contained

     "/usr/lib/x86_64-linux-gnu/cmake/mongoc-1.0/mongoc-targets.cmake"

  but not all the files it references.

The libmongoc-static-1.0.a library is not included in the libmongoc-dev package.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in mongo-c-driver (Ubuntu):
status: New → Confirmed
Revision history for this message
Mark Brown (chef34) wrote :

I commented out the following code beginning at /usr/lib/x86_64-linux-gnu/cmake/mongoc-1.0/mongoc-targets.cmake:98 and it worked for me:

#foreach(target ${_IMPORT_CHECK_TARGETS} )
# foreach(file ${_IMPORT_CHECK_FILES_FOR_${target}} )
# if(NOT EXISTS "${file}" )
# message(FATAL_ERROR "The imported target \"${target}\" references the file
# \"${file}\"
#but this file does not exist. Possible reasons include:
#* The file was deleted, renamed, or moved to another location.
#* An install or uninstall procedure did not complete successfully.
#* The installation package was faulty and contained
# \"${CMAKE_CURRENT_LIST_FILE}\"
#but not all the files it references.
#")
# endif()
# endforeach()
# unset(_IMPORT_CHECK_FILES_FOR_${target})
#endforeach()
unset(_IMPORT_CHECK_TARGETS)

Take care don't comment out the unset code on the last line.

Revision history for this message
Patrizio Bertoni (pbertoni89) wrote :

Thank you Mark. I hacked that step by simply breaking the outer foreach

sed -i 's/foreach\(.*\)_IMPORT_CHECK_TARGETS\(.*\)/foreach\1_IMPORT_CHECK_TARGETS\2 \n break()/g' \
    /usr/lib/x86_64-linux-gnu/cmake/mongoc-1.0/mongoc-targets.cmake

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.