GEODE-5638: Use cmake to generate the SQLiteCLI plugin project into cli folder

* Generate and reorganize SQLiteCLI project
* Fix reference to System.Data.SQLite
* Define DOTNET_TARGET_FRAMEWORK_VERSION at top level
* Remove redundant variable.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cd4e511..6afe85c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -35,6 +35,8 @@
   endif()
 endif()
 
+set(DOTNET_TARGET_FRAMEWORK_VERSION "4.5.2")
+
 set(BUILD_BITS 64 CACHE STRING "Build for 64 (Geode default) or 32 bit.")
 
 set(PRODUCT_VENDOR "Apache" CACHE STRING "Product vendor")
@@ -349,7 +351,6 @@
 add_subdirectory(tests/javaobject)
 if (${BUILD_CLI})
   add_subdirectory(clicache)
-  add_subdirectory(plugins/SQLiteCLI)
 endif()
 add_subdirectory(tests)
 
diff --git a/clicache/CMakeLists.txt b/clicache/CMakeLists.txt
index 1b26f25..9895a75 100644
--- a/clicache/CMakeLists.txt
+++ b/clicache/CMakeLists.txt
@@ -27,3 +27,5 @@
 add_subdirectory(test2)
 add_subdirectory(integration-test)
 add_subdirectory(integration-test2)
+add_subdirectory(plugins/SQLiteCLI)
+
diff --git a/clicache/integration-test/CMakeLists.txt b/clicache/integration-test/CMakeLists.txt
index a278c97..be29435 100644
--- a/clicache/integration-test/CMakeLists.txt
+++ b/clicache/integration-test/CMakeLists.txt
@@ -23,8 +23,6 @@
   set (NUNIT_CONSOLE "nunit-console-x86")
 endif()
 
-# Set the .NET Target Framework (Note: This should match the build for Apache.Geode.)
-set (DOTNET_TARGET_FRAMEWORK_VERSION "v4.5.2")
 
 foreach(var CMAKE_CURRENT_SOURCE_DIR CMAKE_SOURCE_DIR CMAKE_BINARY_DIR CMAKE_CURRENT_BINARY_DIR)
   file(TO_NATIVE_PATH ${${var}} ${var}_NATIVE)
diff --git a/clicache/integration-test2/CMakeLists.txt b/clicache/integration-test2/CMakeLists.txt
index 1d88366..d7d177e 100644
--- a/clicache/integration-test2/CMakeLists.txt
+++ b/clicache/integration-test2/CMakeLists.txt
@@ -64,7 +64,7 @@
   VS_GLOBAL_TreatWarningsAsErrors True
   VS_GLOBAL_TestProjectType UnitTest
   VS_GLOBAL_PROJECT_TYPES "{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
-  VS_DOTNET_TARGET_FRAMEWORK_VERSION "v4.5.2"
+  VS_DOTNET_TARGET_FRAMEWORK_VERSION ${DOTNET_TARGET_FRAMEWORK_VERSION}
   VS_DOTNET_REFERENCES "System;System.Xml;System.Web;System.Configuration"
   VS_DOTNET_REFERENCE_Microsoft.VisualStudio.TestPlatform.TestFramework "${CMAKE_BINARY_DIR}/clicache/packages/Microsoft.VisualStudio.TestPlatform.14.0.0.1/lib/net20/Microsoft.VisualStudio.TestPlatform.TestFramework.dll"
   VS_DOTNET_REFERENCE_Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions "${CMAKE_BINARY_DIR}/clicache/packages/Microsoft.VisualStudio.TestPlatform.14.0.0.1/lib/net20/Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll"
