[CMake] How to rename the resulting Makefile.

william.crocker at analog.com william.crocker at analog.com
Tue Oct 12 11:14:38 EDT 2010


>>
>> [ elided ]
>>
>> So, is there a command I can place in my CMakeLists.txt files
>> which will cause them to produce a file named xyz.make (let's say)
>> instead of Makefile.
>>
>> Thanks in advance.
> 
> Use out of source builds, and there should be no-conflict.  There is no 
> way to rename the makefiles.
> 
> mkdir build
> cd build.
> cmake ../path/to/source
> make
> 

Okay. I see that OOS builds can create Makefiles without clobbering
my existing Makefile, but then I do not have convenient access to my Makefiles
and the convenience targets they contain from the OOS dir.

I still think Qt/qmake was right in providing the ability to change
the name of the Makefile. Before I discovered that, I could not use
the qmake system.

Below is typical of what my Makefile contains:
Convenience targets (all in one place) and a call to the makefile
created by qmake (myapp.make). In this way qmake does not have to solve
the whole problem, just contribute a part of the solution.

Thanks.

Bill

------------------

myapp : always
         make -f myapp.make

save : always
         mkdir -p save_dir
         /bin/cp -pr *.h *.cc *.lyx *.xml *.xsl *.txt *.css Makefile save_dir



More information about the CMake mailing list