[CMake] Modules with additional files

Johannes Wienke jwienke at techfak.uni-bielefeld.de
Wed Dec 29 13:51:32 EST 2010


Am 29.12.2010 19:22 schrieb Michael Jackson:
> 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? 

The problem is that I am not in a list file, but in a module. Hence,
CMAKE_CURRENT_LIST_FILE does not work.

For example I got a module that test some features using a cpp file that
needs to be try-compiled and I now need a way to locate this cpp-file.
All default cmake modules use something like CMAKE_ROOT, but I cannot
assume this.

Regards,
Johannes

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://www.cmake.org/pipermail/cmake/attachments/20101229/2dc9eb9c/attachment.pgp>


More information about the CMake mailing list