What is the correct stucture of a Realm C++ project files and how to run the project?

I am very new to Realm. I am using Realm C++ SDK to make a sample database that can sync with MongoDB Atlas.

As a summary of what I did,

  1. I built the Realm C++ SDK (this github issue shows how I built the SDK)
  2. I made a Realm app on MongoDB Atlas
  3. I pulled the Realm app MyRealmApp from terminal using realm-cli, from directory realm_test
  4. I made modification on the realm_test/MyRealmApp/auth/providers.json and realm_test/MyRealmApp/sync/config.json to fulfill the prerequisites

After building the SDK following the documentation, and creating an app that fulfills the prerequisites, this is the resulting project file structure.

.realm_test
├──build
|   ├── ... //everything inside 'build' is generated by CMakeLists.txt
|   
├──CMakeLists.txt //this file builds the SDK
|   
├──main.cpp //this is the test code I used when building the SDK
|   
├──MyRealmApp //this is the app I created after building the SDK, everything under this is generated, with some modification
|   |   
|   ├──auth
|   |   ├──custom_user_data.json
|   |   ├──providers.json
|   |   
|   ├──data_sources
|   |   ├──mongodb-atlas
|   |       ├──config.json
|   |   
|   ├──environments
|   |   ├──development.json
|   |   ├──no-environment.json
|   |   ├──production.json
|   |   ├──qa.json
|   |   ├──testing.json
|   |   
|   ├──functions
|   |   ├──config.json
|   |   
|   ├──graphql
|   |   ├──custom_resovlers
|   |       ├──config.json
|   |   
|   ├──http_endpoints
|   |   ├──config.json
|   |   
|   ├──log_forwarders
|   |   
|   ├──services
|   |   
|   ├──sync
|   |   ├──config.json
|   |
|   ├──values
|
├──realm_config.json

The next step is, I want to access and use the DB through C++ codes, as in the quick start.

My question is,

  1. Is my current project file structure correct?
  2. Where should I put the C++ source codes?
  3. How to build and run the Realm project?
    • Do I need to remove the ./realm_test/build, modify the CMakeLists.txt and run cmake again?
    • If I need to modify the CMakeLists.txt, which part do I need to modify? (I am also new to CMake)

*this question is a copy of this stackoverflow question.