fixed CMake Error given target "Sync" which does not exist #243
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Issue Description
The CMake configuration process fails due to a non-existent target
Syncbeing included inINSTALL_TARGETSwhenREALM_ENABLE_SYNC=OFF. The targetSyncshould only be appended toINSTALL_TARGETSif synchronization is enabled.Repro Steps
What Happened?
The build fails with the following error:
The target
Syncis being appended toINSTALL_TARGETSunconditionally, without checking if it has been created. WhenREALM_ENABLE_SYNC=OFF, theSynctarget is not defined, causing the error during the installation phase.Fix Proposal
Update the
src/CMakeLists.txtto conditionally append theSynctarget only if it has been created. The following changes are required:This ensures that the
Synctarget is only included whenREALM_ENABLE_SYNC=ON, avoiding errors during installation when synchronization is disabled.Version
2.2.0CMakeAtlas Services in Use
Compiler
OS and Version
Code Snippets
Relevant code snippet causing the issue:
set(INSTALL_TARGETS ObjectStore Storage QueryParser Sync)Stacktrace of the Exception/Crash
CMake Error at src/CMakeLists.txt:159 (install):
install TARGETS given target "Sync" which does not exist.
Relevant Log Output
No additional log output provided.