[cmake-developers] find_package without REQUIRED can cause fatal error now

Chris developerchris at rebel.com.au
Wed Apr 24 23:17:23 EDT 2013


Alexander Neundorf <neundorf at ...> writes:

> 
> > 
> > We need to figure out what tells find_package to look for and
> > load KActivitiesConfig.cmake from a path with no drive letter
> > in the first place.
> 
> Is it this one http://public.kitware.com/Bug/view.php?id=10994 ?
> 
> Alex
> --
> 
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
> 
> 


It appears the issue is in the find_package function it is incorrectly
changing the CMAKE_CURRENT_LIST_FILE and dropping the drive letter and colon

cmake called with...

cmake -G "MinGW Makefiles"  -DBUILD_doc=OFF -DCMAKE_INSTALL_PREFIX="r:/"
-DCMAKE_INCLUDE_PATH="r:/include" -DCMAKE_LIBRARY_PATH="r:/lib"
-DCMAKE_PREFIX_PATH="r:/" -DCMAKE_BUILD_TYPE=RelWithDebInfo "q:\kate"

macro_optional_find_package(KActivities 6.1.0) is called from
q:/kate/CMakeLists.txt at that point CMAKE_CURRENT_LIST_FILE is set to
q:/kate/CMakeLists.txt

macro_optional_find_package calls find_package(KActivities) at that point
CMAKE_CURRENT_LIST_FILE is still set to q:/kate/CMakeLists.txt

when find_package calls r:\lib\cmake\KActivities\KActivitiesConfig.cmake
CMAKE_CURRENT_LIST_FILE is changed to
/lib/cmake/KActivities/KActivitiesConfig.cmake

The call stack below shows that change occuring.

I cannot find any point where the change occurs. I can only assume its
inside find_package()

log output with extra messages inserted

-- Found the KDE4 kconfig_compiler preprocessor: r://bin/kconfig_compiler.exe
-- Found automoc4: R:/bin/automoc4.exe
-- CMAKE_CURRENT_LIST_FILE : q:/kate/CMakeLists.txt
-- MACRO_OPTIONAL_FIND_PACKAGE KActivities
-- finding package KActivities 6.1.0 CMAKE_CURRENT_LIST_FILE :
q:/kate/CMakeLists.txt
-- setting rootDir : /lib/cmake/KActivities and myDir :
/lib/cmake/KActivities taken from CMAKE_CURRENT_LIST_FILE :
/lib/cmake/KActivities/KActivitiesConfig.cmake
CMake Error at /lib/cmake/KActivities/KActivitiesLibraryTargets.cmake:63
(message):
  The imported target "kactivities" references the file

     "//lib/libkactivities.dll.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

     "/lib/cmake/KActivities/KActivitiesLibraryTargets.cmake"

  but not all the files it references.

Call Stack (most recent call first):
  /lib/cmake/KActivities/KActivitiesConfig.cmake:20 (include)
  r:/share/apps/cmake/modules/MacroOptionalFindPackage.cmake:34 (find_package)
  CMakeLists.txt:17 (macro_optional_find_package)


Chris 




More information about the cmake-developers mailing list