View Issue Details [ Jump to Notes ] | [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0012325 | CMake | Modules | public | 2011-07-08 13:27 | 2011-07-08 14:41 | ||||
Reporter | Dan Thill | ||||||||
Assigned To | Alex Neundorf | ||||||||
Priority | normal | Severity | minor | Reproducibility | always | ||||
Status | closed | Resolution | no change required | ||||||
Platform | Windows | OS | Windows XP-64 SP2 | OS Version | 5.2.3790 | ||||
Product Version | CMake 2.8.4 | ||||||||
Target Version | Fixed in Version | ||||||||
Summary | 0012325: FindDCMTK: Does not work when CMAKE_MODULE_PATH has been modified. | ||||||||
Description | When FindDCMTK includes FindPackageHandleStandardArgs, this will fail if CMAKE_MODULE_PATH has been modified (under some circumstances). This was discovered when I was making my own copy of FindDCMTK with some bug fixes and putting it into my local source directory in order to override the stock one. | ||||||||
Steps To Reproduce | 1) Make a copy of FindDCMTK.cmake and put into your local source directory. 2) In CMakeLists.txt, do the following: ------------------------------------------- CMAKE_MINIMUM_REQUIRED(VERSION 2.8) SET( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR} ${CMAKE_MODULE_PATH}) PROJECT(SomeProject) FIND_PACKAGE(DCMTK) ------------------------------------------- You will get the following error: CMake Error at FindDCMTK.cmake:136 (include): include could not find load file: [full path to src directory]/FindPackageHandleStandardArgs.cmake Call Stack (most recent call first): CMakeLists.txt:8 (FIND_PACKAGE) CMake Error at FindDCMTK.cmake:137 (find_package_handle_standard_args): Unknown CMake command "find_package_handle_standard_args". Call Stack (most recent call first): CMakeLists.txt:8 (FIND_PACKAGE) | ||||||||
Additional Information | Fix is modify FindDCMTK.cmake:135 and change: include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) to include(FindPackageHandleStandardArgs) | ||||||||
Tags | No tags attached. | ||||||||
Attached Files | |||||||||
Relationships | |
Relationships |
Notes | |
(0027019) Dan Thill (reporter) 2011-07-08 13:45 |
Obviously, the example I listed above is weird and can easily be fixed by me since I'm making my own copy. However, you can also see that if a user were trying to override FindPackageHandleStandardArgs by changing the CMAKE_MODULE_PATH and leaving FindDCMTK in the default location, FindDCMTK would not pick up the other version since it's bypassing the INCLUDE() search path machinery. This seems counterintuitive to me. |
(0027020) Alex Neundorf (developer) 2011-07-08 14:11 |
It has the fixed path to FindPackageHandleStandardArgs.cmake so it gets exactly the one it expects, i.e. the one shipping with the same version of cmake. If somebody wants it to use a different version, he has to provide copies of both files, so the dependencies are ok. Otherwise FindDCMTK.cmake might get a FindPackageHandleStandardArgs.cmake which does not support the features it expects and this would lead to a cmake error. Alex |
(0027021) Dan Thill (reporter) 2011-07-08 14:34 |
Fair enough. I've just noticed this same construct in other modules and realized this must be the rationale. |
(0027022) Alex Neundorf (developer) 2011-07-08 14:41 |
So I'm closing this one if you don't mind. Alex |
Notes |
Issue History | |||
Date Modified | Username | Field | Change |
2011-07-08 13:27 | Dan Thill | New Issue | |
2011-07-08 13:45 | Dan Thill | Note Added: 0027019 | |
2011-07-08 14:11 | Alex Neundorf | Note Added: 0027020 | |
2011-07-08 14:34 | Dan Thill | Note Added: 0027021 | |
2011-07-08 14:41 | Alex Neundorf | Note Added: 0027022 | |
2011-07-08 14:41 | Alex Neundorf | Assigned To | => Alex Neundorf |
2011-07-08 14:41 | Alex Neundorf | Status | new => closed |
2011-07-08 14:41 | Alex Neundorf | Resolution | open => no change required |
Issue History |
Copyright © 2000 - 2018 MantisBT Team |