Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ PROJECT (msgpack-cxx LANGUAGES CXX)

ADD_LIBRARY (msgpack-cxx INTERFACE)

IF (CMAKE_VERSION VERSION_GREATER_EQUAL 3.19)
FILE(GLOB_RECURSE SOURCE_FILES include/*hpp)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
FILE(GLOB_RECURSE SOURCE_FILES include/*hpp)
FILE(GLOB_RECURSE SOURCE_FILES include/*.hpp)

I read https://cmake.org/cmake/help/v3.7/command/file.html globbing-expressions examples.
It seems that *.hpp can avoid unexpected match.

TARGET_SOURCES(msgpack-cxx PRIVATE ${SOURCE_FILES})
ENDIF()

FILE (READ ${CMAKE_CURRENT_SOURCE_DIR}/include/msgpack/version_master.hpp contents)
STRING (REGEX MATCH "#define MSGPACK_VERSION_MAJOR *([0-9a-zA-Z_]*)" NULL_OUT ${contents})
SET (VERSION_MAJOR ${CMAKE_MATCH_1})
Expand Down