[CMake] Can "Make help" be set less verbose?

KSpam keesling_spam at cox.net
Tue Oct 2 12:15:54 EDT 2007


Robert,

I used to have the same problem until I restructured my project.  The trick is 
NOT to list source files in the top-level CMakeLists.txt file.

For example, this will give you a list of intermediate targets (.o .i .s) in 
the help:

	#---
	# Top-level CMakeLists.txt
	#---

	PROJECT(CoolStuff)
	ADD_EXECUTABLE(coolStuff src/foo.cpp src/bar.cpp)

On the other hand, this will produce a cleaner help:

	#---
	# Top-level CMakeLists.txt
	#---

	ADD_DIRECTORY(src)

	#---
	# src/CMakeLists.txt
	#---

	PROJECT(CoolStuff)
	ADD_EXECUTABLE(coolStuff foo.cpp bar.cpp)

I hope that this helps.

Justin

On Tuesday 02 October 2007 08:18:41 Atwood, Robert C wrote:
> Hi,
> I have a project with lots of c files that I am trying to place under
> Cmake. And, I must say , it is working really well ! But ... Since there
> are lots of c files, the list of possible targets returned by
> 'make help', after running cmake, is rather useless (unless run though
> 'head -8' or 'more')
> Is there an option somewhere to suppress inclusion of all the single
> file targets (.o, .i, .s ) in the 'make help' output? Nobody really
> wants to know about those ... do they ;-?
>
> Thanks!
> Robert


More information about the CMake mailing list