To set the name of the project:
project(foobar)
To use the project name that you set, use ${PROJECT_NAME}
variable. For example, to set the name of the executable produced:
# Produces executable named "foobar"
add_executable(
${PROJECT_NAME}
src/main.cpp
src/helper.cpp
)
Tried with: CMake 2.8.12.2 and Ubuntu 14.04