diff --git a/plugins/SQLiteCLI/AssemblyInfo.cs b/clicache/plugins/SQLiteCLI/AssemblyInfo.cs
similarity index 100%
rename from plugins/SQLiteCLI/AssemblyInfo.cs
rename to clicache/plugins/SQLiteCLI/AssemblyInfo.cs
diff --git a/clicache/plugins/SQLiteCLI/CMakeLists.txt b/clicache/plugins/SQLiteCLI/CMakeLists.txt
new file mode 100644
index 0000000..fa07224
--- /dev/null
+++ b/clicache/plugins/SQLiteCLI/CMakeLists.txt
@@ -0,0 +1,39 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+# 
+#      http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+cmake_minimum_required(VERSION 3.10)
+project(Apache.Geode.Plugins.SQLite CSharp)
+
+add_library( ${PROJECT_NAME} SHARED
+    AssemblyInfo.cs
+    SqLiteImpl.cs
+)
+
+target_link_libraries(${PROJECT_NAME}
+  PUBLIC
+    Apache.Geode
+    PdxClassLibrary
+)
+
+set_target_properties( ${PROJECT_NAME} PROPERTIES
+  COMMON_LANGUAGE_RUNTIME ""
+  VS_GLOBAL_ROOTNAMESPACE ${PROJECT_NAME}
+  VS_GLOBAL_TreatWarningsAsErrors True
+  VS_GLOBAL_PROJECT_TYPES "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
+  VS_DOTNET_TARGET_FRAMEWORK_VERSION ${DOTNET_TARGET_FRAMEWORK_VERSION}
+  VS_DOTNET_REFERENCE_System.Data.SQLite ${sqlite-netFx_SHARED_LIB}
+  VS_DOTNET_REFERENCES "System;System.Data;System.Xml"
+  FOLDER cli/plugins
+)
\ No newline at end of file
diff --git a/plugins/SQLiteCLI/SqLiteImpl.cs b/clicache/plugins/SQLiteCLI/SqLiteImpl.cs
similarity index 100%
rename from plugins/SQLiteCLI/SqLiteImpl.cs
rename to clicache/plugins/SQLiteCLI/SqLiteImpl.cs
diff --git a/clicache/src/CMakeLists.txt b/clicache/src/CMakeLists.txt
index 7e975b8..1bd3726 100644
--- a/clicache/src/CMakeLists.txt
+++ b/clicache/src/CMakeLists.txt
@@ -309,7 +309,7 @@
   VS_GLOBAL_KEYWORD "ManagedCProj"
   VS_GLOBAL_PROJECT_TYPES "{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}"
   VS_GLOBAL_ROOTNAMESPACE ${PROJECT_NAME}
-  VS_DOTNET_TARGET_FRAMEWORK_VERSION "v4.5.2"
+  VS_DOTNET_TARGET_FRAMEWORK_VERSION ${DOTNET_TARGET_FRAMEWORK_VERSION}
   VS_DOTNET_REFERENCES "System;System.Xml;System.Core"
   FOLDER cli
 )
diff --git a/clicache/src/templates/CMakeLists.txt b/clicache/src/templates/CMakeLists.txt
index 2868df5..6c5f4e7 100644
--- a/clicache/src/templates/CMakeLists.txt
+++ b/clicache/src/templates/CMakeLists.txt
@@ -15,10 +15,6 @@
 cmake_minimum_required(VERSION 3.4)
 project(nativeclient.clicache.templates)
 
-# Set the .NET Target Framework (Note: This should match the build for Apache.Geode.)
-set (DOTNET_TARGET_FRAMEWORK_VERSION "v4.5.2")
-
-
 foreach(var CMAKE_CURRENT_SOURCE_DIR CMAKE_SOURCE_DIR CMAKE_BINARY_DIR CMAKE_CURRENT_BINARY_DIR)
   file(TO_NATIVE_PATH ${${var}} ${var}_NATIVE)
 endforeach()
diff --git a/clicache/test/CMakeLists.txt b/clicache/test/CMakeLists.txt
index 6570f7f..b477546 100644
--- a/clicache/test/CMakeLists.txt
+++ b/clicache/test/CMakeLists.txt
@@ -39,7 +39,7 @@
   VS_GLOBAL_TestProjectType UnitTest
   VS_GLOBAL_PROJECT_TYPES "{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}"
   VS_GLOBAL_ROOTNAMESPACE Apache.Geode.Test
