1 Star 0 Fork 4

莫忘初心/Thrift-Apache

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
CMakeLists.txt 3.84 KB
一键复制 编辑 原始数据 按行查看 历史
Jens Geyer 提交于 2023-07-08 12:49 . created reöease branch 0.19.0
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
cmake_minimum_required(VERSION 3.4)
if(POLICY CMP0048)
cmake_policy(SET CMP0048 NEW) # package version behavior added in cmake 3.0
endif()
if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW) # find_package behavior added in cmake 3.12
endif()
# PACKAGE_VERSION is used by cpack scripts currently
# Both thrift_VERSION and PACKAGE_VERSION should be the same for now
set(thrift_VERSION "0.20.0")
set(PACKAGE_VERSION ${thrift_VERSION})
project("thrift" VERSION ${PACKAGE_VERSION})
message(STATUS "Configuring ${CMAKE_PROJECT_NAME} ${thrift_VERSION}")
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake")
# Some default settings
include(DefineCMakeDefaults)
# Build time options are defined here
include(DefineOptions)
include(DefineInstallationPaths)
# Based on the options set some platform specifics
include(DefinePlatformSpecifc)
# Add CMake targets for static code analysis
include(StaticCodeAnalysis)
# Generate the config.h file
include(ConfigureChecks)
# Generate the ThriftConfig.cmake module
include(GenerateConfigModule)
# Packaging
include(CPackConfig)
# Dependencies
include(BoostMacros)
find_package(Threads)
include(CTest)
if(BUILD_TESTING)
message(STATUS "Building with unittests")
enable_testing()
# Define "make check" as alias for "make test"
add_custom_target(check COMMAND ctest)
else ()
message(STATUS "Building without tests")
endif ()
if(BUILD_COMPILER)
if(NOT EXISTS ${THRIFT_COMPILER})
set(THRIFT_COMPILER $<TARGET_FILE:thrift-compiler>)
endif()
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/compiler/cpp)
elseif(EXISTS ${THRIFT_COMPILER})
add_executable(thrift-compiler IMPORTED)
set_property(TARGET thrift-compiler PROPERTY IMPORTED_LOCATION ${THRIFT_COMPILER})
endif()
if(BUILD_CPP)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/lib/cpp)
if(BUILD_TUTORIALS)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/tutorial/cpp)
endif()
if(BUILD_TESTING)
if(WITH_LIBEVENT AND WITH_ZLIB AND WITH_OPENSSL)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/test/cpp)
else()
message(WARNING "libevent and/or ZLIB and/or OpenSSL not found or disabled; will not build some tests")
endif()
endif()
endif()
if(BUILD_C_GLIB)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/lib/c_glib)
if(BUILD_TESTING)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/test/c_glib)
endif()
endif()
if(BUILD_JAVA)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/lib/java)
endif()
if(BUILD_JAVASCRIPT)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/lib/js)
endif()
if(BUILD_KOTLIN)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/lib/kotlin)
endif()
if(BUILD_NODEJS)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/lib/nodejs)
endif()
if(BUILD_PYTHON)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/lib/py)
if(BUILD_TESTING)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/test/py)
endif()
endif()
# Create the uninstall target
add_custom_target(uninstall "${CMAKE_COMMAND}" -P "${PROJECT_SOURCE_DIR}/build/cmake/uninstall.cmake")
PRINT_CONFIG_SUMMARY()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/dontforget-bandian/Thrift-Apache.git
[email protected]:dontforget-bandian/Thrift-Apache.git
dontforget-bandian
Thrift-Apache
Thrift-Apache
master

搜索帮助