-- Mike Jackson <www.bluequartz.net> On Dec 29, 2010, at 1:51 PM, Johannes Wienke wrote:
> 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 > I don't understand what you mean by a "module". If you are in a CMakeLists.txt or *.cmake file that is being parsed by CMake then you have access to CMAKE_CURRENT_LIST_FILE. I think I am missing something about your particular setup. Maybe some more details would help us. ___________________________________________________________ Mike Jackson www.bluequartz.net Principal Software Engineer mike.jack...@bluequartz.net BlueQuartz Software Dayton, Ohio _______________________________________________ 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