Skip to content

Commit

Permalink
Merge pull request #5 from plorth/fetch-content
Browse files Browse the repository at this point in the history
Switch to CMake's FetchContent
  • Loading branch information
RauliL authored Nov 28, 2024
2 parents f05e92b + bd4e821 commit 77def72
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 deletions.
32 changes: 30 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,27 @@ PROJECT(
LANGUAGES CXX
)

INCLUDE(FetchContent)
INCLUDE(GNUInstallDirs)

FETCHCONTENT_DECLARE(
PeeloResult
GIT_REPOSITORY
https://github.com/peelonet/peelo-result.git
GIT_TAG
v0.6.0
)
FETCHCONTENT_DECLARE(
PeeloUnicode
GIT_REPOSITORY
https://github.com/peelonet/peelo-unicode.git
GIT_TAG
v2.0.0
)

FETCHCONTENT_MAKEAVAILABLE(PeeloResult)
FETCHCONTENT_MAKEAVAILABLE(PeeloUnicode)

ADD_LIBRARY(${PROJECT_NAME} INTERFACE)

TARGET_INCLUDE_DIRECTORIES(
Expand All @@ -19,6 +38,13 @@ TARGET_INCLUDE_DIRECTORIES(
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)

TARGET_LINK_LIBRARIES(
${PROJECT_NAME}
INTERFACE
PeeloResult
PeeloUnicode
)

TARGET_COMPILE_FEATURES(
${PROJECT_NAME}
INTERFACE
Expand Down Expand Up @@ -71,5 +97,7 @@ INSTALL(
include
)

ENABLE_TESTING()
ADD_SUBDIRECTORY(test)
IF(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
ENABLE_TESTING()
ADD_SUBDIRECTORY(test)
ENDIF()
2 changes: 0 additions & 2 deletions requirements.txt

This file was deleted.

0 comments on commit 77def72

Please sign in to comment.