|
| 1 | +# Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +# or more contributor license agreements. See the NOTICE file |
| 3 | +# distributed with this work for additional information |
| 4 | +# regarding copyright ownership. The ASF licenses this file |
| 5 | +# to you under the Apache License, Version 2.0 (the |
| 6 | +# "License"); you may not use this file except in compliance |
| 7 | +# with the License. You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, |
| 12 | +# software distributed under the License is distributed on an |
| 13 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +# KIND, either express or implied. See the License for the |
| 15 | +# specific language governing permissions and limitations |
| 16 | +# under the License. |
| 17 | + |
| 18 | +cmake_minimum_required(VERSION 3.25) |
| 19 | + |
| 20 | +if(NOT CMAKE_BUILD_TYPE) |
| 21 | + set(CMAKE_BUILD_TYPE Debug) |
| 22 | +endif() |
| 23 | + |
| 24 | +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules") |
| 25 | + |
| 26 | +project( |
| 27 | + iceberg |
| 28 | + VERSION 0.1.0 |
| 29 | + DESCRIPTION "Iceberg C++ Project" |
| 30 | + LANGUAGES CXX) |
| 31 | + |
| 32 | +set(CMAKE_CXX_STANDARD 20) |
| 33 | +set(CMAKE_CXX_STANDARD_REQUIRED ON) |
| 34 | +set(CMAKE_CXX_EXTENSIONS OFF) |
| 35 | +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) |
| 36 | + |
| 37 | +option(ICEBERG_BUILD_STATIC "Build static library" ON) |
| 38 | +option(ICEBERG_BUILD_SHARED "Build shared library" OFF) |
| 39 | +option(ICEBERG_BUILD_TESTS "Build tests" ON) |
| 40 | + |
| 41 | +include(CMakePackageConfigHelpers) |
| 42 | +include(CMakeParseArguments) |
| 43 | +include(BuildUtils) |
| 44 | +include(ExternalProject) |
| 45 | +include(FindPackageHandleStandardArgs) |
| 46 | +include(GNUInstallDirs) |
| 47 | + |
| 48 | +set(ICEBERG_API_DIR "${CMAKE_SOURCE_DIR}/api") |
| 49 | +set(ICEBERG_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}") |
| 50 | +set(ICEBERG_INSTALL_BINDIR "${CMAKE_INSTALL_BINDIR}") |
| 51 | +set(ICEBERG_INSTALL_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}") |
| 52 | +set(ICEBERG_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake") |
| 53 | +set(ICEBERG_INSTALL_DOCDIR "share/doc/${PROJECT_NAME}") |
| 54 | + |
| 55 | +add_subdirectory(api) |
| 56 | +add_subdirectory(src) |
| 57 | + |
| 58 | +if(ICEBERG_BUILD_TESTS) |
| 59 | + enable_testing() |
| 60 | + add_subdirectory(test) |
| 61 | +endif() |
| 62 | + |
| 63 | +install(FILES LICENSE NOTICE DESTINATION ${ICEBERG_INSTALL_DOCDIR}) |
0 commit comments