Skip to content

Commit

Permalink
Disable installing gtest when cmake --install (#37)
Browse files Browse the repository at this point in the history
* disable INSTALL_GTEST

* update comments
  • Loading branch information
wusatosi authored Oct 1, 2024
1 parent 1ce5d88 commit b8d4b06
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .ci/docker/ubuntu.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

# Using a non-LTS Ubuntu, just until CMake 3.24 is available on Ubuntu 24.04.
# Using a non-LTS Ubuntu, just until CMake 3.25 is available on Ubuntu 24.04
FROM ubuntu:23.10

# Install dependencies,
Expand Down
22 changes: 13 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

# TODO Darius: Find CMake minimum required version.
cmake_minimum_required(VERSION 3.23)
cmake_minimum_required(VERSION 3.25)

project(
beman.exemplar # CMake Project Name, which is also the name of the top-level
Expand All @@ -15,13 +14,18 @@ include(FetchContent)
if(BUILD_TESTING)
enable_testing()

# Fetch GoogleTest
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG f8d7d77c06936315286eb55f8de22cd23c188571 # release-1.14.0
EXCLUDE_FROM_ALL CMAKE_ARGS -DBUILD_TESTING=OFF)
FetchContent_MakeAvailable(googletest)
block()
# Disable installing google test dependency on cmake --install
set(INSTALL_GTEST OFF)

# Fetch GoogleTest
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG f8d7d77c06936315286eb55f8de22cd23c188571 # release-1.14.0
EXCLUDE_FROM_ALL CMAKE_ARGS -DBUILD_TESTING=OFF)
FetchContent_MakeAvailable(googletest)
endblock()
endif()

add_subdirectory(src/beman/exemplar)
Expand Down

0 comments on commit b8d4b06

Please sign in to comment.