On Fri, Apr 3, 2009 at 10:03 PM, Naram Qashat <[email protected]>wrote:

> On the project I'm working on, one of the developers expressed interest in
> utilizing gettext to handle internationalization and localization.  I found
> that CMake 2.6.0 and newer have a FindGettext.cmake module which would allow
> us to utilize gettext for this.  However, I've made our CMake build files
> able to function under CMake 2.4.x as well, due to our users compiling our
> software on shells that may not have the latest CMake, and there is no
> FindGettext.cmake with those versions.  Is it possible to include
> FindGettext.cmake in the root directory of my project and utilize that if
> CMake 2.4.x is used?


Naram,

Yes.  You can set CMAKE_MODULE_PATH conditionally based on the value of
CMAKE_MAJOR_VERSION & CMAKE_MINOR_VERSION.

If you've never used CMAKE_MODULE_PATH before I should warn you like most
CMake variables, it doesn't understand relative paths.  You must use
variables like ${PROJECT_SOURCE_DIR} or ${CMAKE_CURRENT_SOURCE_DIR}.

Also, in general if you want to backport modules from 2.6.x to 2.4.x you
have to take into account the HINTS option to find_package() and calls to
include(FindPackageHandleStandardArgs) both of which were added in 2.6.x.
It appears that the FindGetText.cmake hasn't been updated to use these yet
so using it with CMake 2.4 looks like it should be fairly easy.

-- 
Philip Lowman
_______________________________________________
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

Reply via email to