How do I make a CMakeLists with only one cpp file and two .h files?

67 Views Asked by At

I have a file called proj10.cpp and two different .h files which are in a include folder and the .cpp file is in the src folder. I have no idea how to make the CMake file since the other ones ive done have had multiple .cpp files.

1

There are 1 best solutions below

0
On

I don't know where the problem is, but anyway, you could try this:

cmake_minimum_required (VERSION 3.7)
project (proj10)

add_executable(${CMAKE_PROJECT_NAME} src/proj10.c)
target_include_directories(${CMAKE_PROJECT_NAME} PUBLIC include)

for the next time, it would easier for us, if you show us what you've coded so far.