[CMake] Formatting CMakeLists

John Drescher drescherjm at gmail.com
Thu Aug 23 11:45:04 EDT 2012


On Thu, Aug 23, 2012 at 11:39 AM, Jason T. Slack-Moehrle
<slackmoehrle at gmail.com> wrote:
> A few questions on formatting the CMakeLists file.
>
> Is there sort of a "template" that everyone uses to ensure not
> overwriting options, etc?
>
> Second, when using commands like:
>
> SET( CORE_SOURCE_FILES "main.cpp" )
>
> can I break lines like:
>
> SET( CORE_SOURCE_FILES "main.cpp"
> "file1.cpp"
> "file2.cpp"
> )
>
Yes.

Here is an example I have from one open project.

SET( ${PROJECT_NAME}_SRCS
	./src/main.cxx
	./src/MainWindow.cxx
	./src/dbDev2App.cxx
	./src/CmdCounterBalanceStudyModes.cxx
	./src/CmdExportTable.cxx
)

> and do I have to use the quotes ("") around the source file names?
>

You do not need quotes around the source file names if there are no
spaces in the file names.

John


More information about the CMake mailing list