[CMake] temporary build directory for header files

Mike Jackson mike.jackson at bluequartz.net
Fri Oct 16 13:01:17 EDT 2009


configure_file(InputFile OutputFile  [COPYONLY] [ESCAPE_QUOTES] [@ONLY])

The Input and Output files have to have full paths. This command
replaces any variables in the input file referenced as ${VAR} or @VAR@
with their values as determined by CMake. If a variable is not
defined, it will be replaced with nothing. If COPYONLY is specified,
then no variable expansion will take place. If ESCAPE_QUOTES is
specified then any substituted quotes will be C-style escaped. The
file will be configured with the current values of CMake variables. If
@ONLY is specified, only variables of the form @VAR@ will be replaces
and ${VAR} will be ignored. This is useful for configuring scripts
that use ${VAR}. Any occurrences of #cmakedefine VAR will be replaced
with either #define VAR or /* #undef VAR */ depending on the setting
of VAR in CMake


You could try that and copy the file where ever you need it. You could
also use the "include_directories" to add  /root/subproject1/ to the
include directories.
_________________________________________________________
Mike Jackson                  mike.jackson at bluequartz.net
BlueQuartz Software                    www.bluequartz.net
Principal Software Engineer                  Dayton, Ohio




On Fri, Oct 16, 2009 at 12:13 PM, James C. Sutherland
<James.Sutherland at utah.edu> wrote:
> I have a fairly large project where the header files from various
> subdirectories are combined into a single include directory when the project
> is installed.
>
> For example, header "a.h" may be located in:
>        /root/subproject1/
> in the source tree, it is located in
>        /include/MyProject/
> in the installation.
>
> However, we have some demo files that also serve as source for some tests.
>  These files expect the installed header configuration, not the source
> header configuration.  For example, they include
>        #include <MyProject/a.h>
> rather than
>        #include <subproject/a.h>
> or
>        #include <a.h>
>
> So is there a way of moving header files to a specific location in the build
> tree (like a pre-install)?  I am looking for something similar to setting
>        CMAKE_LIBRARY_OUTPUT_DIRECTORY
> for library files to collect them into one location as they are built.
>
> Any tips would be greatly appreciated!
>
> James
> _______________________________________________
> 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