[CMake] export list of files, etags

Brad King brad.king at kitware.com
Tue Jan 10 08:59:14 EST 2006


Eddy Pronk wrote:
> Is there a way to export a list of files from a CMakeLists.txt file?
> OUTPUT_REQUIRED_FILES only works for a source file.
> I'd like a list of source files requered for a target or simply all 
> source files known to cmake.
> I want to use this to create a etags file for emacs.

Dependency scanning is not done at CMake time but at build time.  In 
some environments CMake does the scanning with a separate process 
(Makefiles) and sometimes the native build tool does it (Visual Studio). 
  Therefore not all sources will be known other than those listed when 
the target is created.

The best you can do is create a target like this:

SET(MY_SRCS src1.cxx src2.cxx ...)
ADD_EXECUTABLE(myexe ${MY_SRCS})

and then use CMake's CONFIGURE_FILE, FILE, STRING, and/or FOREACH 
commands to create the etags file for those sources.

-Brad


More information about the CMake mailing list