[cmake-developers] [CMake 0015331]: Impossible to use Modules from GIT as project-local module because of CMAKE_CURRENT_LIST_DIR

Mantis Bug Tracker mantis at public.kitware.com
Wed Dec 31 02:45:34 EST 2014


The following issue has been SUBMITTED. 
====================================================================== 
https://public.kitware.com/Bug/view.php?id=15331 
====================================================================== 
Reported By:                AmiGO
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15331
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   low
Status:                     new
====================================================================== 
Date Submitted:             2014-12-31 02:45 EST
Last Modified:              2014-12-31 02:45 EST
====================================================================== 
Summary:                    Impossible to use Modules from GIT as project-local
module because of CMAKE_CURRENT_LIST_DIR
Description: 
CMake package: cmake-2.8.12.2-2.fc20.x86_64

Here is the details:

https://github.com/Kitware/CMake/blob/master/Modules/FindLibLZMA.cmake

Line 57:
 include(${CMAKE_CURRENT_LIST_DIR}/CheckLibraryExists.cmake)
Line 66:
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)

CMAKE_CURRENT_LIST_DIR causes CMake to search for CheckLibraryExists and
FindPackageHandleStandardArgs in directory where the FindLibLZMA was placed.

So if I want to include FindLibLZMA in project-local CMake modules directory
CMake will fail.

Sometimes before it looks like include(FindPackageHandleStandardArgs) and
observed behaviour was correct but now it's broken.

Steps to Reproduce: 
1. Untar demo project from attachment;
2. Run cmake ./ in project directory;

CMake will fail with the following message:

CMake Error at cmake/FindLibLZMA.cmake:67 (include):
  include could not find load file:

   
/home/AmiGO/soft/sources/zbackup/demo/cmake/FindPackageHandleStandardArgs.cmake
Call Stack (most recent call first):
  CMakeLists.txt:6 (find_package)


CMake Error at cmake/FindLibLZMA.cmake:68 (FIND_PACKAGE_HANDLE_STANDARD_ARGS):
  Unknown CMake command "FIND_PACKAGE_HANDLE_STANDARD_ARGS".
Call Stack (most recent call first):
  CMakeLists.txt:6 (find_package)


-- Configuring incomplete, errors occurred!

3. Comment line 67 and uncomment line 66;
4. Run cmake ./ again.

Now all becomes normal.

Additional Information: 
You should probably need to introduce something like ${CMAKE_MODULE_VENDOR_PATH}
that will unwind to /usr/share/cmake/Modules and use it in GIT modules instead
of ${CMAKE_CURRENT_LIST_DIR}.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2014-12-31 02:45 AmiGO          New Issue                                    
2014-12-31 02:45 AmiGO          File Added: demo.tar.xz                      
======================================================================



More information about the cmake-developers mailing list