automatic discovery of new CMake projects

Hi all,

The suggested patch enables addition of all subdirectories of llvm/projects to CMake build.

It somewhat simplifies the process of creating new projects that use CMake instead of make, eliminating the need of editing llvm/CMakeLists.txt and llvm/projects/CMakeLists.txt.

Best regards,

Victor

cmake_projects.patch (682 Bytes)

Sorry, attached the wrong patch last time.

cmake_projects.patch (717 Bytes)

"Viktar Zviarovich" <Viktar.Zviarovich@brunel.ac.uk> writes:

The suggested patch enables addition of all subdirectories of
llvm/projects to CMake build.

It somewhat simplifies the process of creating new projects that use
CMake instead of make, eliminating the need of editing
llvm/CMakeLists.txt and llvm/projects/CMakeLists.txt.

This is not considered a good practice. The reason is that it requires
an explicit cmake invocation everytime you add or remove a new
project. This can be obvious for you (the person who creates the
project) but someone updating his svn working copy would not notice that
an explicit re-run of cmake is required.

OTOH, if the projects/ dir is some kind of "local playground" for LLVM
users, it wouldn't a serious problem, as the changes made there are not
intended to be committed to the svn server. But anyways you should
mention the requirement for the explicit cmake invocation on
projects/CMakeLists.txt or the on the LLVM CMake doc (or on both).

Hi Óscar,

Thank you for the reply. I indeed got an impression (may be incorrect) that projects/ directory is intended for users' projects that are not committed to LLVM repository. Otherwise, of course, the patch doesn't make much sense. Anyway, I've added a comment about the need of explicit CMake invocation to projects/CMakeLists.txt.

Thanks,
Victor

cmake_projects.patch (883 Bytes)

"Viktar Zviarovich" <Viktar.Zviarovich@brunel.ac.uk> writes:

[snip]

Applied. Thanks!