-  VS_DOTNET_TARGET_FRAMEWORK_VERSION "v4.5.2"
+  VS_DOTNET_TARGET_FRAMEWORK_VERSION ${DOTNET_TARGET_FRAMEWORK_VERSION}
   VS_DOTNET_REFERENCES "System;System.Xml;Microsoft.VisualStudio.QualityTools.UnitTestFramework"
   FOLDER cli/test/unit
 )
diff --git a/clicache/test2/CMakeLists.txt b/clicache/test2/CMakeLists.txt
index f237592..0fffc3e 100644
--- a/clicache/test2/CMakeLists.txt
+++ b/clicache/test2/CMakeLists.txt
@@ -42,7 +42,7 @@
   VS_GLOBAL_TreatWarningsAsErrors True
   VS_GLOBAL_TestProjectType UnitTest
   VS_GLOBAL_PROJECT_TYPES "{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
-  VS_DOTNET_TARGET_FRAMEWORK_VERSION "v4.5.2"
+  VS_DOTNET_TARGET_FRAMEWORK_VERSION ${DOTNET_TARGET_FRAMEWORK_VERSION}
   VS_DOTNET_REFERENCES "System;System.Xml;System.Web;System.Configuration"
   VS_DOTNET_REFERENCE_Microsoft.VisualStudio.TestPlatform.TestFramework "${CMAKE_BINARY_DIR}/clicache/packages/Microsoft.VisualStudio.TestPlatform.14.0.0.1/lib/net20/Microsoft.VisualStudio.TestPlatform.TestFramework.dll"
   VS_DOTNET_REFERENCE_Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions "${CMAKE_BINARY_DIR}/clicache/packages/Microsoft.VisualStudio.TestPlatform.14.0.0.1/lib/net20/Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll"
