Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-cpplib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-cpplib
Commits
51d951ad
Commit
51d951ad
authored
7 months ago
by
Joscha Schmiedt
Browse files
Options
Downloads
Patches
Plain Diff
Rename main CMakeLists.txt
parent
383f543f
No related branches found
No related tags found
2 merge requests
!61
Release 0.3.0
,
!55
Rename caosdb-cpplib to linkahead-cpplib
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CMakeLists.txt
+94
-94
94 additions, 94 deletions
CMakeLists.txt
with
94 additions
and
94 deletions
CMakeLists.txt
+
94
−
94
View file @
51d951ad
#
# This file is a part of the
CaosDB
Project.
# This file is a part of the
LinkAhead
Project.
#
# Copyright (C) 2021 Timm Fitschen <t.fitschen@indiscale.com>
# Copyright (C) 202
1
Joscha Schmiedt <joscha@schmiedt.dev>
# Copyright (C) 202
4
Joscha Schmiedt <joscha@schmiedt.dev>
# Copyright (C) 2021-2024 IndiScale GmbH <info@indiscale.com>
#
#
...
...
@@ -22,15 +22,15 @@
cmake_minimum_required
(
VERSION 3.13
)
set
(
lib
caosdb
_VERSION 0.3.0
)
set
(
lib
caosdb
_COMPATIBLE_SERVER_VERSION_MAJOR 0
)
set
(
lib
caosdb
_COMPATIBLE_SERVER_VERSION_MINOR 9
)
set
(
lib
caosdb
_COMPATIBLE_SERVER_VERSION_PATCH 0
)
set
(
lib
caosdb
_COMPATIBLE_SERVER_VERSION_PRE_RELEASE
""
)
set
(
lib
linkahead
_VERSION 0.3.0
)
set
(
lib
linkahead
_COMPATIBLE_SERVER_VERSION_MAJOR 0
)
set
(
lib
linkahead
_COMPATIBLE_SERVER_VERSION_MINOR 9
)
set
(
lib
linkahead
_COMPATIBLE_SERVER_VERSION_PATCH 0
)
set
(
lib
linkahead
_COMPATIBLE_SERVER_VERSION_PRE_RELEASE
""
)
project
(
lib
caosdb
VERSION
${
lib
caosdb
_VERSION
}
DESCRIPTION
"C and C++ client libraries for
CaosDB
"
project
(
lib
linkahead
VERSION
${
lib
linkahead
_VERSION
}
DESCRIPTION
"C and C++ client libraries for
LinkAhead
"
LANGUAGES CXX C
)
set
(
CMAKE_C_STANDARD 11
)
...
...
@@ -141,10 +141,10 @@ message(DEBUG "GRPC_GENERATED: ${GRPC_GENERATED}")
###############################################################################
### Set up main targets
### *
caosdb
- The main library including the protobuf and grpc generated files.
### * cxx
caosdb
cli - A C++ test client.
### * c
caosdb
- A C-Wrapper of the C++
caosdb
library.
### * c
caosdb
cli - A plain C test client.
### *
linkahead
- The main library including the protobuf and grpc generated files.
### * cxx
linkahead
cli - A C++ test client.
### * c
linkahead
- A C-Wrapper of the C++
linkahead
library.
### * c
linkahead
cli - A plain C test client.
###############################################################################
find_package
(
gRPC CONFIG REQUIRED
)
...
...
@@ -162,64 +162,64 @@ message(DEBUG "gRPC_INCLUDE_DIRS: ${gRPC_INCLUDE_DIRS}")
message
(
DEBUG
"Boost_INCLUDE_DIRS:
${
Boost_INCLUDE_DIRS
}
"
)
message
(
DEBUG
"GTest_INCLUDE_DIRS:
${
GTest_INCLUDE_DIRS
}
"
)
message
(
DEBUG
"CMAKE_CXX_FLAGS:
${
CMAKE_CXX_FLAGS
}
"
)
message
(
DEBUG
"lib
caosdb
_SOURCE_DIR:
${
lib
caosdb
_SOURCE_DIR
}
"
)
message
(
DEBUG
"lib
caosdb
_BINARY_DIR:
${
lib
caosdb
_BINARY_DIR
}
"
)
message
(
DEBUG
"lib
linkahead
_SOURCE_DIR:
${
lib
linkahead
_SOURCE_DIR
}
"
)
message
(
DEBUG
"lib
linkahead
_BINARY_DIR:
${
lib
linkahead
_BINARY_DIR
}
"
)
# lib
caosdb
# lib
linkahead
# ---------
add_library
(
caosdb
SHARED
${
lib
caosdb
_INCL
}
${
lib
caosdb
_SRC
}
${
GRPC_GENERATED
}
)
target_link_libraries
(
caosdb
PUBLIC
add_library
(
linkahead
SHARED
${
lib
linkahead
_INCL
}
${
lib
linkahead
_SRC
}
${
GRPC_GENERATED
}
)
target_link_libraries
(
linkahead
PUBLIC
gRPC::grpc gRPC::grpc++ protobuf::libprotobuf
${
Boost_LIBRARIES
}
)
set
(
LIBCAOSDB caosdb
)
set
(
liblinkahead linkahead
)
target_include_directories
(
caosdb
PUBLIC
$<BUILD_INTERFACE:
${
lib
caosdb
_SOURCE_DIR
}
/include>
$<BUILD_INTERFACE:
${
lib
caosdb
_BINARY_DIR
}
/include>
$<BUILD_INTERFACE:
${
lib
caosdb
_SOURCE_DIR
}
/src>
target_include_directories
(
linkahead
PUBLIC
$<BUILD_INTERFACE:
${
lib
linkahead
_SOURCE_DIR
}
/include>
$<BUILD_INTERFACE:
${
lib
linkahead
_BINARY_DIR
}
/include>
$<BUILD_INTERFACE:
${
lib
linkahead
_SOURCE_DIR
}
/src>
$<INSTALL_INTERFACE:include>
)
# libc
caosdb
# libc
linkahead
# ----------
add_library
(
c
caosdb
SHARED src/c
caosdb
.cpp
${
GRPC_GENERATED
}
)
target_link_libraries
(
c
caosdb
PUBLIC
caosdb
add_library
(
c
linkahead
SHARED src/c
linkahead
.cpp
${
GRPC_GENERATED
}
)
target_link_libraries
(
c
linkahead
PUBLIC
linkahead
gRPC::grpc gRPC::grpc++ protobuf::libprotobuf
${
Boost_LIBRARIES
}
)
target_include_directories
(
c
caosdb
PUBLIC
$<BUILD_INTERFACE:
${
lib
caosdb
_SOURCE_DIR
}
/include>
$<BUILD_INTERFACE:
${
lib
caosdb
_BINARY_DIR
}
/include>
target_include_directories
(
c
linkahead
PUBLIC
$<BUILD_INTERFACE:
${
lib
linkahead
_SOURCE_DIR
}
/include>
$<BUILD_INTERFACE:
${
lib
linkahead
_BINARY_DIR
}
/include>
$<INSTALL_INTERFACE:include>
)
# c
caosdb
cli
# c
linkahead
cli
# ----------
add_executable
(
c
caosdb
cli EXCLUDE_FROM_ALL src/c
caosdb
cli.c
)
target_include_directories
(
c
caosdb
cli PUBLIC
$<BUILD_INTERFACE:
${
lib
caosdb
_SOURCE_DIR
}
/include>
$<BUILD_INTERFACE:
${
lib
caosdb
_BINARY_DIR
}
/include>
add_executable
(
c
linkahead
cli EXCLUDE_FROM_ALL src/c
linkahead
cli.c
)
target_include_directories
(
c
linkahead
cli PUBLIC
$<BUILD_INTERFACE:
${
lib
linkahead
_SOURCE_DIR
}
/include>
$<BUILD_INTERFACE:
${
lib
linkahead
_BINARY_DIR
}
/include>
$<INSTALL_INTERFACE:include>
)
target_link_libraries
(
c
caosdb
cli PRIVATE
target_link_libraries
(
c
linkahead
cli PRIVATE
gRPC::grpc protobuf::libprotobuf
${
Boost_LIBRARIES
}
c
caosdb
c
linkahead
)
# cxx
caosdb
cli
# cxx
linkahead
cli
# ------------
add_executable
(
cxx
caosdb
cli EXCLUDE_FROM_ALL src/cxx
caosdb
cli.cpp
)
target_include_directories
(
cxx
caosdb
cli PUBLIC
$<BUILD_INTERFACE:
${
lib
caosdb
_SOURCE_DIR
}
/include>
$<BUILD_INTERFACE:
${
lib
caosdb
_BINARY_DIR
}
/include>
add_executable
(
cxx
linkahead
cli EXCLUDE_FROM_ALL src/cxx
linkahead
cli.cpp
)
target_include_directories
(
cxx
linkahead
cli PUBLIC
$<BUILD_INTERFACE:
${
lib
linkahead
_SOURCE_DIR
}
/include>
$<BUILD_INTERFACE:
${
lib
linkahead
_BINARY_DIR
}
/include>
$<INSTALL_INTERFACE:include>
)
target_link_libraries
(
cxx
caosdb
cli PRIVATE
caosdb
gRPC::grpc++ protobuf::libprotobuf
${
Boost_LIBRARIES
}
target_link_libraries
(
cxx
linkahead
cli PRIVATE
linkahead
gRPC::grpc++ protobuf::libprotobuf
${
Boost_LIBRARIES
}
)
...
...
@@ -273,19 +273,19 @@ if(_LINTING)
# add_compiler_flag("-Werror") # removed until issue #71 is resolved
message
(
STATUS
"PEDANTIC_CMAKE_CXX_FLAGS: [
${
PEDANTIC_CMAKE_CXX_FLAGS
}
]"
)
set
(
TARGET_
CAOSDB
_COMPILE_FLAGS
"
${
TARGET_
CAOSDB
_COMPILE_FLAGS
}
${
PEDANTIC_CMAKE_CXX_FLAGS
}
"
)
set
(
TARGET_C
CAOSDB
_COMPILE_FLAGS
"
${
TARGET_C
CAOSDB
_COMPILE_FLAGS
}
${
PEDANTIC_CMAKE_C_FLAGS
}
"
)
set
(
TARGET_CXX
CAOSDB
CLI_COMPILE_FLAGS
"
${
TARGET_CXX
CAOSDB
CLI_COMPILE_FLAGS
}
${
PEDANTIC_CMAKE_CXX_FLAGS
}
"
)
set
(
TARGET_C
CAOSDB
CLI_COMPILE_FLAGS
"
${
TARGET_C
CAOSDB
CLI_COMPILE_FLAGS
}
${
PEDANTIC_CMAKE_C_FLAGS
}
"
)
set_target_properties
(
caosdb
PROPERTIES
COMPILE_FLAGS
"
${
TARGET_
CAOSDB
_COMPILE_FLAGS
}
"
)
set_target_properties
(
c
caosdb
PROPERTIES
COMPILE_FLAGS
"
${
TARGET_C
CAOSDB
_COMPILE_FLAGS
}
"
)
set_target_properties
(
cxx
caosdb
cli PROPERTIES
COMPILE_FLAGS
"
${
TARGET_CXX
CAOSDB
CLI_COMPILE_FLAGS
}
"
)
set_target_properties
(
c
caosdb
cli PROPERTIES
COMPILE_FLAGS
"
${
TARGET_C
CAOSDB
CLI_COMPILE_FLAGS
}
"
)
set
(
TARGET_
LINKAHEAD
_COMPILE_FLAGS
"
${
TARGET_
LINKAHEAD
_COMPILE_FLAGS
}
${
PEDANTIC_CMAKE_CXX_FLAGS
}
"
)
set
(
TARGET_C
LINKAHEAD
_COMPILE_FLAGS
"
${
TARGET_C
LINKAHEAD
_COMPILE_FLAGS
}
${
PEDANTIC_CMAKE_C_FLAGS
}
"
)
set
(
TARGET_CXX
LINKAHEAD
CLI_COMPILE_FLAGS
"
${
TARGET_CXX
LINKAHEAD
CLI_COMPILE_FLAGS
}
${
PEDANTIC_CMAKE_CXX_FLAGS
}
"
)
set
(
TARGET_C
LINKAHEAD
CLI_COMPILE_FLAGS
"
${
TARGET_C
LINKAHEAD
CLI_COMPILE_FLAGS
}
${
PEDANTIC_CMAKE_C_FLAGS
}
"
)
set_target_properties
(
linkahead
PROPERTIES
COMPILE_FLAGS
"
${
TARGET_
LINKAHEAD
_COMPILE_FLAGS
}
"
)
set_target_properties
(
c
linkahead
PROPERTIES
COMPILE_FLAGS
"
${
TARGET_C
LINKAHEAD
_COMPILE_FLAGS
}
"
)
set_target_properties
(
cxx
linkahead
cli PROPERTIES
COMPILE_FLAGS
"
${
TARGET_CXX
LINKAHEAD
CLI_COMPILE_FLAGS
}
"
)
set_target_properties
(
c
linkahead
cli PROPERTIES
COMPILE_FLAGS
"
${
TARGET_C
LINKAHEAD
CLI_COMPILE_FLAGS
}
"
)
find_program
(
iwyu
NAMES include-what-you-use iwyu
...
...
@@ -297,13 +297,13 @@ if(_LINTING)
set
(
_CMAKE_CXX_INCLUDE_WHAT_YOU_USE
${
iwyu
}
"-Xiwyu"
"--cxx17ns"
"-Xiwyu"
"--no_fwd_decls"
)
set_target_properties
(
caosdb
PROPERTIES
set_target_properties
(
linkahead
PROPERTIES
CXX_INCLUDE_WHAT_YOU_USE
"
${
_CMAKE_CXX_INCLUDE_WHAT_YOU_USE
}
"
)
set_target_properties
(
cxx
caosdb
cli PROPERTIES
set_target_properties
(
cxx
linkahead
cli PROPERTIES
CXX_INCLUDE_WHAT_YOU_USE
"
${
_CMAKE_CXX_INCLUDE_WHAT_YOU_USE
}
"
)
set_target_properties
(
c
caosdb
cli PROPERTIES
set_target_properties
(
c
linkahead
cli PROPERTIES
C_INCLUDE_WHAT_YOU_USE
"
${
_CMAKE_CXX_INCLUDE_WHAT_YOU_USE
}
"
)
endif
()
...
...
@@ -326,16 +326,16 @@ if(_LINTING)
endif
()
message
(
STATUS
"Using clang-tidy with
'
${
_CMAKE_CXX_CLANG_TIDY
}
;
${
_CMAKE_CXX_CLANG_TIDY_CHECKS
}
'"
)
set_target_properties
(
caosdb
PROPERTIES
set_target_properties
(
linkahead
PROPERTIES
CXX_CLANG_TIDY
"
${
_CMAKE_CXX_CLANG_TIDY
}
;
${
_CMAKE_CXX_CLANG_TIDY_CHECKS
}
"
)
set_target_properties
(
cxx
caosdb
cli PROPERTIES
set_target_properties
(
cxx
linkahead
cli PROPERTIES
CXX_CLANG_TIDY
"
${
_CMAKE_CXX_CLANG_TIDY
}
;
${
_CMAKE_CXX_CLANG_TIDY_CHECKS
}
"
)
set_target_properties
(
c
caosdb
PROPERTIES
set_target_properties
(
c
linkahead
PROPERTIES
C_CLANG_TIDY
"
${
_CMAKE_C_CLANG_TIDY
}
;
${
_CMAKE_C_CLANG_TIDY_CHECKS
}
"
)
set_target_properties
(
c
caosdb
cli PROPERTIES
set_target_properties
(
c
linkahead
cli PROPERTIES
C_CLANG_TIDY
"
${
_CMAKE_C_CLANG_TIDY
}
;
${
_CMAKE_C_CLANG_TIDY_CHECKS
}
"
)
endif
()
...
...
@@ -355,38 +355,38 @@ endif()
# ############ INSTALLATION #####################
# ###############################################
set
(
lib
caosdb
_INCLUDE_DEST
"include/
caosdb
"
)
set
(
lib
caosdb
_LIB_DEST
"lib"
)
set
(
lib
linkahead
_INCLUDE_DEST
"include/
linkahead
"
)
set
(
lib
linkahead
_LIB_DEST
"lib"
)
set
(
CMAKE_INSTALL_PREFIX
"$ENV{HOME}/.local/"
)
install
(
# targets to install
TARGETS
${
LIBCAOSDB
}
ccaosdb
TARGETS
${
liblinkahead
}
clinkahead
# name of the CMake "export group" containing the targets we want to install
EXPORT
caosdb
Targets
EXPORT
linkahead
Targets
# Dynamic, static library and include destination locations after running
# "make install"
LIBRARY DESTINATION
${
lib
caosdb
_LIB_DEST
}
ARCHIVE DESTINATION
${
lib
caosdb
_LIB_DEST
}
INCLUDES DESTINATION
${
lib
caosdb
_INCLUDE_DEST
}
LIBRARY DESTINATION
${
lib
linkahead
_LIB_DEST
}
ARCHIVE DESTINATION
${
lib
linkahead
_LIB_DEST
}
INCLUDES DESTINATION
${
lib
linkahead
_INCLUDE_DEST
}
)
set
(
lib
caosdb
_CMAKE_DEST
"
${
lib
caosdb
_LIB_DEST
}
/cmake/
caosdb
"
)
set
(
lib
linkahead
_CMAKE_DEST
"
${
lib
linkahead
_LIB_DEST
}
/cmake/
linkahead
"
)
install
(
# The export we want to save (matches name defined above containing the
# install targets)
EXPORT
caosdb
Targets
EXPORT
linkahead
Targets
# CMake file in which to store the export's information
FILE
caosdb
Targets.cmake
FILE
linkahead
Targets.cmake
# Namespace prepends all targets in the export (when we import later, we
# will use
caosdb::caosdb
)
NAMESPACE
caosdb
::
# will use
linkahead::linkahead
)
NAMESPACE
linkahead
::
# where to place the resulting file (here, we're putting it with the library)
DESTINATION
${
lib
caosdb
_CMAKE_DEST
}
DESTINATION
${
lib
linkahead
_CMAKE_DEST
}
)
install
(
FILES
${
lib
caosdb
_INCL
}
${
PROJECT_SOURCE_DIR
}
/include/c
caosdb
.h DESTINATION
${
lib
caosdb
_INCLUDE_DEST
}
)
install
(
FILES
${
lib
linkahead
_INCL
}
${
PROJECT_SOURCE_DIR
}
/include/c
linkahead
.h DESTINATION
${
lib
linkahead
_INCLUDE_DEST
}
)
foreach
(
i RANGE
"
${
len_proto_files
}
"
)
list
(
GET PROTO_FILES
${
i
}
next_proto_file
)
...
...
@@ -406,21 +406,21 @@ foreach(i RANGE "${len_proto_files}")
set
(
next_grpc_hdr
"
${
CMAKE_CURRENT_BINARY_DIR
}
/include/caosdb/
${
next_proto_module
}
/main.grpc.pb.h"
)
install
(
FILES
${
next_proto_hdr
}
${
next_grpc_hdr
}
DESTINATION
${
lib
caosdb
_INCLUDE_DEST
}
/
${
next_proto_module
}
)
${
lib
linkahead
_INCLUDE_DEST
}
/
${
next_proto_module
}
)
endforeach
()
install
(
FILES
${
PROJECT_SOURCE_DIR
}
/
caosdb
Config.cmake
DESTINATION
${
lib
caosdb
_CMAKE_DEST
}
)
install
(
FILES
${
PROJECT_SOURCE_DIR
}
/
linkahead
Config.cmake
DESTINATION
${
lib
linkahead
_CMAKE_DEST
}
)
#set_property(TARGET caosdb PROPERTY VERSION ${lib
caosdb
_VERSION})
#set_property(TARGET caosdb PROPERTY VERSION ${lib
linkahead
_VERSION})
include
(
CMakePackageConfigHelpers
)
write_basic_package_version_file
(
"
${
PROJECT_SOURCE_DIR
}
/
caosdb
ConfigVersion.cmake"
VERSION
${
lib
caosdb
_VERSION
}
"
${
PROJECT_SOURCE_DIR
}
/
linkahead
ConfigVersion.cmake"
VERSION
${
lib
linkahead
_VERSION
}
COMPATIBILITY AnyNewerVersion
)
install
(
FILES
${
PROJECT_SOURCE_DIR
}
/
caosdb
ConfigVersion.cmake
DESTINATION
${
lib
caosdb
_CMAKE_DEST
}
)
install
(
FILES
${
PROJECT_SOURCE_DIR
}
/
linkahead
ConfigVersion.cmake
DESTINATION
${
lib
linkahead
_CMAKE_DEST
}
)
#######################################################
### code formatting with clang-format
...
...
@@ -429,12 +429,12 @@ option(AUTOFORMATTING "call clang-format at configure time" ON)
if
(
AUTOFORMATTING AND NOT SKIP_LINTING
)
find_program
(
clang_format NAMES clang-format-11 clang-format
)
file
(
GLOB format_test_sources test/*.cpp test/*.h test/*.h.in
)
execute_process
(
COMMAND
${
clang_format
}
-i --verbose
${
lib
caosdb
_INCL
}
${
lib
caosdb
_SRC
}
${
lib
caosdb
_TEST_SRC
}
${
PROJECT_SOURCE_DIR
}
/src/cxx
caosdb
cli.cpp
${
PROJECT_SOURCE_DIR
}
/src/c
caosdb
cli.c
${
PROJECT_SOURCE_DIR
}
/src/c
caosdb
.cpp
${
PROJECT_SOURCE_DIR
}
/include/c
caosdb
.h
execute_process
(
COMMAND
${
clang_format
}
-i --verbose
${
lib
linkahead
_INCL
}
${
lib
linkahead
_SRC
}
${
lib
linkahead
_TEST_SRC
}
${
PROJECT_SOURCE_DIR
}
/src/cxx
linkahead
cli.cpp
${
PROJECT_SOURCE_DIR
}
/src/c
linkahead
cli.c
${
PROJECT_SOURCE_DIR
}
/src/c
linkahead
.cpp
${
PROJECT_SOURCE_DIR
}
/include/c
linkahead
.h
${
format_test_sources
}
WORKING_DIRECTORY
${
PROJECT_SOURCE_DIR
}
)
endif
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment