I have just created an interface library called "foo". Now I would like to include each of the modules of foo like this:
#include "foo/module.h"
Right now, I always have to write the include path as following
#include "foo/include/module.h"
Is it somehow possible to tell Cmake to ignore the "include" within the path? My CMakelists.txt of the Interface lib foo looks like this:
add_library(foo INTERFACE)
target_include_directories(foo INTERFACE
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
An the main CMakeLists.txt looks like this:
cmake_minimum_required(VERSION 3.22.1)
project(project)
add_executable(${PROJECT_NAME} main.cpp)
add_subdirectory(foo)
target_link_libraries(${PROJECT_NAME} foo)
What am I doing wrong? Is there anyone who can help me with this?
Thank you very much in advance!
Best regards,
Simon