Using cmake-2.7 out of CVS, I&#39;m trying to override the Find modules which come with cmake install.  In our src tree we have checked in versions of certain dependencies and I would like to set paths to point at those instead of any libraries which may be installed.  In trying to override the behavior of FindExpat I&#39;ve done the following:<br>
<br>0. added a cmake-modules directory to the top of my src tree<br>1. in my top-level CmakeLists.txt file define where we keep our third-party binary packages as ${GlobalExternalDir}<br>2. in my top-level CMakeLists.txt file, prepend this dirpath to CMAKE_MODULE_PATH  with &#39;set (CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake-modules ${CMAKE_MODULE_PATH})&#39;<br>
3. in my cmake-modules directory create a FindExpat.cmake which locates include dir and library in ${GlobalExternalDir} and uses message to report on the found locations<br><br>When I run it, the messages indicate that my FindExpat is being used, instead of the one installed by cmake in /usr/local/share/cmake-2.7/Modules/FindEXPAT.cmake, however my logging out of the Expat_INCLUDE_DIR and Expat_LIBRARY values indicate that sytem libraries are being found instead of the ones in our src tree.  Below is my FindExpat.cmake file contents:<br>
<br># BEGIN FindExpat.cmake<br>message (STATUS &quot;Finding Expat in global dir: ${GlobalExternalDir}&quot;)<br><br>find_path (Expat_INCLUDE_DIR<br>  NAMES expat.h<br>  PATHS ${GlobalExternalDir}/expat/expat-2.0.1/lib<br>
  )<br>message (STATUS &quot;Set Expat_INCLUDE_DIR: ${Expat_INCLUDE_DIR}&quot;)<br><br>find_library (Expat_LIBRARY<br>  NAMES expat<br>  PATHS ${GlobalExternalDir}/expat/expat-2.0.1/bin/linux-x32/release<br>  )<br>message (STATUS &quot;Set Expat_LIBRARY: ${Expat_LIBRARY}&quot;)<br>
<br>if (Expat_INCLUDE_DIR)<br>  set (Expat_FOUND TRUE)<br>  set (Expat_INCLUDE_DIRS ${Expat_INCLUDE_DIR})<br>  set (Expat_LIBRARIES ${Expat_LIBRARY})<br>  message (STATUS &quot;Found Expat&quot;)<br>endif ()<br># END FindExpat.cmake<br>
<br>Any ideas on why this cannot use my local install of expat versus that of the system?<br><br>Many thanks in advance,<br>-allen<br><br>