diff --git a/plugins/SQLiteCLI/CMakeLists.txt b/plugins/SQLiteCLI/CMakeLists.txt
deleted file mode 100644
index 758df65..0000000
--- a/plugins/SQLiteCLI/CMakeLists.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-# 
-#      http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-cmake_minimum_required(VERSION 3.10)
-project(nativeclient.plugins.SQLiteCLI)
-
-# Set the .NET Target Framework (Note: This should match the build for Apache.Geode.)
-set (DOTNET_TARGET_FRAMEWORK_VERSION "v4.5.2")
-
-foreach(var CMAKE_CURRENT_SOURCE_DIR CMAKE_SOURCE_DIR CMAKE_BINARY_DIR CMAKE_CURRENT_BINARY_DIR)
-  file(TO_NATIVE_PATH ${${var}} ${var}_NATIVE)
-endforeach()
-
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/SQLiteCLI.csproj.in ${CMAKE_CURRENT_BINARY_DIR}/SQLiteCLI.csproj)  
-include_external_msproject(
-      SQLiteCLI  ${CMAKE_CURRENT_BINARY_DIR}/SQLiteCLI.csproj
-      TYPE FAE04EC0-301F-11D3-BF4B-00C04F79EFBC)
diff --git a/plugins/SQLiteCLI/SQLiteCLI.csproj.in b/plugins/SQLiteCLI/SQLiteCLI.csproj.in
deleted file mode 100644
index 54ac914..0000000
--- a/plugins/SQLiteCLI/SQLiteCLI.csproj.in
+++ /dev/null
@@ -1,111 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one or more
-  contributor license agreements.  See the NOTICE file distributed with
-  this work for additional information regarding copyright ownership.
-  The ASF licenses this file to You under the Apache License, Version 2.0
-  (the "License"); you may not use this file except in compliance with
-  the License.  You may obtain a copy of the License at
-  
-       http://www.apache.org/licenses/LICENSE-2.0
-  
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
--->
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
-  <PropertyGroup>
-    <CMAKE_SOURCE_DIR>${CMAKE_SOURCE_DIR_NATIVE}</CMAKE_SOURCE_DIR>
-    <CMAKE_CURRENT_SOURCE_DIR>${CMAKE_CURRENT_SOURCE_DIR_NATIVE}</CMAKE_CURRENT_SOURCE_DIR>
-    <CMAKE_BINARY_DIR>${CMAKE_BINARY_DIR_NATIVE}</CMAKE_BINARY_DIR>
-    <CMAKE_CURRENT_BINARY_DIR>${CMAKE_CURRENT_BINARY_DIR_NATIVE}</CMAKE_CURRENT_BINARY_DIR>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">x64</Platform>
-    <ProductVersion>8.0.50727</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{FF9597E3-A4DD-4FDE-871D-B0C66088762F}</ProjectGuid>
-    <OutputType>Library</OutputType>
-    <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>Apache.Geode.Plugins.SQLite</RootNamespace>
-    <AssemblyName>Apache.Geode.Plugins.SQLite</AssemblyName>
-    <SignAssembly>${STRONG_NAME_KEY_ENABLED}</SignAssembly>
-    <AssemblyOriginatorKeyFile>${STRONG_NAME_KEY}</AssemblyOriginatorKeyFile>
-    <TargetFrameworkVersion>${DOTNET_TARGET_FRAMEWORK_VERSION}</TargetFrameworkVersion>
-    <FileUpgradeFlags>
-    </FileUpgradeFlags>
-    <OldToolsVersion>2.0</OldToolsVersion>
-    <UpgradeBackupLocation />
-    <PublishUrl>publish\</PublishUrl>
-    <Install>true</Install>
-    <InstallFrom>Disk</InstallFrom>
-    <UpdateEnabled>false</UpdateEnabled>
-    <UpdateMode>Foreground</UpdateMode>
-    <UpdateInterval>7</UpdateInterval>
-    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
-    <UpdatePeriodically>false</UpdatePeriodically>
-    <UpdateRequired>false</UpdateRequired>
-    <MapFileExtensions>true</MapFileExtensions>
-    <ApplicationRevision>0</ApplicationRevision>
-    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
-    <IsWebBootstrapper>false</IsWebBootstrapper>
-    <UseApplicationTrust>false</UseApplicationTrust>
-    <BootstrapperEnabled>true</BootstrapperEnabled>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
-    <DebugSymbols>true</DebugSymbols>
-    <IntermediateOutputPath>Debug</IntermediateOutputPath>
-    <OutputPath>Debug</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
-    <DebugType>full</DebugType>
-    <PlatformTarget>x64</PlatformTarget>
-    <ErrorReport>prompt</ErrorReport>
-    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
-    <WarningLevel>4</WarningLevel>
-    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
-    <IntermediateOutputPath>Release</IntermediateOutputPath>
-    <OutputPath>Release</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
-    <Optimize>true</Optimize>
-    <DebugType>pdbonly</DebugType>
-    <PlatformTarget>x64</PlatformTarget>
-    <ErrorReport>prompt</ErrorReport>
-    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
-    <WarningLevel>4</WarningLevel>
-    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System" />
-    <Reference Include="System.Data" />
-    <Reference Include="System.Data.SQLite">
-      <HintPath>${sqlite-netFx_SHARED_LIB}</HintPath>
-      <Private>False</Private>
-    </Reference>
-    <Reference Include="System.Xml" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="$(CMAKE_BINARY_DIR)\clicache\src\Apache.Geode.vcxproj">
-      <CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
-      <ReferenceOutputAssembly>true</ReferenceOutputAssembly>
-    </ProjectReference>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="$(CMAKE_SOURCE_DIR)\plugins\SQLiteCLI\AssemblyInfo.cs">
-      <Link>AssemblyInfo.cs</Link>
-    </Compile>
-    <Compile Include="$(CMAKE_SOURCE_DIR)\plugins\SQLiteCLI\SqLiteImpl.cs">
-      <Link>SqLiteImpl.cs</Link>
-    </Compile>
-  </ItemGroup>
-  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
-  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
-       Other similar extension points exist, see Microsoft.Common.targets.
-  <Target Name="BeforeBuild">
-  </Target>
-  <Target Name="AfterBuild">
-  </Target>
-  -->
-</Project>
diff --git a/tests/cli/CMakeLists.txt b/tests/cli/CMakeLists.txt
index a9c538f..f48a390 100644
--- a/tests/cli/CMakeLists.txt
+++ b/tests/cli/CMakeLists.txt
@@ -31,7 +31,7 @@
 endif()
 
 # Set the .NET Target Framework (Note: This should match the build for Apache.Geode.)
