[CMake] Macro Problem

Brian Davis bitminer at gmail.com
Wed Jul 14 14:41:36 EDT 2010

In regards to this topic *in my opinion* linking directory structure/level
to CMake CFLAGS is not a good design (on the part of CMake)... again *in my

I would prefer there was project level (and ability to inherit project level
settings from another project using the project() where project could use
project(myProject INHERIT myOtherProject) and add_subdirectory level
inheritance with the addition concept of namespaces.

Namespaces, which do not exist, would allow use of add_subdirectory with
third party source and could prepend CMAKE_C_FLAGS with the project name if
add_subdirectory allowed the use of a project name specification such as:
add_subdirectory( directory PROJECT myProjectName).   Then CMAKE_C_FLAGS
would become myProjectName.CMAKE_C_FLAGS and any use of CACHE STRING ""
FORCE in the added subdirectory would change myProjectName.CMAKE_C_FLAGS and
not the global (argh) CMAKE_C_FLAGS.

With these changes to CMake a programmer could add more easily 3rdParty
packages with add_subdirectory and not have CMAKE_C_FLAGS get blasted away
by each 3rd party package.

For anyone interested in why I want/desire this please see "Build Only What
You Need In Third Party Packages":

if your having difficulty with global CFLAGS and subdir project
inheritance.... I feel your pain.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100714/71517222/attachment.htm>

More information about the CMake mailing list