[cmake-developers] [CMake 0015067]: include does not find files in current directory if module path discovered through CMAKE_PREFIX_PATH

Mantis Bug Tracker mantis at public.kitware.com
Thu Aug 7 06:56:39 EDT 2014


The following issue has been SUBMITTED. 
====================================================================== 
http://www.cmake.org/Bug/view.php?id=15067 
====================================================================== 
Reported By:                Alexander Jones
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15067
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2014-08-07 06:56 EDT
Last Modified:              2014-08-07 06:56 EDT
====================================================================== 
Summary:                    include does not find files in current directory if
module path discovered through CMAKE_PREFIX_PATH
Description: 
Setup:

someprefix/share/mytest/cmake/MyTestConfig.cmake:

  include(somethingspecific)

---

someprefix/share/mytest/cmake/somethingspecific.cmake:

  message("Hello, World!")

---

somesourcecode/CMakeLists.txt

  cmake_minimum_required(VERSION 3.0)

  find_package(MyTest REQUIRED CONFIG)

---

Build with

cmake .. -DCMAKE_PREFIX_PATH=someprefix

CMake Error at (snip)/someprefix/share/mytest/cmake/MyTestConfig.cmake:1
(include):
  include could not find load file:

    somethingspecific
Call Stack (most recent call first):
  CMakeLists.txt:3 (find_package)


This is the setup LLVM has for its config, and it does not work in our setup for
the same reason.

Manually adding someprefix/share/mytest/cmake to the CMAKE_MODULE_PATH fixes
this, but is that not implied from someprefix being on the CMAKE_PREFIX_PATH?

Our scenario is that we have many isolated package installations distributed
across many prefixes, each with an entry on CMAKE_PREFIX_PATH.

Thanks
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2014-08-07 06:56 Alexander JonesNew Issue                                    
2014-08-07 06:56 Alexander JonesFile Added: cmakebugtest.tar.gz                 
  
======================================================================



More information about the cmake-developers mailing list