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
59fa4cef
Commit
59fa4cef
authored
10 months ago
by
Joscha Schmiedt
Browse files
Options
Downloads
Patches
Plain Diff
Fix errors in CMakeLists.txt for Debug
parent
c8b7bc33
No related branches found
No related tags found
2 merge requests
!61
Release 0.3.0
,
!49
Resolve "EXTERN: Adapt to Conan 2"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CMakeLists.txt
+50
-30
50 additions, 30 deletions
CMakeLists.txt
with
50 additions
and
30 deletions
CMakeLists.txt
+
50
−
30
View file @
59fa4cef
...
...
@@ -147,6 +147,9 @@ add_custom_command(
${
PROTO_FILES
}
DEPENDS
${
PROTO_FILES
}
)
# show generated files
message
(
DEBUG
"GRPC_GENERATED:
${
GRPC_GENERATED
}
"
)
###############################################################################
### Set up main targets
### * [caosdb_grpc] - only in Debug builds. Otherwise this library is compiled
...
...
@@ -157,51 +160,66 @@ add_custom_command(
### * ccaosdbcli - A plain C test client.
###############################################################################
find_package
(
gRPC
)
find_package
(
protobuf
)
find_package
(
Boost
)
find_package
(
GTest
)
find_package
(
gRPC CONFIG REQUIRED
)
find_package
(
Protobuf CONFIG REQUIRED
)
find_package
(
Boost REQUIRED
)
find_package
(
GTest REQUIRED
)
# print include directories for debugging
message
(
DEBUG
"CMAKE_INCLUDE_PATH:
${
CMAKE_INCLUDE_PATH
}
"
)
message
(
DEBUG
"PROTOBUF_INCLUDE_DIRS:
${
PROTOBUF_INCLUDE_DIRS
}
"
)
message
(
DEBUG
"gRPC_INCLUDE_DIRS:
${
gRPC_INCLUDE_DIRS
}
"
)
# libcaosdb
# ---------
# In Debug, build separate libraries for grpc-generated code and caosdb
if
(
"
${
CMAKE_BUILD_TYPE
}
"
MATCHES
"Debug"
)
add_library
(
caosdb_grpc SHARED
${
GRPC_GENERATED
}
)
add_library
(
caosdb SHARED
${
libcaosdb_INCL
}
${
libcaosdb_SRC
}
)
target_link_libraries
(
caosdb caosdb_grpc
grpc::grpc protobuf::protobuf boost::boost gtest::gtest
)
set
(
LIBCAOSDB caosdb caosdb_grpc
)
target_include_directories
(
caosdb_grpc PUBLIC
$<BUILD_INTERFACE:
${
libcaosdb_SOURCE_DIR
}
/include>
$<BUILD_INTERFACE:
${
libcaosdb_BINARY_DIR
}
/include>
add_library
(
caosdb_grpc SHARED
${
GRPC_GENERATED
}
)
target_link_libraries
(
caosdb_grpc
grpc::grpc protobuf::protobuf boost::boost
)
target_include_directories
(
caosdb_grpc PUBLIC
$<BUILD_INTERFACE:
${
PROJECT_INCLUDE_DIR
}
>
$<BUILD_INTERFACE:
${
CMAKE_CURRENT_BINARY_DIR
}
/include>
$<INSTALL_INTERFACE:include>
)
target_include_directories
(
caosdb_grpc SYSTEM PUBLIC
${
CONAN_INCLUDE_DIRS
}
)
)
add_library
(
caosdb SHARED
${
libcaosdb_INCL
}
${
libcaosdb_SRC
}
)
target_link_libraries
(
caosdb
caosdb_grpc grpc::grpc protobuf::protobuf boost::boost
)
set
(
LIBCAOSDB caosdb caosdb_grpc
)
else
()
add_library
(
caosdb
SHARED
${
libcaosdb_INCL
}
${
libcaosdb_SRC
}
${
GRPC_GENERATED
}
)
set
(
LIBCAOSDB caosdb
)
add_library
(
caosdb
SHARED
${
libcaosdb_INCL
}
${
libcaosdb_SRC
}
${
GRPC_GENERATED
}
)
target_link_libraries
(
caosdb
grpc::grpc protobuf::protobuf boost::boost
stdc++fs
)
set
(
LIBCAOSDB caosdb
)
endif
()
target_link_libraries
(
caosdb
grpc::grpc protobuf::protobuf boost::boost gtest::gtest
stdc++fs
)
target_include_directories
(
caosdb PUBLIC
$<BUILD_INTERFACE:
${
libcaosdb_SOURCE_DIR
}
/include>
$<BUILD_INTERFACE:
${
libcaosdb_BINARY_DIR
}
/include>
$<BUILD_INTERFACE:
${
libcaosdb_SOURCE_DIR
}
/src>
$<INSTALL_INTERFACE:include>
)
target_include_directories
(
caosdb SYSTEM PUBLIC
${
CONAN_INCLUDE_DIRS
}
)
# libccaosdb
# ----------
add_library
(
ccaosdb SHARED src/ccaosdb.cpp
)
target_link_libraries
(
ccaosdb
grpc::grpc protobuf::protobuf boost::boost
gtest::gtest
grpc::grpc protobuf::protobuf boost::boost
${
LIBCAOSDB
}
stdc++fs
)
...
...
@@ -224,11 +242,13 @@ target_include_directories(ccaosdbcli SYSTEM PUBLIC
)
target_link_libraries
(
ccaosdbcli
grpc::grpc protobuf::protobuf boost::boost
gtest::gtest
grpc::grpc protobuf::protobuf boost::boost
${
LIBCAOSDB
}
ccaosdb
)
# cxxcaosdbcli
# ------------
add_executable
(
cxxcaosdbcli EXCLUDE_FROM_ALL src/cxxcaosdbcli.cpp
)
target_include_directories
(
cxxcaosdbcli PUBLIC
$<BUILD_INTERFACE:
${
libcaosdb_SOURCE_DIR
}
/include>
...
...
@@ -240,7 +260,7 @@ target_include_directories(cxxcaosdbcli SYSTEM PUBLIC
)
target_link_libraries
(
cxxcaosdbcli
${
LIBCAOSDB
}
grpc::grpc protobuf::protobuf boost::boost
gtest::gtest
grpc::grpc protobuf::protobuf boost::boost
)
...
...
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