Skip to content

Commit

Permalink
fix(build): fix source_group error in CMakeLists.txt
Browse files Browse the repository at this point in the history
Moved adding ${EXPORT_HEADER} to PUBLIC_HEADERS after calling source_group.
  • Loading branch information
hun1er committed Jun 29, 2023
1 parent aeeb61b commit 999710d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ set(EXPORT_HEADER "${PROJECT_BINARY_DIR}/include/${PNAME_LOWER}/export.hpp")
generate_export_header("${PNAME_LOWER}" EXPORT_FILE_NAME "${EXPORT_HEADER}")

set(PUBLIC_HEADERS
"${EXPORT_HEADER}"
"include/${PNAME_LOWER}/capitalize.hpp"
"include/${PNAME_LOWER}/center.hpp"
"include/${PNAME_LOWER}/const.hpp"
Expand Down Expand Up @@ -129,8 +128,9 @@ set(SOURCES
"src/translate.cpp"
)

list(APPEND PUBLIC_HEADERS "${EXPORT_HEADER}")
source_group(TREE "${PROJECT_SOURCE_DIR}" FILES ${SOURCES})
target_sources("${PNAME_LOWER}" PRIVATE ${SOURCES})
target_sources("${PNAME_LOWER}" PRIVATE "${EXPORT_HEADER}" ${SOURCES})

set_target_properties("${PNAME_LOWER}" PROPERTIES
PUBLIC_HEADER
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ include(FetchContent)
FetchContent_Declare(
StringPy
GIT_REPOSITORY https://github.com/hun1er/stringpy.git
GIT_TAG v1.0.0
GIT_TAG v1.0.1
)
FetchContent_MakeAvailable(StringPy)
Expand Down

0 comments on commit 999710d

Please sign in to comment.