Comments (4)
@leemaguire : Could I request you to please throw some lights here, I am really stuck. Thanks for your help, in advance.
from realm-cpp.
Hi @vtharmalingam can you share your CMakeLists.txt file showing how you are using realm as a dependancy?
from realm-cpp.
This is the simplified view of my project setting:
.
├── Project/
│ └── src/
│ ├── realm-db/
│ │ ├── a.cpp
│ │ ├── b.cpp
│ │ └── CMakeLists.txt <-------------- (3)
│ ├── grpc_server.cpp
│ ├── grpc_client.cpp
│ └── CMakeLists.txt <-------------- (2) : add_subdirectory(3) / [Links realm-db.lib]
└── CMakeLists.txt <-------------- (1) : add_subdirectory(2)
CMakeListstxt (1)
cmake_minimum_required(VERSION 3.28)
# Visual Studio 17 2022
set(CMAKE_GENERATOR "Visual Studio 17 2022" CACHE INTERNAL "" FORCE)
cmake_policy(SET CMP0091 NEW)
project(example)
# This variable is crucial if you do not define built type...
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:preprocessor /bigobj")
endif()
# REFER: https://stackoverflow.com/questions/14172856/compile-with-mt-instead-of-md-using-cmake
set(CompilerFlags
CMAKE_CXX_FLAGS
CMAKE_CXX_FLAGS_DEBUG
CMAKE_CXX_FLAGS_RELEASE
CMAKE_C_FLAGS
CMAKE_C_FLAGS_DEBUG
CMAKE_C_FLAGS_RELEASE
)
foreach(CompilerFlag ${CompilerFlags})
string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}")
endforeach()
find_package(asio-grpc CONFIG REQUIRED)
find_package(Boost REQUIRED)
add_subdirectory(src)
CMakeListstxt (2)
add_subdirectory(realm-db)
add_executable(server)
target_sources(server PRIVATE grpc_server.cpp)
target_include_directories(server
PRIVATE
)
target_link_libraries(server PRIVATE
asio-grpc::asio-grpc
Boost::headers
example_grpc_proto # Proto Building & Linking it as Lib
realm_db # Real DB Interface
)
target_include_directories(server PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}")
target_compile_features(server PRIVATE cxx_std_20)
CMakeListstxt (3)
# ZLIP
find_package(ZLIB REQUIRED)
find_package(nlohmann_json REQUIRED)
find_package(OpenSSL)
# We are not going to run tests
set (REALM_CPP_NO_TESTS ON )
add_library(realm_db STATIC)
target_sources(realm_db PRIVATE
# ${CMAKE_CURRENT_SOURCE_DIR}
my_realm.hpp
db_structs.hpp
db_instance.cpp
db_reader.cpp
db_writer.cpp
)
target_compile_features(realm_db PUBLIC cxx_std_20)
Include(FetchContent)
# Declare the version of the Realm C++ SDK you want to download
FetchContent_Declare(
cpprealm
GIT_REPOSITORY https://github.com/realm/realm-cpp.git
GIT_TAG v1.0.0
)
FetchContent_MakeAvailable(cpprealm)
if(MSVC)
set_property(TARGET cpprealm PROPERTY
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif()
target_link_libraries(realm_db
PUBLIC
cpprealm
nlohmann_json::nlohmann_json
OpenSSL::SSL OpenSSL::Crypto
# Realm required this as well
ZLIB::ZLIB
)
from realm-cpp.
After digging bit more tweaking, I landed in another issue i guess on grpc side. So let me close this issue. Thanks for your help.
from realm-cpp.
Related Issues (20)
- Upgrade to Realm Core 14.2.0 HOT 1
- Update default base URL to new domain HOT 1
- Add privacy manifest to apple binaries HOT 1
- Expose an API that allows merging collections rather than replacing them HOT 1
- Handle Role Changes without Client Reset HOT 1
- Upgrade to Realm Core 14.4.0 HOT 1
- Add BSON support HOT 1
- Prepare v1.1.0 release HOT 1
- Switch to Baasaas from Cloud QA HOT 1
- Windows build error with 1.1.0 HOT 3
- [CPP] Create distribution channel HOT 1
- [CPP] Add Migration support HOT 1
- SDKs should not consume stitch_ prefixed fields HOT 2
- Add ability to declare smart pointers in schema HOT 1
- Expose to_json API HOT 1
- Add TRUEPREDICATE and FALSEPREDICATE to TSQ API HOT 1
- Fix queries on std::map HOT 1
- Proxy-Settings not working since version 1.1.1 HOT 2
- `libproc2-dev` replaces `libprocps-dev` on Ubuntu 24 HOT 1
- no type named 'uint_fast16_t' in namespace 'std' (Ubuntu + Clang) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from realm-cpp.