i have some .cpp files and their headers as includes in separate folders how i should write CMakeLists.txt for them . i can't write their address so compiler gets error like this -> no such file
Here is a simple example for CMake for a multiple files project. You will need to adapt it your own case:
 |-- CMakeLists.txt <<---- cMAKEfile
 |-- include
 |   \-- header.h
 \-- src
     |-- header.cpp
     \-- main.cpp
Your CMakeLists.txt should look as follows:
project(test)
include_directories(include)
file(GLOB SOURCES "src/*.cpp")
add_executable(test ${SOURCES})
Then you can execute cmake and make commands.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With