I have created a simple library project in C++ and added CMake file to automatically generate a Visual Studio project. My small project contains only 2 files:
include/
testproject/
testproject.h
src/
testproject.cpp
CMakeLists.txt
Header file now in External Dependencies (screenshot). How to display it in the section "Headers"? (or any other. Just not "External Dependencies")
CMakeLists.txt:
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
SET(PROJECTNAME testproject)
PROJECT(${PROJECTNAME})
FILE(GLOB MY_HEADERS "include/*.h")
FILE(GLOB MY_SOURCES "src/*.cpp")
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
ADD_LIBRARY(
${PROJECTNAME} STATIC
${MY_HEADERS} ${MY_SOURCES}
)
Note: If change dirs struct to
include/
testproject.h
src/
testproject.cpp
CMakeLists.txt
result will be like on a screenshot. Header file in "Header files". But I need in previous project structure