[CMake] Modules with additional files

Michael Jackson mike.jackson at bluequartz.net
Wed Dec 29 13:22:13 EST 2010


You want to do something like this:

# In the CMake file get the parent directory of the current
# cmake file that is being parsed
get_filename_component( CURRENT_DIR ${CMAKE_CURRENT_LIST_FILE} ABSOLUTE)

configure_file ( ${CURRENT_DIR}/SomeFile.h.in  ...... )

Is that what you were looking for? 
____________________________________________________
Mike Jackson                      www.bluequartz.net

On Dec 29, 2010, at 1:14 PM, Johannes Wienke wrote:

> Hi,
> 
> Sorry for bumping this, but has anyone got a cue how to do this in a
> reliable and easy way?
> 
> Thanks,
> Johannes
> 
> Am 23.12.2010 20:49 schrieb Johannes Wienke:
>> I've got a library that provides several cmake modules and also uses
>> them. Some of these modules have additional files, e.g. to be used with
>> CONFIGURE_FILE. The question is, how do I locate these additional files
>> so that they work in both cases, in project and installed?
>> ${CMAKE_ROOT}/Modules is of course not working and is also a bad
>> assumption for multi-user systems where not everyone is admin. Something
>> like CMAKE_CURRENT_MODULE_DIR would be ideal for my case... Is there a
>> general solution for this problem?
> 
> 
> _______________________________________________
> 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



More information about the CMake mailing list