Skip to content

Commit 9492b7f

Browse files
authored
Added public headers as private target sources. (#1978)
The change does not affect the build process, but it helps IDEs recognize that the headers are part of the project and affect them. (e.g. VS Rename tooling)
1 parent 1475cef commit 9492b7f

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

Common++/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ set(
3535
# Set the public header that will be installed
3636
set_property(TARGET Common++ PROPERTY PUBLIC_HEADER ${public_headers})
3737

38+
target_sources(Common++ PRIVATE ${public_headers})
39+
3840
target_compile_features(Common++ PUBLIC cxx_std_14)
3941

4042
target_include_directories(

Packet++/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ set(
157157
# Don't use set_target_properties CMake limit to 50 elements
158158
set_property(TARGET Packet++ PROPERTY PUBLIC_HEADER ${public_headers})
159159

160+
target_sources(Packet++ PRIVATE ${public_headers})
161+
160162
target_compile_features(Packet++ PUBLIC cxx_std_14)
161163

162164
target_include_directories(

Pcap++/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ endif()
6464

6565
set_property(TARGET Pcap++ PROPERTY PUBLIC_HEADER ${public_headers})
6666

67+
target_sources(Pcap++ PRIVATE ${public_headers})
68+
6769
target_compile_features(Pcap++ PUBLIC cxx_std_14)
6870

6971
if(APPLE)

0 commit comments

Comments
 (0)