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 a CMake option BUILD_TESTS to decide whether to build S2 unit tests #333

Merged
merged 3 commits into from
Nov 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ add_feature_info(SHARED_LIBS BUILD_SHARED_LIBS
"builds shared libraries instead of static.")

option(BUILD_EXAMPLES "Build s2 documentation examples." ON)
option(BUILD_TESTS "Build s2 unittests." ON)

option(WITH_PYTHON "Add python interface" OFF)
add_feature_info(PYTHON WITH_PYTHON "provides python interface to S2")
Expand Down Expand Up @@ -431,8 +432,12 @@ install(TARGETS ${S2_TARGETS}
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")

message("GOOGLETEST_ROOT: ${GOOGLETEST_ROOT}")
if (GOOGLETEST_ROOT)
if (BUILD_TESTS)
if (NOT GOOGLETEST_ROOT)
message(FATAL_ERROR "BUILD_TESTS requires GOOGLETEST_ROOT")
endif()
message("GOOGLETEST_ROOT: ${GOOGLETEST_ROOT}")

add_subdirectory(${GOOGLETEST_ROOT}/googlemock build_gmock)
include_directories(${GOOGLETEST_ROOT}/googlemock/include)
include_directories(${GOOGLETEST_ROOT}/googletest/include)
Expand Down