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

Make python and testing optional #170

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
11 changes: 10 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ endif()
# OPENSSL_ROOT_DIR=/usr/local/opt/openssl cmake ..
include_directories(
${GFLAGS_INCLUDE_DIRS} ${GLOG_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR}
${Python3_INCLUDE_DIRS})
)
if (${Python3_FOUND})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to make this more explicit, like option(WITH_PYTHON, ...). Otherwise, we just silently don't get python, which could be confusing.

include_directories(${Python3_INCLUDE_DIRS})
endif()
include_directories(src)

add_library(s2
Expand Down Expand Up @@ -200,10 +203,12 @@ add_library(s2
src/s2/util/math/exactfloat/exactfloat.cc
src/s2/util/math/mathutil.cc
src/s2/util/units/length-units.cc)
if (GTEST_ROOT)
add_library(s2testing STATIC
src/s2/s2builderutil_testing.cc
src/s2/s2shapeutil_testing.cc
src/s2/s2testing.cc)
endif()
target_link_libraries(
s2
${GFLAGS_LIBRARIES} ${GLOG_LIBRARIES} ${OPENSSL_LIBRARIES}
Expand Down Expand Up @@ -414,7 +419,11 @@ install(FILES src/s2/util/math/mathutil.h
install(FILES src/s2/util/units/length-units.h
src/s2/util/units/physical-units.h
DESTINATION include/s2/util/units)
if (GTEST_ROOT)
install(TARGETS s2 s2testing DESTINATION lib)
else()
install(TARGETS s2 DESTINATION lib)
endif()

message("GTEST_ROOT: ${GTEST_ROOT}")
if (GTEST_ROOT)
Expand Down