Thanks Alex, I think this is a great step in the right direction. IMHO, Standardizing the variable naming convention and the interface of all Find modules is important.
However, during the discussion for submitting the current FindwxWidgets.cmake module (Bug #3443) Brad King pointed out: "...I've been trying to change the convention away from all-uppercase and instead make ALL the XXX_* variables match the case of the file name FindXXX.cmake. Therefore the vars should be wxWidgets_FOUND, wxWidgets_LIBS, etc. The reason is that when packages are converted to CMake they may provide a FooConfig.cmake file and then the variables will be in mixed-case because that is the way FIND_PACKAGE works." I realize that a lot, if not most, of the current FindXxx modules follow the uppercase convention, but if the desire is to move to having the same prefix as the name (i.e., Xxx for FindXxx), then the correct variable should be Xxx_FOUND and not the upper cased version necessarily. Also note that the variables set automatically when FIND_PACKAGE is called follow the Xxx_ prefix (e.g., Xxx_FIND_COMPONENTS not XXX_FIND_COMPONENTS). Since many of the modules are broken according to the desired behavior, I think the best thing to do is create a glue code for mapping new variables to old ones at the end of each broken module. Also, a standard process for deprecation should be adopted so that eventually the glue code is removed. --Miguel On 7/19/07, Alexander Neundorf <[EMAIL PROTECTED]> wrote:
Hi, since yesterday cmake cvs HEAD has a new macro FIND_PACKAGE_HANDLE_STANDARD_ARGS(name var1 ...) which can be used to handle the <name>_FIND_REQUIRED and <name>_FIND_QUIETLY variables in FindXXX.cmake files. Additionally it sets <name>_FOUND to TRUE or FALSE depending on the value of all variables given as parameter. I changed most of the not-too-complicated FindXXX.cmake modules so that they now use this macro. Additionally in some of the FindXXX.cmake modules there were calls like FIND_PATH(FOO_INCLUDE_DIR foo.h /usr/local/include /usr/include ) Since quite some time these standard paths don't have to be listed anymore, so I removed them. In some places I added a PATH_SUFFIXES argument (e.g. gtk, SDL). So if there is a module in cmake cvs you have contributed or which you are using heavily, please check that it still works as expected. If you are writing cmake modules outside cmake cvs, consider copying FindPackageHandleStandardArgs.cmake to your project so you can use it in your modules too, and we get a consistent behaviour among the cmake modules. Thanks Alex _______________________________________________ CMake mailing list [email protected] http://www.cmake.org/mailman/listinfo/cmake
_______________________________________________ CMake mailing list [email protected] http://www.cmake.org/mailman/listinfo/cmake