-set (DOTNET_TARGET_FRAMEWORK_VERSION "v4.5.2")
+set (DOTNET_TARGET_FRAMEWORK_VERSION ${DOTNET_TARGET_FRAMEWORK_VERSION})
 
 foreach(var CMAKE_CURRENT_SOURCE_DIR CMAKE_SOURCE_DIR CMAKE_BINARY_DIR CMAKE_CURRENT_BINARY_DIR)
   file(TO_NATIVE_PATH ${${var}} ${var}_NATIVE)
diff --git a/tests/cli/PdxClassLibrary/CMakeLists.txt b/tests/cli/PdxClassLibrary/CMakeLists.txt
index 5602d0c..f15a179 100644
--- a/tests/cli/PdxClassLibrary/CMakeLists.txt
+++ b/tests/cli/PdxClassLibrary/CMakeLists.txt
@@ -37,7 +37,7 @@
   VS_GLOBAL_ROOTNAMESPACE PdxClassLibrary
   VS_GLOBAL_TreatWarningsAsErrors True
   VS_GLOBAL_PROJECT_TYPES "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
-  VS_DOTNET_TARGET_FRAMEWORK_VERSION "v4.5.2"
+  VS_DOTNET_TARGET_FRAMEWORK_VERSION ${DOTNET_TARGET_FRAMEWORK_VERSION}
   VS_DOTNET_REFERENCES "System;System.Xml;System.Data"
   FOLDER cli/test/integration
 )
diff --git a/tests/cli/PkcsWrapper/CMakeLists.txt b/tests/cli/PkcsWrapper/CMakeLists.txt
index 36975d4..be7c8d1 100644
--- a/tests/cli/PkcsWrapper/CMakeLists.txt
+++ b/tests/cli/PkcsWrapper/CMakeLists.txt
@@ -32,7 +32,7 @@
   VS_GLOBAL_KEYWORD "ManagedCProj"
   VS_GLOBAL_PROJECT_TYPES "{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}"
   VS_GLOBAL_ROOTNAMESPACE "Apache.Geode.Client.Tests"
-  VS_DOTNET_TARGET_FRAMEWORK_VERSION "v4.5.2"
+  VS_DOTNET_TARGET_FRAMEWORK_VERSION ${DOTNET_TARGET_FRAMEWORK_VERSION}
   VS_DOTNET_REFERENCES "System;System.Xml"
 )
 
diff --git a/tests/cli/QueryHelper/CMakeLists.txt b/tests/cli/QueryHelper/CMakeLists.txt
index 5b8d19c..94d632b 100644
--- a/tests/cli/QueryHelper/CMakeLists.txt
+++ b/tests/cli/QueryHelper/CMakeLists.txt
@@ -27,7 +27,7 @@
   VS_GLOBAL_KEYWORD "ManagedCProj"
   VS_GLOBAL_PROJECT_TYPES "{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}"
   VS_GLOBAL_ROOTNAMESPACE "Apache.Geode.Client.Tests"
-  VS_DOTNET_TARGET_FRAMEWORK_VERSION "v4.5.2"
+  VS_DOTNET_TARGET_FRAMEWORK_VERSION ${DOTNET_TARGET_FRAMEWORK_VERSION}
   VS_DOTNET_REFERENCES "System;System.Xml"
 )