How about the good old globbing?
FILE(GLOB MyCSources *.c)
ADD_EXECUTABLE(MyExecutable ${MyCSources})
More Related Contents:
- Passing the argument to CMAKE via command prompt
- CMAKE_MAKE_PROGRAM not found
- Generic rule from makefile to CMake
- What is the purpose of .PHONY in a Makefile?
- Make error: missing separator
- Passing additional variables from command line to make
- OS detecting makefile
- What is the difference between the GNU Makefile variable assignments =, ?=, := and +=?
- Define make variable at rule execution time
- What do @, – and + do as prefixes to recipe lines in Make?
- What do the makefile symbols $@ and $< mean?
- What’s the opposite of ‘make install’, i.e. how do you uninstall a library in Linux?
- Make: how to continue after a command fails?
- How do you get the list of targets in a makefile?
- Create directories using make file
- How to get current relative directory of your Makefile?
- How do I check if file exists in Makefile so I can delete it?
- Is it possible to set CFLAGS to a linux kernel module Makefile?
- Best practice for building a make file
- Building C-program “out of source tree” with GNU make
- What are Makefile.am and Makefile.in?
- make *** no targets specified and no makefile found. stop
- Makefile ifeq logical or
- CFLAGS vs CPPFLAGS
- Makefile header dependencies
- Create a variable in a makefile by reading contents of another file
- Why are .PHONY implicit pattern rules not triggered?
- Force gnu make to rebuild objects affected by compiler definition
- Make error of mixed implicit and normal rules
- tar: file changed as we read it