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

Brad King brad.king at kitware.com
Wed Apr 24 10:40:22 EDT 2013


On 04/24/2013 09:29 AM, DeveloperChris wrote:
> I had added some message lines to try and work out how it functions
> part of the log snippet I actually cut out was the following...
> |
> ||-- Found automoc4: R:/bin/automoc4.exe||
> ||-- the import prefix derived from /lib/cmake/KActivities/KActivitiesLibraryTargets.cmake is :- /lib/cmake/KActivities||
> ||-- the import prefix derived from /lib/cmake is :- /lib/cmake||
> ||-- the import prefix derived from /lib is :- /lib||
> ||-- the import prefix derived from / is :- /||
> ||-- the import prefix is :- /||
> ||CMake Error at /lib/cmake/KActivities/KActivitiesLibraryTargets.cmake:68 (message):||
> |
> 
> So the import prefix is set to /

The above all happens inside files loaded by find_package.  The
problem is that they are being loaded through a path starting
in "/" and using that to compute the import prefix relative to
themselves.  This process is a victim of the real problem, not
the cause.

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.

-Brad



More information about the cmake-developers mailing list