I have a CMake project with folder structure like this:
├── CMakeLists.txt
├── conanfile.py
├── include
│ └── algorithm.h
├── src
│ └── algorithm.cpp
└── test_package
├── CMakeLists.txt
├── conanfile.py
└── src
└── example.cpp
In my test_package/src/example.cpp, I have an example.cpp
file like this
#include "algorithm.h"
#include <vector>
#include <string>
int main() {
algorithm();
}
How can I make CMake to build my project so that my include/algorithm.h
will be imported as foundation/algorithm.h
for examples by others who consume my library??
My current CMake file is like this
cmake_minimum_required(VERSION 3.15)
project(algorithm CXX)
add_library(algorithm src/algorithm.cpp)
target_include_directories(algorithm PUBLIC include)
set_target_properties(algorithm PROPERTIES PUBLIC_HEADER "include/algorithm.h")
install(TARGETS algorithm)