Setting <name>_DIR variables with Find_Package (UNCLASSIFIED)

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Setting <name>_DIR variables with Find_Package (UNCLASSIFIED)

Leiter, Kenneth (Cont, ARL/CISD)
Setting <name>_DIR variables with Find_Package (UNCLASSIFIED)

Classification:  UNCLASSIFIED
Caveats: NONE
 

I am attempting to make a Find_Package command more user friendly but am running into problems.  The package I am trying to include in my project is Xdmf.

Currently, a user must point to <Xdmf-Install-Directory>/lib/XdmfCMake in order to successfully find XDMFConfig.cmake.  However, some users find this confusing and would like the ability to just point XDMF_DIR to the <Xdmf-Install-Directory> and have some CMake logic find the correct path to XDMFConfig.cmake.  I am having problems coming up with what I thought would be a simple change.  I have the following after several attempts:

SET(XDMF_DIR_OLD ${XDMF_DIR})

#Include XDMF
FIND_PACKAGE(XDMF QUIET)

IF(NOT XDMF_FOUND)
  SET(XDMF_DIR ${XDMF_DIR_OLD}/lib/XdmfCMake)
  MESSAGE(${XDMF_DIR})
  FIND_PACKAGE(XDMF REQUIRED)
ENDIF(NOT XDMF_FOUND)

This almost works.  I can generate a makefile successfully when the user inputs either  <Xdmf-Install-Directory>/lib/XdmfCMake or <Xdmf-Install-Directory> .  However, in the latter case, XDMF_DIR in the gui still shows the value as XDMF_DIR-NOTFOUND.  How do I get the gui to show the properly updated path?  Does anyone know of a better way to do this?

Thanks,
Ken

---------------------------------------------------------
Kenneth Leiter
Scientific Visualization Team
Lockheed Martin / ARL DoD Supercomputing Resource Center


 
Classification:  UNCLASSIFIED
Caveats: NONE


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

smime.p7s (7K) Download Attachment