Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CMakeLists.txt: (add_executable): No SOURCES given to target: Tutorial [closed]

Tags:

c++

cmake

While going through the CMake Tutorials Page and on Step 1, I saved the CMakeLists.txt file with the following lines of code:

cmake_minimum_required(VERSION 3.10)

# set the project name and version
project(Tutorial VERSION 1.0)

# add the executable
add_executable(Tutorial tutorial.cxx)

Running this generates an error stating that the tutorial.cxx is not found.

I do not have the tutorial.cxx but the tutorial itself does not have any description where to get started or how to create the tutorial.cxx file. How can I find the Help/guide/tutorial directory that is described in the tutorial text?

like image 698
Ben Avatar asked Nov 20 '19 23:11

Ben


1 Answers

The introduction on the same page describes where the code is located within the CMake source code repository (see bolded section below):

The CMake tutorial provides a step-by-step guide that covers common build system issues that CMake helps address. Seeing how various topics all work together in an example project can be very helpful. The tutorial documentation and source code for examples can be found in the Help/guide/tutorial directory of the CMake source code tree. Each step has its own subdirectory containing code that may be used as a starting point. The tutorial examples are progressive so that each step provides the complete solution for the previous step.

Where can you find the CMake source code? Look here:

  • GitHub
  • CMake Downloads Page (Source Distributions)
like image 170
Kevin Avatar answered Oct 30 '22 23:10

Kevin