Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add option to disable installing g3log for project embedding #333

Merged
merged 2 commits into from
Feb 14, 2020

Conversation

bmagistro
Copy link
Contributor

Based on API.markdown pointing people to Options.cmake no additional documentation was added.

Feature adds the option to skip installing components making it easier to embed this project using cmake's ExternalProject or FetchProject.

The change was modeled after the googletest options.
https://github.com/google/googletest/blob/306f3754a71d6d1ac644681d3544d06744914228/CMakeLists.txt#L30
https://github.com/google/googletest/blob/8c91ecef292e963d23cd5b25f01ea1579fbe9aaa/googletest/CMakeLists.txt#L96

Sample usage (has additional options enabled)

include(FetchContent)

# g3log
set(ADD_FATAL_EXAMPLE OFF CACHE BOOL "g3log examples" FORCE)
set(USE_DYNAMIC_LOGGING_LEVELS ON CACHE BOOL "g3log custom level support" FORCE)
set(G3_SHARED_LIB OFF CACHE BOOL "g3log static lib" FORCE)
set(INSTALL_G3LOG OFF CACHE BOOL "g3log install" FORCE)

FetchContent_Declare(
  g3log
  GIT_REPOSITORY https://github.com/KjellKod/g3log.git
  GIT_TAG        1.3.2
)

FetchContent_GetProperties(g3log)
if(NOT g3log_POPULATED)
  FetchContent_Populate(g3log)
  add_subdirectory(${g3log_SOURCE_DIR} ${g3log_BINARY_DIR})
endif()
# g3log

@KjellKod
Copy link
Owner

KjellKod commented Feb 5, 2020

Looks good. Will verify manually just in case later today

@KjellKod KjellKod merged commit 3ffc36a into KjellKod:master Feb 14, 2020
@bmagistro bmagistro deleted the optional-install branch December 17, 2022 14:43
bmagistro added a commit to bmagistro/g3sinks that referenced this pull request Dec 17, 2022
This is modeled off the work done in KjellKod/g3log#333

Signed-off-by: Ben Magistro <koncept1@gmail.com>
bmagistro added a commit to bmagistro/g3sinks that referenced this pull request Dec 17, 2022
This is modeled off the work done in KjellKod/g3log#333

Signed-off-by: Ben Magistro <koncept1@gmail.com>
KjellKod pushed a commit to KjellKod/g3sinks that referenced this pull request Jan 12, 2023
* add option to disable installing g3sinks for projects embedding
This is modeled off the work done in KjellKod/g3log#333
* Resolve duplicate target name
This changes the clean target name used in sinks so that it does not
overlap with that of g3log.
KjellKod pushed a commit to KjellKod/g3sinks that referenced this pull request Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants