Skip to content

Commit

Permalink
cmake: add headers to interface library
Browse files Browse the repository at this point in the history
cmake 3.19 allows headers to be added to interface libraries in order to
populate IDE projects
  • Loading branch information
timblechmann committed Mar 24, 2023
1 parent 1edfba0 commit 2ef4d35
Showing 1 changed file with 5 additions and 0 deletions.
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)
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

0 comments on commit 2ef4d35

Please sign in to comment.