[CMake] Using name other than CMakeLists.txt

Belcourt, K. Noel kbelco at sandia.gov
Tue Aug 23 22:53:15 EDT 2011


Hi,

Our multi-physics project depends on product build systems using both  
stock CMake 2.8.x and an incompatible fork of CMake which also  
(re)uses the CMake standard project filename (CMakeLists.txt).  We  
need the ability to build this code base with both stock CMake and the  
CMake fork.  We recognize the potential problems with this arrangement  
but we need to support both of these build capabilities for a while.   
I'd like to propose a patch that would replace all character literal  
occurrences of CMakeLists.txt in the CMake source code base with a  
variable that defaults to "CMakeLists.txt", but permit that variable  
to be configured to a different name when running CMake.

This would allow, for example, our project to contain both stock  
CMakeLists.txt files as well as other CMake project files such as  
CMakeLists.Trilinos.  We could then configure this project with the  
Trilinos CMake build variant by running CMake like this:

cmake -D CMAKE_PROJECT_FILENAME=CMakeLists.Trilinos ...

where CMAKE_PROJECT_FILENAME is the new CMake variable.  We've found  
this capability useful for our code coupling environment permitting  
use of a new CMake build variant while retaining use of the stock  
CMake build.  Is there any interest in adding this capability to CMake?

-- Noel Belcourt



More information about the CMake mailing list