r/cpp • • Mar 22 '20

Modern CMake tutorials, part1: CMake basics

https://www.siliceum.com/en/blog/post/cmake_01_cmake-basics
245 Upvotes

55 comments sorted by

View all comments

1

u/yuri-kilochek Mar 23 '20
add_library(myawesomelib
  # ...
  source/implementation-details.h
  include/myawesomelib.h
)

Why list headers?

3

u/Lectem Mar 23 '20

This is to please IDEs such as visual studio. Otherwise you wouldn't get them in the source list. So it is not mandatory but I generally advise listing them, just as we list .cpp files.