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
16056d4d
Verified
Commit
16056d4d
authored
3 years ago
by
Timm Fitschen
Browse files
Options
Downloads
Patches
Plain Diff
WIP: pipeline
parent
027c5c58
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#8238
passed
3 years ago
Stage: setup
Stage: test
Stage: deploy
Pipeline: caosdb-cppinttest
#8239
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.docker/Dockerfile
+4
-0
4 additions, 0 deletions
.docker/Dockerfile
CMakeLists.txt
+85
-67
85 additions, 67 deletions
CMakeLists.txt
caosdbConfig.cmake
+10
-0
10 additions, 0 deletions
caosdbConfig.cmake
include/CMakeLists.txt
+2
-2
2 additions, 2 deletions
include/CMakeLists.txt
with
101 additions
and
69 deletions
.docker/Dockerfile
+
4
−
0
View file @
16056d4d
...
...
@@ -39,3 +39,7 @@ RUN make -j
RUN
make
install
RUN
apt-get
install
-y
curl
COPY
. /libcaosdb/
WORKDIR
/libcaosdb
RUN
rm
-rf
.git
This diff is collapsed.
Click to expand it.
CMakeLists.txt
+
85
−
67
View file @
16056d4d
...
...
@@ -82,6 +82,65 @@ if("${CMAKE_BUILD_TYPE}" MATCHES "Debug")
endif
()
## CODE GENERATION
option
(
GRPC_FETCHCONTENT
"Fetch and build GRPC from the sources"
OFF
)
include
(
FetchGRPC
)
#
# Protobuf/Grpc source files
#
set
(
PROTO_FILES
${
PROJECT_SOURCE_DIR
}
/proto/proto/caosdb/info/v1alpha1/main.proto
)
set
(
PROTO_PATH
${
PROJECT_SOURCE_DIR
}
/proto/proto
)
# Generated sources
set
(
hw_hdrs_path
"caosdb/info/v1alpha1"
)
set
(
hw_proto_srcs
"
${
CMAKE_CURRENT_BINARY_DIR
}
/include/caosdb/info/v1alpha1/main.pb.cc"
)
set
(
hw_proto_hdrs
"
${
CMAKE_CURRENT_BINARY_DIR
}
/include/
${
hw_hdrs_path
}
/main.pb.h"
)
set
(
hw_grpc_srcs
"
${
CMAKE_CURRENT_BINARY_DIR
}
/include/caosdb/info/v1alpha1/main.grpc.pb.cc"
)
set
(
hw_grpc_hdrs
"
${
CMAKE_CURRENT_BINARY_DIR
}
/include/
${
hw_hdrs_path
}
/main.grpc.pb.h"
)
add_custom_command
(
OUTPUT
"
${
hw_proto_srcs
}
"
"
${
hw_proto_hdrs
}
"
"
${
hw_grpc_srcs
}
"
"
${
hw_grpc_hdrs
}
"
COMMAND
${
_PROTOBUF_PROTOC
}
ARGS --grpc_out
"
${
CMAKE_CURRENT_BINARY_DIR
}
/include"
--cpp_out
"
${
CMAKE_CURRENT_BINARY_DIR
}
/include"
-I
"
${
PROTO_PATH
}
"
--plugin=protoc-gen-grpc=
"
${
_GRPC_CPP_PLUGIN_EXECUTABLE
}
"
"
${
PROTO_FILES
}
"
DEPENDS
"
${
PROTO_FILES
}
"
)
# hw_grpc_proto
add_library
(
caosdb_info_v1alpha1
${
hw_grpc_srcs
}
${
hw_grpc_hdrs
}
${
hw_proto_srcs
}
${
hw_proto_hdrs
}
)
target_link_libraries
(
caosdb_info_v1alpha1
${
_REFLECTION
}
${
_GRPC_GRPCPP
}
${
_PROTOBUF_LIBPROTOBUF
}
)
target_include_directories
(
caosdb_info_v1alpha1 PUBLIC
# headers to include when building from source
$<BUILD_INTERFACE:
${
libcaosdb_SOURCE_DIR
}
/include>
$<BUILD_INTERFACE:
${
libcaosdb_BINARY_DIR
}
/include>
$<INSTALL_INTERFACE:include>
)
target_link_libraries
(
caosdb
caosdb_info_v1alpha1
${
_REFLECTION
}
${
_GRPC_GRPCPP
}
${
_PROTOBUF_LIBPROTOBUF
}
)
###############################################
############ INSTALLATION #####################
###############################################
# These variables slightly modify the install location to allow for version
# specific installations.
set
(
libcaosdb_INCLUDE_DEST
"include/libcaosdb-
${
libcaosdb_VERSION
}
"
)
...
...
@@ -108,7 +167,7 @@ target_include_directories(caosdb PUBLIC
$<BUILD_INTERFACE:
${
libcaosdb_BINARY_DIR
}
/include>
# headers to include when installing (implicitly prefixes with ${CMAKE_INSTALL_PREFIX}).
$<INSTALL_INTERFACE:include>
$<INSTALL_INTERFACE:include>
)
...
...
@@ -131,14 +190,19 @@ set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/libcaosdb/")
# libcaosdb with libcaosdbTargets.
install
(
# targets to install
TARGETS caosdb
TARGETS
caosdb
caosdb_info_v1alpha1
#${_REFLECTION}
#${_GRPC_GRPCPP}
#${_PROTOBUF_LIBPROTOBUF}
# name of the CMake "export group" containing the targets we want to install
#
EXPORT
lib
caosdbTargets
EXPORT caosdbTargets
# Dynamic, static library and include destination locations after running
# "make install"
LIBRARY DESTINATION
${
libcaosdb_LIB_DEST
}
ARCHIVE DESTINATION
${
libcaosdb_LIB_DEST
}
#
INCLUDES DESTINATION ${libcaosdb_INCLUDE_DEST}
INCLUDES DESTINATION
${
libcaosdb_INCLUDE_DEST
}
)
...
...
@@ -152,72 +216,26 @@ install(
# install(EXPORT ...) will install the information about an export. Here, we
# save it to a file {$libcaosdb_LIB_DEST}/libcaosdbTargets.cmake and prepend
# everything inside libcaosdbTargets with the namespace libcaosdb::.
#
install(
#
#
The export we want to save (matches name defined above containing the
#
#
install targets)
#
EXPORT
lib
caosdbTargets
#
#
CMake file in which to store the export's information
#
FILE
lib
caosdbTargets.cmake
#
#
Namespace prepends all targets in the export (when we import later, we
#
#
will use caosdb::caosdb)
#
NAMESPACE caosdb::
#
#
where to place the resulting file (here, we're putting it with the library)
#
DESTINATION ${libcaosdb_LIB_DEST}
#
)
install
(
# The export we want to save (matches name defined above containing the
# install targets)
EXPORT caosdbTargets
# CMake file in which to store the export's information
FILE caosdbTargets.cmake
# Namespace prepends all targets in the export (when we import later, we
# will use caosdb::caosdb)
NAMESPACE caosdb::
# where to place the resulting file (here, we're putting it with the library)
DESTINATION
${
libcaosdb_LIB_DEST
}
)
## install(FILES ...) simply puts files in a certain place with certain
## properties. We're just copying them to the desired place here.
install
(
FILES
${
libcaosdb_INC
}
DESTINATION
${
libcaosdb_INCLUDE_DEST
}
)
## CODE GENERATION
option
(
GRPC_FETCHCONTENT
"Fetch and build GRPC from the sources"
ON
)
include
(
FetchGRPC
)
#
# Protobuf/Grpc source files
#
set
(
PROTO_FILES
${
PROJECT_SOURCE_DIR
}
/proto/proto/caosdb/info/v1alpha1/main.proto
)
set
(
PROTO_PATH
${
PROJECT_SOURCE_DIR
}
/proto/proto
)
# Generated sources
set
(
hw_proto_srcs
"
${
CMAKE_CURRENT_BINARY_DIR
}
/include/caosdb/info/v1alpha1/main.pb.cc"
)
set
(
hw_proto_hdrs
"
${
CMAKE_CURRENT_BINARY_DIR
}
/include/caosdb/info/v1alpha1/main.pb.h"
)
set
(
hw_grpc_srcs
"
${
CMAKE_CURRENT_BINARY_DIR
}
/include/caosdb/info/v1alpha1/main.grpc.pb.cc"
)
set
(
hw_grpc_hdrs
"
${
CMAKE_CURRENT_BINARY_DIR
}
/include/caosdb/info/v1alpha1/main.grpc.pb.h"
)
add_custom_command
(
OUTPUT
"
${
hw_proto_srcs
}
"
"
${
hw_proto_hdrs
}
"
"
${
hw_grpc_srcs
}
"
"
${
hw_grpc_hdrs
}
"
COMMAND
${
_PROTOBUF_PROTOC
}
ARGS --grpc_out
"
${
CMAKE_CURRENT_BINARY_DIR
}
/include"
--cpp_out
"
${
CMAKE_CURRENT_BINARY_DIR
}
/include"
-I
"
${
PROTO_PATH
}
"
--plugin=protoc-gen-grpc=
"
${
_GRPC_CPP_PLUGIN_EXECUTABLE
}
"
"
${
PROTO_FILES
}
"
DEPENDS
"
${
PROTO_FILES
}
"
)
install
(
FILES
${
libcaosdb_INCL
}
DESTINATION
${
libcaosdb_INCLUDE_DEST
}
)
install
(
FILES
${
hw_grpc_hdrs
}
${
hw_proto_hdrs
}
DESTINATION
${
libcaosdb_INCLUDE_DEST
}
/
${
hw_hdrs_path
}
)
install
(
FILES
${
PROJECT_SOURCE_DIR
}
/caosdbConfig.cmake
DESTINATION
${
libcaosdb_LIB_DEST
}
)
# Include generated *.pb.h files
target_include_directories
(
caosdb PUBLIC
"
${
CMAKE_CURRENT_BINARY_DIR
}
/include"
)
# hw_grpc_proto
add_library
(
caosdb_info_v1alpha1
${
hw_grpc_srcs
}
${
hw_grpc_hdrs
}
${
hw_proto_srcs
}
${
hw_proto_hdrs
}
)
target_link_libraries
(
caosdb_info_v1alpha1
${
_REFLECTION
}
${
_GRPC_GRPCPP
}
${
_PROTOBUF_LIBPROTOBUF
}
)
target_include_directories
(
caosdb_info_v1alpha1 PUBLIC
"
${
CMAKE_CURRENT_BINARY_DIR
}
/include"
)
target_link_libraries
(
caosdb
caosdb_info_v1alpha1
${
_REFLECTION
}
${
_GRPC_GRPCPP
}
${
_PROTOBUF_LIBPROTOBUF
}
)
This diff is collapsed.
Click to expand it.
caosdbConfig.cmake
0 → 100644
+
10
−
0
View file @
16056d4d
get_filename_component
(
CAOSDB_CMAKE_DIR
"
${
CMAKE_CURRENT_LIST_FILE
}
"
PATH
)
include
(
CMakeFindDependencyMacro
)
find_dependency
(
Protobuf CONFIG REQUIRED
)
find_dependency
(
gRPC CONFIG REQUIRED
)
if
(
NOT TARGET caosdb::caosdb
)
include
(
"
${
CAOSDB_CMAKE_DIR
}
/caosdbTargets.cmake"
)
endif
()
This diff is collapsed.
Click to expand it.
include/CMakeLists.txt
+
2
−
2
View file @
16056d4d
...
...
@@ -20,8 +20,8 @@
# add all header files to this list
set
(
libcaosdb_INCL
include
/caosdb_config.h
include
/connection.h
${
CMAKE_CURRENT_BINARY_DIR
}
/caosdb_config.h
${
CMAKE_CURRENT_SOURCE_DIR
}
/connection.h
)
# pass variable to parent scope
...
...
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