[CMake] include a Make.rules file?

Sam Miller samm at sammiller.org
Mon Jan 29 10:22:30 EST 2007


On Thu, 2007-01-25 at 23:00 -0800, Brandon J. Van Every wrote:
> Sam Miller wrote:
> > I am trying to convert an hand-rolled Makefile build system into CMake.
> > The project itself is a subset of a larger project, which uses a
> > Make.rules file for various cross compilation rules and install
> > directories.  Is there any way to include this Make.rules file into the
> > Makefile generated by CMake?
> >   
> 
> Sounds inadvisable in general.  If you're going to keep an old system, 
> or work with an old system, you should decide the division of labor 
> between the old and new systems.  

Just an FYI, my solution to my original problem was to run the following
command in my top level CMakeLists.txt file

EXEC_PROGRAM(awk
             ARGS -F= '/DEBUG_FLAGS=/ {print $2}' ../../../Make.rules
             OUTPUT_VARIABLE DEBUG_FLAGS)
MESSAGE(STATUS "DEBUG_FLAGS ${DEBUG_FLAGS}")

to parse the project-wide Make.rules file and grab what I need.  It's
not very graceful, but it works.

My next question: how can I force out-of-source builds?  I'd like to
preserve my component's existing hand rolled Makefile build system while
I am transitioning to cmake.  The obvious solution seems to only allow
out of source builds, is there a way to enforce them?

Regards,
Sam 



More information about the CMake mailing list