I have a library project for header only. In my CMakeLists.txt I use the INTERFACE library type
I wanted to import this project into CLion, but when I open any of the header files, the IDE complains that this file does not belong to any project goal
So is there a way to develop a project for headers only in CLion?
The layout of the test project is quite simple:
% tree foo
foo
├── CMakeLists.txt
└── foo.hpp
And the contents of CMakeLists
cmake_minimum_required(VERSION 3.8)
project(foo)
add_library(foo INTERFACE)
target_include_directories(foo INTERFACE ${PROJECT_SOURCE_DIR})
target_sources(foo INTERFACE ${PROJECT_SOURCE_DIR}/foo.hpp)
CLion 2017.2 + CMake 3.8
source
share