Re: [CMake] Getting Location of This File

2015-07-25 Thread David Cole via CMake
I think http://www.cmake.org/cmake/help/v3.3/variable/CMAKE_CURRENT_LIST_FILE.html is exactly what you're asking for, and will work in most contexts you're thinking of. (Configuring from a top level or sub-directory CMakeLists file, in an included file, running a CMake -P script file...) The only

Re: [CMake] Getting Location of This File

2015-07-24 Thread J Decker
On Fri, Jul 24, 2015 at 9:30 PM, Daniel Dilts wrote: > Yes, ${CMAKE_CURRENT_SOURCE_DIR} has the path to the CMakeLists.txt file > that has the include() command. Is there a variable with the path of the > file referenced by the include() command? > Could define such a variable before the include

Re: [CMake] Getting Location of This File

2015-07-24 Thread Daniel Dilts
Yes, ${CMAKE_CURRENT_SOURCE_DIR} has the path to the CMakeLists.txt file that has the include() command. Is there a variable with the path of the file referenced by the include() command? On Fri, Jul 24, 2015 at 7:40 PM, J Decker wrote: > ${CMAKE_SOURCE_DIR} - path of the root cmake file calle

Re: [CMake] Getting Location of This File

2015-07-24 Thread J Decker
${CMAKE_SOURCE_DIR} - path of the root cmake file called ${CMAKE_CURRENT_SOURCE_DIR} - path of the current cmakelists On Fri, Jul 24, 2015 at 3:02 PM, Daniel Dilts wrote: > I have a set of CMake commands that I want to place in a single file and > have other projects use it. The commands in th

[CMake] Getting Location of This File

2015-07-24 Thread Daniel Dilts
I have a set of CMake commands that I want to place in a single file and have other projects use it. The commands in the file must affect the scope that references it, so the declared functions, include_directories, etc. must affect things in the scope that includes it. I attempted to place these