s2geometry icon indicating copy to clipboard operation
s2geometry copied to clipboard

build: add options in cmake to skip some building parts

Open neverchanje opened this issue 5 years ago • 1 comments

Hi, we included s2geometry as one of the dependencies for our project. To reduce the building time (and complexity) of s2geometry, we want to make some building parts optional and skippable. So in this PR, I add several CMake options, including:

  1. BUILD_TESTING for unit tests.
  2. BULID_PYTHON for Python interfaces.

This PR is tested on my platform:

cmake .. -DBUILD_PYTHON=OFF -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=OFF -DBUILD_EXAMPLES=OFF -DGTEST_ROOT=/home/wutao1/git/googletest/googletest
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The following features have been disabled:

 * GFLAGS, allows changing command line flags.
 * GLOG, provides logging configurability.
 * SHARED_LIBS, builds shared libraries instead of static.

-- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libcrypto.so (found version "1.0.2n")  
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
GTEST_ROOT: /home/wutao1/git/googletest/googletest
-- Found PythonInterp: /usr/bin/python (found version "2.7.17") 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/wutao1/git/s2geometry/build

neverchanje avatar Jul 23 '20 11:07 neverchanje

Hi, this PR has passed all the Travis tests. Could anyone please have a look?

neverchanje avatar Jul 28 '20 03:07 neverchanje