Skip to content

Commit 61c9903

Browse files
committed
CMake: fix comment about why headers are treated as source
It's not to make dependency checks work (they'll work regardless). The usual reason to add header files is so they get included in generated IDE projects (like for Visual Studio).
1 parent c1e2fe8 commit 61c9903

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

CMakeLists.txt

+2-4
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ src/ActiveSocket.cpp
2121
src/PassiveSocket.cpp
2222
)
2323

24-
# append to sources so that dependency checks work on headers
25-
LIST(APPEND CLSOCKET_SOURCES ${CLSOCKET_HEADERS})
26-
2724
OPTION(BUILD_SHARED_LIBS "Build libs as shared" ON)
2825
if(DEFINED CLSOCKET_SHARED)
2926
message(FATAL_ERROR "The CLSOCKET_SHARED option is deprecated, instead use BUILD_SHARED_LIBS.")
@@ -33,7 +30,8 @@ if(DEFINED CLSOCKET_DEP_ONLY)
3330
endif()
3431

3532
# make the lib
36-
ADD_LIBRARY(clsocket ${CLSOCKET_SOURCES})
33+
# add headers so that they appear in IDEs
34+
ADD_LIBRARY(clsocket ${CLSOCKET_SOURCES} ${CLSOCKET_HEADERS})
3735
target_include_directories(clsocket PUBLIC src)
3836
if(WIN32)
3937
add_definitions(-D_WINSOCK_DEPRECATED_NO_WARNINGS)

0 commit comments

Comments
 (0)