2017-03-06 11:39:27 +08:00
|
|
|
cmake_minimum_required(VERSION 3.2)
|
2017-01-21 22:04:10 +08:00
|
|
|
project(xlnt_all)
|
2015-11-03 03:22:13 +08:00
|
|
|
|
2016-10-28 06:40:20 +08:00
|
|
|
# This indicates to CMakeLists in subdirectories that they are part of a larger project
|
2017-01-21 22:04:10 +08:00
|
|
|
set(COMBINED_PROJECT TRUE)
|
2016-10-26 08:21:58 +08:00
|
|
|
|
2017-03-02 21:41:17 +08:00
|
|
|
option(BUILD_DEPS "Set to ON to build zlib and cryptopp from source otherwise system libraries will be used for these" OFF)
|
|
|
|
|
2016-10-26 08:21:58 +08:00
|
|
|
# Library type
|
2016-10-28 06:40:20 +08:00
|
|
|
option(STATIC "Set to ON to build ${PROJECT_NAME} as a static library instead of a shared library" OFF)
|
2016-10-26 08:21:58 +08:00
|
|
|
|
|
|
|
# Optional components
|
2016-10-28 06:40:20 +08:00
|
|
|
option(SAMPLES "Set to ON to build executable code samples (in ./samples)" OFF)
|
|
|
|
option(BENCHMARKS "Set to ON to build performance benchmarks (in ./benchmarks)" OFF)
|
2016-10-26 08:21:58 +08:00
|
|
|
|
|
|
|
# Platform specific options
|
|
|
|
if(NOT MSVC)
|
2016-10-28 06:40:20 +08:00
|
|
|
option(COVERAGE "Generate coverage data using gcov" OFF)
|
2015-10-27 04:54:21 +08:00
|
|
|
endif()
|
|
|
|
|
2016-10-26 08:21:58 +08:00
|
|
|
# Add components according to selected options
|
2016-10-28 06:40:20 +08:00
|
|
|
if(SAMPLES)
|
2016-10-26 08:21:58 +08:00
|
|
|
add_subdirectory(samples)
|
|
|
|
endif()
|
2015-10-15 01:16:25 +08:00
|
|
|
|
2016-10-28 06:40:20 +08:00
|
|
|
if(BENCHMARKS)
|
2016-10-26 08:21:58 +08:00
|
|
|
add_subdirectory(benchmarks)
|
2015-11-04 12:02:43 +08:00
|
|
|
endif()
|
|
|
|
|
2016-12-14 16:27:09 +08:00
|
|
|
find_package(PythonInterp)
|
|
|
|
|
|
|
|
if(PYTHONINTERP_FOUND)
|
|
|
|
add_subdirectory(tests)
|
|
|
|
else()
|
|
|
|
message("Python couldn't be found in the current PATH but is required for building tests. Tests will be skipped for now.")
|
|
|
|
endif()
|
|
|
|
|
2016-10-26 08:21:58 +08:00
|
|
|
add_subdirectory(source)
|