This repository has been archived by the owner on Jan 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove C++98 directory. * Add note about C/C++98.
- Loading branch information
Showing
26 changed files
with
115 additions
and
88 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,120 @@ | ||
cmake_minimum_required(VERSION 3.0) | ||
cmake_minimum_required(VERSION 3.1) | ||
enable_testing() | ||
|
||
project(opentracing-cpp) | ||
|
||
# ============================================================================== | ||
# Version information | ||
|
||
set(OPENTRACING_ABI_VERSION "1") | ||
set(OPENTRACING_VERSION_MAJOR "0") | ||
set(OPENTRACING_VERSION_MINOR "1") | ||
set(OPENTRACING_VERSION_PATCH "0") | ||
set(OPENTRACING_VERSION_STRING | ||
"${OPENTRACING_VERSION_MAJOR}.${OPENTRACING_VERSION_MINOR}.${OPENTRACING_VERSION_PATCH}") | ||
|
||
# ============================================================================== | ||
# Set up cpack | ||
|
||
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "C++ implementation of the OpenTracing API") | ||
SET(CPACK_PACKAGE_VENDOR "opentracing.io") | ||
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.md") | ||
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE") | ||
|
||
SET(CPACK_PACKAGE_VERSION_MAJOR "0") | ||
SET(CPACK_PACKAGE_VERSION_MINOR "1") | ||
SET(CPACK_PACKAGE_VERSION_PATCH "0") | ||
SET(CPACK_PACKAGE_VERSION_MAJOR ${OPENTRACING_VERSION_MAJOR}) | ||
SET(CPACK_PACKAGE_VERSION_MINOR ${OPENTRACING_VERSION_MINOR}) | ||
SET(CPACK_PACKAGE_VERSION_PATCH ${OPENTRACING_VERSION_PATCH}) | ||
include(CPack) | ||
|
||
add_subdirectory(c++11) | ||
# ============================================================================== | ||
# Set up generated version.h | ||
|
||
configure_file(version.h.in include/opentracing/version.h) | ||
include_directories(${CMAKE_CURRENT_BINARY_DIR}/include) | ||
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/opentracing | ||
DESTINATION include) | ||
|
||
# ============================================================================== | ||
# Configure compilers | ||
|
||
set(CMAKE_CXX_STANDARD 11) | ||
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Weverything \ | ||
-Wno-c++98-compat \ | ||
-Wno-c++98-compat-bind-to-temporary-copy \ | ||
-Wno-weak-vtables \ | ||
-Wno-exit-time-destructors \ | ||
-Wno-global-constructors \ | ||
-Wno-padded") | ||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra") | ||
endif() | ||
|
||
# ============================================================================== | ||
# Set up linter | ||
|
||
find_program(CLANG_TIDY_EXE NAMES "clang-tidy" | ||
DOC "Path to clang-tidy executable") | ||
if(NOT CLANG_TIDY_EXE) | ||
message(STATUS "clang-tidy not found.") | ||
else() | ||
message(STATUS "clang-tidy found: ${CLANG_TIDY_EXE}") | ||
set(DO_CLANG_TIDY "${CLANG_TIDY_EXE}" "-checks=*,-clang-analyzer-alpha.*") | ||
endif() | ||
|
||
# ============================================================================== | ||
# OpenTracing library targets | ||
|
||
include_directories(include) | ||
include_directories(SYSTEM 3rd_party/include) | ||
|
||
set(SRCS src/propagation.cpp src/noop.cpp src/tracer.cpp) | ||
add_library(opentracing SHARED ${SRCS}) | ||
target_include_directories(opentracing INTERFACE "$<INSTALL_INTERFACE:include/>") | ||
set_target_properties(opentracing PROPERTIES VERSION ${OPENTRACING_VERSION_STRING} | ||
SOVERSION ${OPENTRACING_VERSION_MAJOR}) | ||
add_library(opentracing-static STATIC ${SRCS}) | ||
set_target_properties(opentracing-static PROPERTIES OUTPUT_NAME opentracing) | ||
target_include_directories(opentracing-static INTERFACE "$<INSTALL_INTERFACE:include/>") | ||
if (CLANG_TIDY_EXE) | ||
set_target_properties(opentracing PROPERTIES | ||
CXX_CLANG_TIDY "${DO_CLANG_TIDY}") | ||
endif() | ||
|
||
|
||
install(DIRECTORY 3rd_party/include/opentracing DESTINATION include | ||
FILES_MATCHING PATTERN "*.hpp" | ||
PATTERN "*.h") | ||
install(DIRECTORY include/opentracing DESTINATION include | ||
FILES_MATCHING PATTERN "*.h") | ||
install(TARGETS opentracing opentracing-static EXPORT OpenTracingTargets | ||
LIBRARY DESTINATION lib | ||
ARCHIVE DESTINATION lib) | ||
|
||
# ============================================================================== | ||
# Package configuration setup | ||
|
||
include(CMakePackageConfigHelpers) | ||
write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/OpenTracingConfigVersion.cmake" | ||
VERSION ${OPENTRACING_VERSION_STRING} | ||
COMPATIBILITY AnyNewerVersion) | ||
export(EXPORT OpenTracingTargets | ||
FILE "${CMAKE_CURRENT_BINARY_DIR}/OpenTracingTargets.cmake" | ||
NAMESPACE OpenTracing::) | ||
configure_file(cmake/OpenTracingConfig.cmake | ||
"${CMAKE_CURRENT_BINARY_DIR}/OpenTracingConfig.cmake" | ||
COPYONLY) | ||
set(ConfigPackageLocation lib/cmake/OpenTracing) | ||
install(EXPORT OpenTracingTargets | ||
FILE OpenTracingTargets.cmake | ||
NAMESPACE OpenTracing:: | ||
DESTINATION ${ConfigPackageLocation}) | ||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/OpenTracingConfig.cmake | ||
"${CMAKE_CURRENT_BINARY_DIR}/OpenTracingConfigVersion.cmake" | ||
DESTINATION ${ConfigPackageLocation} | ||
COMPONENT Devel) | ||
|
||
# ============================================================================== | ||
# Testing | ||
|
||
add_subdirectory(test) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters