diff --git a/CMakeLists.txt b/CMakeLists.txt index 62d411e9..956c82f2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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}) + include_directories(${Python3_INCLUDE_DIRS}) +endif() include_directories(src) add_library(s2 @@ -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} @@ -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)