Merge https://github.com/apache/logging-log4cxx
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..91cfb74
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,52 @@
+cmake_minimum_required(VERSION 3.13)
+include(src/cmake/projectVersionDetails.cmake)
+project(log4cxx VERSION ${log4cxx_VER} LANGUAGES CXX)
+include(CTest)
+
+# FindAPR and FindAPR-util are not provided by APR and APR-Util so source them locally
+list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/src/cmake")
+
+# Find Apache Runtime
+find_package(APR QUIET)
+# If APR find module sets the cache, the following will do nothing
+find_path(APR_INCLUDE_DIR apr.h PATH_SUFFIXES apr-1)
+find_library(APR_LIBRARIES NAMES libapr-1 apr-1)
+
+# Find Apache Runtime Utilities
+find_package(APR-Util QUIET)
+# If APR-UTIL find module sets the cache, the following will do nothing
+find_path(APR_UTIL_INCLUDE_DIR apu.h PATH_SUFFIXES apr-1)
+find_library(APR_UTIL_LIBRARIES NAMES libaprutil-1 aprutil-1)
+
+# Building
+add_subdirectory(src)
+
+## Installing
+install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/src/main/include/log4cxx
+  DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
+  FILES_MATCHING PATTERN "*.h"
+)
+install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src/main/include/log4cxx
+  DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
+  FILES_MATCHING PATTERN "*.h"
+)
+
+install(TARGETS log4cxx EXPORT log4cxxTargets
+  RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} 
+  ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+  LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+  INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
+)
+IF(WIN32 AND LOG4CXX_INSTALL_PDB)
+  INSTALL(FILES $<TARGET_PDB_FILE:log4cxx>
+          DESTINATION ${CMAKE_INSTALL_BINDIR}
+          CONFIGURATIONS RelWithDebInfo Debug
+  )
+ENDIF()
+
+# create export file which can be imported by other cmake projects
+install(EXPORT log4cxxTargets
+  FILE log4cxx-targets.cmake
+  NAMESPACE log4cxx::
+  DESTINATION share/cmake/log4cxx
+)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644
index 0000000..39420dd
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,13 @@
+add_subdirectory(main)
+target_include_directories(log4cxx INTERFACE $<INSTALL_INTERFACE:include> PRIVATE ${APR_INCLUDE_DIR} ${APR_UTIL_INCLUDE_DIR})
+target_link_libraries(log4cxx PRIVATE ${APR_LIBRARIES} ${APR_UTIL_LIBRARIES})
+if(WIN32)
+# The ODBC appender is always enabled in the Windows configuration
+target_link_libraries(log4cxx PRIVATE odbc32.lib)
+option(LOG4CXX_INSTALL_PDB "Install .pdb files (if generated)"  ON)
+endif()
+
+if(BUILD_TESTING)
+   add_subdirectory(test)
+   add_subdirectory(examples/cpp)
+endif()
diff --git a/src/cmake/FindAPR-Util.cmake b/src/cmake/FindAPR-Util.cmake
new file mode 100644
index 0000000..3485911
--- /dev/null
+++ b/src/cmake/FindAPR-Util.cmake
@@ -0,0 +1,40 @@
+# Locate APR-Util include paths and libraries
+include(FindPackageHandleStandardArgs)
+
+# This module defines
+# APR_UTIL_INCLUDE_DIR, where to find apr.h, etc.
+# APR_UTIL_LIBRARIES, the libraries to link against to use APR.
+# APR_UTIL_FOUND, set to yes if found
+
+macro(_apu_invoke _varname)
+    execute_process(
+        COMMAND ${APR_UTIL_CONFIG_EXECUTABLE} ${ARGN}
+        OUTPUT_VARIABLE _apr_output
+        RESULT_VARIABLE _apr_failed
+    )
+
+    if(_apr_failed)
+        message(FATAL_ERROR "apu-1-config ${ARGN} failed with result ${_apr_failed}")
+    else(_apr_failed)
+        string(REGEX REPLACE "[\r\n]"  "" _apr_output "${_apr_output}")
+        string(REGEX REPLACE " +$"     "" _apr_output "${_apr_output}")
+        string(REGEX REPLACE "^ +"     "" _apr_output "${_apr_output}")
+
+        separate_arguments(_apr_output)
+
+        set(${_varname} "${_apr_output}")
+    endif(_apr_failed)
+endmacro(_apu_invoke)
+
+find_program(APR_UTIL_CONFIG_EXECUTABLE
+    apu-1-config
+    PATHS /usr/local/bin    /usr/bin    C:/Progra~1/apr-util/bin
+    )
+mark_as_advanced(APR_UTIL_CONFIG_EXECUTABLE)
+if(EXISTS ${APR_UTIL_CONFIG_EXECUTABLE})
+    _apu_invoke(APR_UTIL_INCLUDE_DIR   --includedir)
+    _apu_invoke(APR_UTIL_LIBRARIES     --link-ld)
+endif()
+
+find_package_handle_standard_args(apr-util DEFAULT_MSG
+  APR_UTIL_INCLUDE_DIR APR_UTIL_LIBRARIES)
diff --git a/src/cmake/FindAPR.cmake b/src/cmake/FindAPR.cmake
new file mode 100644
index 0000000..171d745
--- /dev/null
+++ b/src/cmake/FindAPR.cmake
@@ -0,0 +1,39 @@
+# Locate APR include paths and libraries
+include(FindPackageHandleStandardArgs)
+
+# This module defines
+# APR_INCLUDE_DIR, where to find apr.h, etc.
+# APR_LIBRARIES, the libraries to link against to use APR.
+# APR_FOUND, set to 'yes' if found
+macro(_apr_invoke _varname)
+    execute_process(
+        COMMAND ${APR_CONFIG_EXECUTABLE} ${ARGN}
+        OUTPUT_VARIABLE _apr_output
+        RESULT_VARIABLE _apr_failed
+    )
+
+    if(_apr_failed)
+        message(FATAL_ERROR "apr-1-config ${ARGN} failed with result ${_apr_failed}")
+    else(_apr_failed)
+        string(REGEX REPLACE "[\r\n]"  "" _apr_output "${_apr_output}")
+        string(REGEX REPLACE " +$"     "" _apr_output "${_apr_output}")
+        string(REGEX REPLACE "^ +"     "" _apr_output "${_apr_output}")
+
+        separate_arguments(_apr_output)
+        set(${_varname} "${_apr_output}")
+    endif(_apr_failed)
+endmacro(_apr_invoke)
+
+
+find_program(APR_CONFIG_EXECUTABLE
+    apr-1-config
+    PATHS /usr/local/bin    /usr/bin    C:/Progra~1/apr/bin
+    )
+mark_as_advanced(APR_CONFIG_EXECUTABLE)
+if(EXISTS ${APR_CONFIG_EXECUTABLE})
+    _apr_invoke(APR_INCLUDE_DIR  --includedir)
+    _apr_invoke(APR_LIBRARIES  --link-ld)
+endif()
+
+find_package_handle_standard_args(apr
+    APR_INCLUDE_DIR APR_LIBRARIES)
diff --git a/src/cmake/projectVersionDetails.cmake b/src/cmake/projectVersionDetails.cmake
new file mode 100644
index 0000000..68bda9b
--- /dev/null
+++ b/src/cmake/projectVersionDetails.cmake
@@ -0,0 +1,5 @@
+# This file should contain nothing but the following line
+# setting the project version. The variable name must not
+# clash with the log4cxx_VERSION* variables automatically
+# defined by the project() command.
+set(log4cxx_VER 0.11.0.0)
diff --git a/src/examples/cpp/CMakeLists.txt b/src/examples/cpp/CMakeLists.txt
new file mode 100644
index 0000000..ed0412a
--- /dev/null
+++ b/src/examples/cpp/CMakeLists.txt
@@ -0,0 +1,7 @@
+set(ALL_LOG4CXX_EXAMPLES console delayedloop stream trivial)
+
+foreach(exampleName IN LISTS ALL_LOG4CXX_EXAMPLES)
+    add_executable(${exampleName} ${exampleName}.cpp)
+    target_include_directories(${exampleName} PRIVATE ${CMAKE_CURRENT_LIST_DIR} $<TARGET_PROPERTY:log4cxx,INCLUDE_DIRECTORIES>)
+    target_link_libraries(${exampleName} PRIVATE log4cxx ${APR_LIBRARIES})
+endforeach()
diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt
new file mode 100644
index 0000000..80dd6d8
--- /dev/null
+++ b/src/main/CMakeLists.txt
@@ -0,0 +1,10 @@
+add_subdirectory(include)
+add_subdirectory(cpp)
+add_subdirectory(resources)
+
+# setup include directories 
+include(GNUInstallDirs)
+target_include_directories(log4cxx PUBLIC 
+  $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
+  $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
+)
diff --git a/src/main/cpp/CMakeLists.txt b/src/main/cpp/CMakeLists.txt
new file mode 100644
index 0000000..3571cf5
--- /dev/null
+++ b/src/main/cpp/CMakeLists.txt
@@ -0,0 +1,165 @@
+
+# Options
+option(LOG4CXX_BLOCKING_ASYNC_APPENDER "Async appender behaviour" ON)
+option(BUILD_SHARED_LIBS "Build shared libraries" ON)
+
+# Build the log4cxx library
+add_library(log4cxx action.cpp)
+if(BUILD_SHARED_LIBS)
+    target_compile_definitions(log4cxx PRIVATE LOG4CXX)
+else()
+    target_compile_definitions(log4cxx PUBLIC LOG4CXX_STATIC)
+endif()
+add_dependencies(log4cxx configure_log4cxx)
+target_sources(log4cxx
+  PRIVATE
+  andfilter.cpp
+  appenderattachableimpl.cpp
+  appenderskeleton.cpp
+  aprinitializer.cpp
+  $<IF:$<BOOL:LOG4CXX_BLOCKING_ASYNC_APPENDER>,asyncappender.cpp,asyncappender_nonblocking.cpp>
+  basicconfigurator.cpp
+  bufferedwriter.cpp
+  bytearrayinputstream.cpp
+  bytearrayoutputstream.cpp
+  bytebuffer.cpp
+  cacheddateformat.cpp
+  charsetdecoder.cpp
+  charsetencoder.cpp
+  class.cpp
+  classnamepatternconverter.cpp
+  classregistration.cpp
+  condition.cpp
+  configurator.cpp
+  consoleappender.cpp
+  cyclicbuffer.cpp
+  dailyrollingfileappender.cpp
+  datagrampacket.cpp
+  datagramsocket.cpp
+  date.cpp
+  dateformat.cpp
+  datelayout.cpp
+  datepatternconverter.cpp
+  defaultconfigurator.cpp
+  defaultloggerfactory.cpp
+  defaultrepositoryselector.cpp
+  domconfigurator.cpp
+  exception.cpp
+  fallbackerrorhandler.cpp
+  file.cpp
+  fileappender.cpp
+  filedatepatternconverter.cpp
+  fileinputstream.cpp
+  filelocationpatternconverter.cpp
+  fileoutputstream.cpp
+  filerenameaction.cpp
+  filewatchdog.cpp
+  filter.cpp
+  filterbasedtriggeringpolicy.cpp
+  fixedwindowrollingpolicy.cpp
+  formattinginfo.cpp
+  fulllocationpatternconverter.cpp
+  gzcompressaction.cpp
+  hierarchy.cpp
+  htmllayout.cpp
+  inetaddress.cpp
+  inputstream.cpp
+  inputstreamreader.cpp
+  integer.cpp
+  integerpatternconverter.cpp
+  layout.cpp
+  level.cpp
+  levelmatchfilter.cpp
+  levelpatternconverter.cpp
+  levelrangefilter.cpp
+  linelocationpatternconverter.cpp
+  lineseparatorpatternconverter.cpp
+  literalpatternconverter.cpp
+  loader.cpp
+  locale.cpp
+  locationinfo.cpp
+  logger.cpp
+  loggermatchfilter.cpp
+  loggerpatternconverter.cpp
+  loggingevent.cpp
+  loggingeventpatternconverter.cpp
+  loglog.cpp
+  logmanager.cpp
+  logstream.cpp
+  manualtriggeringpolicy.cpp
+  mdc.cpp
+  messagebuffer.cpp
+  messagepatternconverter.cpp
+  methodlocationpatternconverter.cpp
+  mutex.cpp
+  nameabbreviator.cpp
+  namepatternconverter.cpp
+  ndc.cpp
+  ndcpatternconverter.cpp
+  nteventlogappender.cpp
+  objectimpl.cpp
+  objectoutputstream.cpp
+  objectptr.cpp
+  obsoleterollingfileappender.cpp
+  odbcappender.cpp
+  onlyonceerrorhandler.cpp
+  optionconverter.cpp
+  outputdebugstringappender.cpp
+  outputstream.cpp
+  outputstreamwriter.cpp
+  patternconverter.cpp
+  patternlayout.cpp
+  patternparser.cpp
+  pool.cpp
+  properties.cpp
+  propertiespatternconverter.cpp
+  propertyconfigurator.cpp
+  propertyresourcebundle.cpp
+  propertysetter.cpp
+  reader.cpp
+  relativetimedateformat.cpp
+  relativetimepatternconverter.cpp
+  resourcebundle.cpp
+  rollingfileappender.cpp
+  rollingpolicy.cpp
+  rollingpolicybase.cpp
+  rolloverdescription.cpp
+  rootlogger.cpp
+  serversocket.cpp
+  simpledateformat.cpp
+  simplelayout.cpp
+  sizebasedtriggeringpolicy.cpp
+  smtpappender.cpp
+  socket.cpp
+  socketappender.cpp
+  socketappenderskeleton.cpp
+  sockethubappender.cpp
+  socketoutputstream.cpp
+  strftimedateformat.cpp
+  stringhelper.cpp
+  stringmatchfilter.cpp
+  stringtokenizer.cpp
+  synchronized.cpp
+  syslogappender.cpp
+  syslogwriter.cpp
+  system.cpp
+  systemerrwriter.cpp
+  systemoutwriter.cpp
+  telnetappender.cpp
+  threadcxx.cpp
+  threadlocal.cpp
+  threadpatternconverter.cpp
+  threadspecificdata.cpp
+  throwableinformationpatternconverter.cpp
+  timebasedrollingpolicy.cpp
+  timezone.cpp
+  transcoder.cpp
+  transform.cpp
+  triggeringpolicy.cpp
+  ttcclayout.cpp
+  writer.cpp
+  writerappender.cpp
+  xmllayout.cpp
+  xmlsocketappender.cpp
+  zipcompressaction.cpp
+)
diff --git a/src/main/include/CMakeLists.txt b/src/main/include/CMakeLists.txt
new file mode 100644
index 0000000..1939886
--- /dev/null
+++ b/src/main/include/CMakeLists.txt
@@ -0,0 +1,101 @@
+# Configure
+if(WIN32)
+add_custom_target(configure_log4cxx
+  COMMAND "${CMAKE_COMMAND}" -E copy_if_different
+    ${CMAKE_CURRENT_SOURCE_DIR}/log4cxx/log4cxx.hw
+    ${CMAKE_CURRENT_BINARY_DIR}/log4cxx/log4cxx.h
+  COMMAND "${CMAKE_COMMAND}" -E copy_if_different
+    ${CMAKE_CURRENT_SOURCE_DIR}/log4cxx/private/log4cxx_private.hw
+    ${CMAKE_CURRENT_BINARY_DIR}/log4cxx/private/log4cxx_private.h
+  DEPENDS
+    ${CMAKE_CURRENT_SOURCE_DIR}/log4cxx/log4cxx.hw
+    ${CMAKE_CURRENT_SOURCE_DIR}/log4cxx/private/log4cxx_private.hw
+  BYPRODUCTS
+    ${CMAKE_CURRENT_BINARY_DIR}/log4cxx/log4cxx.h
+    ${CMAKE_CURRENT_BINARY_DIR}/log4cxx/private/log4cxx_private.h
+)
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/log4cxx/version_info.h.in
+               ${CMAKE_CURRENT_BINARY_DIR}/log4cxx/version_info.h
+               @ONLY
+)
+else()
+# Configure log4cxx.h
+set(LOG4CXX_CHAR "utf-8" CACHE STRING "Interal character representation, choice of utf-8 (default), wchar_t, unichar")
+set_property(CACHE LOG4CXX_CHAR PROPERTY STRINGS "utf-8" "wchar_t" "unichar")
+set(LOGCHAR_IS_UNICHAR 0)
+set(LOGCHAR_IS_WCHAR 0)
+set(LOGCHAR_IS_UTF8 0)
+if(${LOG4CXX_CHAR} STREQUAL "unichar")
+  set(LOGCHAR_IS_UNICHAR 1)
+elseif(${LOG4CXX_CHAR} STREQUAL "wchar_t")
+  set(LOGCHAR_IS_WCHAR 1)
+else()
+  set(LOGCHAR_IS_UTF8 1)
+endif()
+option(LOG4CXX_WCHAR_T "Enable wchar_t API methods" ON)
+option(LOG4CXX_UNICHAR "Enable UniChar API methods" OFF)
+if(APPLE)
+option(LOG4CXX_CFSTRING "Enable CFString API methods, requires Mac OS/X CoreFoundation" OFF)
+endif()
+set(CHAR_API 1)
+foreach(varName WCHAR_T  UNICHAR  CFSTRING )
+  if(${LOG4CXX_${varName}})
+    set("${varName}_API" 1)
+  else()
+    set("${varName}_API" 0)
+  endif()
+endforeach()
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/log4cxx/log4cxx.h.in
+               ${CMAKE_CURRENT_BINARY_DIR}/log4cxx/log4cxx.h
+               @ONLY
+)
+
+# Configure log4cxx_private.h
+set(LOG4CXX_CHARSET "locale" CACHE STRING "LogString characters, choice of locale (default), utf-8, ISO-8859-1, US-ASCII, EBCDIC")
+set_property(CACHE LOG4CXX_CHARSET PROPERTY STRINGS "locale" "utf-8" "ISO-8859-1" "US-ASCII" "EBCDIC")
+set(CHARSET_EBCDIC 0)
+set(CHARSET_USASCII 0)
+set(CHARSET_ISO88591 0)
+set(CHARSET_UTF8 0)
+if(${LOG4CXX_CHARSET} STREQUAL "EBCDIC")
+  set(CHARSET_EBCDIC 1)
+elseif(${LOG4CXX_CHARSET} STREQUAL "US-ASCII")
+  set(CHARSET_USASCII 1)
+elseif(${LOG4CXX_CHARSET} STREQUAL "ISO-8859-1")
+  set(CHARSET_ISO88591 1)
+elseif(${LOG4CXX_CHARSET} STREQUAL "utf-8")
+  set(CHARSET_UTF8 1)
+endif()
+
+option(LOG4CXX_HAS_STD_LOCALE "Is the standard locale header available?" OFF)
+option(LOG4CXX_HAS_ODBC "Build with ODBC appender?" OFF)
+option(LOG4CXX_HAS_MBSRTOWCS "Default character encoder converts multi-byte string to LogString using mbstowcs()?" OFF)
+option(LOG4CXX_HAS_WCSTOMBS "Default wide character encoder converts using wcstombs()?" OFF)
+option(LOG4CXX_HAS_FWIDE "Is the fwide(fd) function available?" OFF)
+option(LOG4CXX_HAS_LIBESMTP "Use libESMTP in SMTPAppender?" OFF)
+option(LOG4CXX_HAS_SYSLOG "Is the syslog function available?" OFF)
+
+foreach(varName HAS_STD_LOCALE  HAS_ODBC  HAS_MBSRTOWCS  HAS_WCSTOMBS  HAS_FWIDE  HAS_LIBESMTP  HAS_SYSLOG)
+  if(${LOG4CXX_${varName}})
+    set(${varName} 1)
+  else()
+    set(${varName} 0)
+  endif()
+endforeach()
+
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/log4cxx/private/log4cxx_private.h.in
+               ${CMAKE_CURRENT_BINARY_DIR}/log4cxx/private/log4cxx_private.h
+               @ONLY
+)
+
+# Provide the dependencies
+add_custom_target(configure_log4cxx
+  COMMAND "${CMAKE_COMMAND}" -E echo "Checking configuration"
+  DEPENDS
+    ${CMAKE_CURRENT_SOURCE_DIR}/log4cxx/log4cxx.h.in
+    ${CMAKE_CURRENT_SOURCE_DIR}/log4cxx/private/log4cxx_private.h.in
+  BYPRODUCTS
+    ${CMAKE_CURRENT_BINARY_DIR}/log4cxx/log4cxx.h
+    ${CMAKE_CURRENT_BINARY_DIR}/log4cxx/private/log4cxx_private.h
+)
+endif()
diff --git a/src/main/include/log4cxx/version_info.h.in b/src/main/include/log4cxx/version_info.h.in
new file mode 100644
index 0000000..b4331fc
--- /dev/null
+++ b/src/main/include/log4cxx/version_info.h.in
@@ -0,0 +1,5 @@
+// Information used by resource files
+#define INFO_PRODUCT_VERSION_LIST @log4cxx_VERSION_MAJOR@,@log4cxx_VERSION_MINOR@,@log4cxx_VERSION_PATCH@
+#define INFO_PRODUCT_VERSION_STRING "@log4cxx_VERSION@"
+#define INFO_FILE_VERSION_LIST INFO_PRODUCT_VERSION_LIST,@log4cxx_VERSION_TWEAK@
+#define INFO_FILE_VERSION_STRING INFO_PRODUCT_VERSION_STRING "." @log4cxx_VERSION_TWEAK@
diff --git a/src/main/resources/CMakeLists.txt b/src/main/resources/CMakeLists.txt
new file mode 100644
index 0000000..3827357
--- /dev/null
+++ b/src/main/resources/CMakeLists.txt
@@ -0,0 +1,7 @@
+# Configure
+if(WIN32)
+target_sources(log4cxx
+  PRIVATE
+  log4cxx.rc
+)
+endif()
\ No newline at end of file
diff --git a/src/main/resources/log4cxx.rc b/src/main/resources/log4cxx.rc
index d61b19c..3faf8b0 100644
--- a/src/main/resources/log4cxx.rc
+++ b/src/main/resources/log4cxx.rc
@@ -74,10 +74,11 @@
 //

 // Version

 //

+#include <log4cxx/version_info.h>

 

 VS_VERSION_INFO VERSIONINFO

- FILEVERSION 0, 0, 0, 0

- PRODUCTVERSION 0, 0, 0, 0

+ FILEVERSION INFO_FILE_VERSION_LIST

+ PRODUCTVERSION INFO_PRODUCT_VERSION_LIST

  FILEFLAGSMASK 0x17L

 #ifdef _DEBUG

  FILEFLAGS 0x1L

@@ -94,12 +95,12 @@
         BEGIN

             VALUE "CompanyName", "Apache Software Foundation"

             VALUE "FileDescription", "Apache log4cxx"

-            VALUE "FileVersion", "0, 0, 0, 0"

+            VALUE "FileVersion", INFO_FILE_VERSION_STRING

             VALUE "InternalName", "log4cxx"

             VALUE "LegalCopyright",  "Licensed to the Apache Software Foundation (ASF) under one or more\ncontributor license agreements.  See the NOTICE file distributed with\nthis work for additional information regarding copyright ownership.\nThe ASF licenses this file to You under the Apache License, Version 2.0\n(the ""License""); you may not use this file except in compliance with\nthe License.  You may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an ""AS IS"" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License."

             VALUE "OriginalFilename", "log4cxx.dll"

             VALUE "ProductName", "Apache log4cxx"

-            VALUE "ProductVersion", "0, 0, 0, 0"

+            VALUE "ProductVersion", INFO_PRODUCT_VERSION_STRING

         END

     END

     BLOCK "VarFileInfo"

diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt
new file mode 100644
index 0000000..da8ed95
--- /dev/null
+++ b/src/test/CMakeLists.txt
@@ -0,0 +1 @@
+add_subdirectory(cpp)
\ No newline at end of file
diff --git a/src/test/cpp/CMakeLists.txt b/src/test/cpp/CMakeLists.txt
new file mode 100644
index 0000000..7a0ada9
--- /dev/null
+++ b/src/test/cpp/CMakeLists.txt
@@ -0,0 +1,63 @@
+# Components required by all tests
+add_library(testingFramework STATIC abts.cpp appenderskeletontestcase.cpp logunit.cpp vectorappender.cpp writerappendertestcase.cpp )
+target_include_directories(testingFramework PRIVATE ${CMAKE_CURRENT_LIST_DIR} $<TARGET_PROPERTY:log4cxx,INCLUDE_DIRECTORIES>)
+add_subdirectory(util)
+target_sources(testingUtilities PRIVATE xml/xlevel.cpp)
+
+# Tests defined in this directory
+set(ALL_LOG4CXX_TESTS 
+    asyncappendertestcase
+    consoleappendertestcase
+    decodingtest
+    encodingtest
+    fileappendertest
+    filetestcase
+    hierarchytest
+    hierarchythresholdtestcase
+    l7dtestcase
+    leveltestcase
+    loggertestcase
+    mdctestcase
+    minimumtestcase
+    ndctestcase
+    patternlayouttest
+    propertyconfiguratortest
+    rollingfileappendertestcase
+    streamtestcase
+)
+foreach(fileName IN LISTS ALL_LOG4CXX_TESTS)
+    add_executable(${fileName} "${fileName}.cpp")
+endforeach()
+target_sources(rollingfileappendertestcase PRIVATE fileappendertestcase.cpp)
+
+# Tests defined in subdirectories
+add_subdirectory(helpers)
+add_subdirectory(customlogger)
+if(LOG4CXX_HAS_ODBC OR WIN32)
+    add_subdirectory(db)
+endif()
+add_subdirectory(defaultinit)
+add_subdirectory(filter)
+add_subdirectory(net)
+if(WIN32)
+    add_subdirectory(nt)
+endif()
+add_subdirectory(pattern)
+add_subdirectory(rolling)
+add_subdirectory(spi)
+add_subdirectory(varia)
+add_subdirectory(xml)
+
+foreach(testName IN LISTS ALL_LOG4CXX_TESTS)
+    target_include_directories(${testName} PRIVATE ${CMAKE_CURRENT_LIST_DIR} $<TARGET_PROPERTY:log4cxx,INCLUDE_DIRECTORIES>)
+    target_link_libraries(${testName} PRIVATE testingFramework testingUtilities log4cxx ${APR_LIBRARIES})
+    add_test(NAME ${testName}
+        COMMAND ${testName} -v
+        WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/../resources
+    )
+    if(WIN32)
+      set_tests_properties(${testName} PROPERTIES ENVIRONMENT
+        "PATH=$<SHELL_PATH:$<TARGET_FILE_DIR:log4cxx>>$<SEMICOLON>$ENV{PATH}"
+    )
+    endif()
+endforeach()
diff --git a/src/test/cpp/customlogger/CMakeLists.txt b/src/test/cpp/customlogger/CMakeLists.txt
new file mode 100644
index 0000000..76f02d6
--- /dev/null
+++ b/src/test/cpp/customlogger/CMakeLists.txt
@@ -0,0 +1,2 @@
+add_executable(xloggertestcase xloggertestcase.cpp xlogger.cpp)
+set(ALL_LOG4CXX_TESTS ${ALL_LOG4CXX_TESTS} xloggertestcase PARENT_SCOPE)
diff --git a/src/test/cpp/db/CMakeLists.txt b/src/test/cpp/db/CMakeLists.txt
new file mode 100644
index 0000000..3f34418
--- /dev/null
+++ b/src/test/cpp/db/CMakeLists.txt
@@ -0,0 +1,3 @@
+add_executable(odbcappendertestcase odbcappendertestcase.cpp)
+target_include_directories(odbcappendertestcase PRIVATE ${CMAKE_CURRENT_LIST_DIR} $<TARGET_PROPERTY:log4cxx,INCLUDE_DIRECTORIES>)
+target_link_libraries(odbcappendertestcase log4cxx testingFramework testingUtilities ${APR_LIBRARIES})
diff --git a/src/test/cpp/defaultinit/CMakeLists.txt b/src/test/cpp/defaultinit/CMakeLists.txt
new file mode 100644
index 0000000..a9d2ee8
--- /dev/null
+++ b/src/test/cpp/defaultinit/CMakeLists.txt
@@ -0,0 +1,2 @@
+add_executable(defaultinittestcase testcase1.cpp testcase2.cpp testcase3.cpp testcase4.cpp)
+set(ALL_LOG4CXX_TESTS ${ALL_LOG4CXX_TESTS} defaultinittestcase PARENT_SCOPE)
diff --git a/src/test/cpp/filter/CMakeLists.txt b/src/test/cpp/filter/CMakeLists.txt
new file mode 100644
index 0000000..83dc498
--- /dev/null
+++ b/src/test/cpp/filter/CMakeLists.txt
@@ -0,0 +1,9 @@
+add_executable(filtertests
+    andfiltertest.cpp
+    denyallfiltertest.cpp
+    levelmatchfiltertest.cpp
+    levelrangefiltertest.cpp
+    loggermatchfiltertest.cpp
+    stringmatchfiltertest.cpp
+)
+set(ALL_LOG4CXX_TESTS ${ALL_LOG4CXX_TESTS} filtertests PARENT_SCOPE)
diff --git a/src/test/cpp/helpers/CMakeLists.txt b/src/test/cpp/helpers/CMakeLists.txt
new file mode 100644
index 0000000..bb27546
--- /dev/null
+++ b/src/test/cpp/helpers/CMakeLists.txt
@@ -0,0 +1,28 @@
+set(HELPER_TESTS 
+    absolutetimedateformattestcase
+    cacheddateformattestcase
+    charsetdecodertestcase
+    charsetencodertestcase
+    cyclicbuffertestcase
+    datetimedateformattestcase
+    filewatchdogtest
+    inetaddresstestcase
+    iso8601dateformattestcase
+    messagebuffertest
+    optionconvertertestcase
+    propertiestestcase
+    relativetimedateformattestcase
+    stringhelpertestcase
+    stringtokenizertestcase
+    syslogwritertest
+    threadtestcase
+    timezonetestcase
+    transcodertestcase
+)
+foreach(fileName IN LISTS HELPER_TESTS)
+    add_executable(${fileName} "${fileName}.cpp")
+    target_include_directories(${fileName} PRIVATE ${CMAKE_CURRENT_LIST_DIR} $<TARGET_PROPERTY:log4cxx,INCLUDE_DIRECTORIES> ${APR_INCLUDE_DIR})
+endforeach()
+target_sources(cacheddateformattestcase PRIVATE localechanger.cpp)
+target_sources(datetimedateformattestcase PRIVATE  localechanger.cpp)
+set(ALL_LOG4CXX_TESTS ${ALL_LOG4CXX_TESTS} ${HELPER_TESTS} PARENT_SCOPE)
diff --git a/src/test/cpp/net/CMakeLists.txt b/src/test/cpp/net/CMakeLists.txt
new file mode 100644
index 0000000..6bc5847
--- /dev/null
+++ b/src/test/cpp/net/CMakeLists.txt
@@ -0,0 +1,15 @@
+
+# Tests defined in this directory
+set(NET_TESTS 
+    smtpappendertestcase
+    socketappendertestcase
+    sockethubappendertestcase
+    socketservertestcase
+    syslogappendertestcase
+    telnetappendertestcase
+    xmlsocketappendertestcase
+)
+foreach(fileName IN LISTS NET_TESTS)
+    add_executable(${fileName} "${fileName}.cpp")
+endforeach()
+set(ALL_LOG4CXX_TESTS ${ALL_LOG4CXX_TESTS} ${NET_TESTS} PARENT_SCOPE)
diff --git a/src/test/cpp/nt/CMakeLists.txt b/src/test/cpp/nt/CMakeLists.txt
new file mode 100644
index 0000000..0b8a825
--- /dev/null
+++ b/src/test/cpp/nt/CMakeLists.txt
@@ -0,0 +1,2 @@
+add_executable(eventlogtests nteventlogappendertestcase.cpp)
+set(ALL_LOG4CXX_TESTS ${ALL_LOG4CXX_TESTS} eventlogtests PARENT_SCOPE)
diff --git a/src/test/cpp/pattern/CMakeLists.txt b/src/test/cpp/pattern/CMakeLists.txt
new file mode 100644
index 0000000..cd00697
--- /dev/null
+++ b/src/test/cpp/pattern/CMakeLists.txt
@@ -0,0 +1,2 @@
+add_executable(patternparsertestcase patternparsertestcase.cpp num343patternconverter.cpp)
+set(ALL_LOG4CXX_TESTS ${ALL_LOG4CXX_TESTS} patternparsertestcase PARENT_SCOPE)
diff --git a/src/test/cpp/rolling/CMakeLists.txt b/src/test/cpp/rolling/CMakeLists.txt
new file mode 100644
index 0000000..2b2c650
--- /dev/null
+++ b/src/test/cpp/rolling/CMakeLists.txt
@@ -0,0 +1,14 @@
+# Tests defined in this directory
+set(ROLLING_TESTS
+    filenamepatterntestcase
+    filterbasedrollingtest
+    manualrollingtest
+    obsoletedailyrollingfileappendertest
+    obsoleterollingfileappendertest
+    sizebasedrollingtest
+    timebasedrollingtest
+)
+foreach(fileName  IN LISTS ROLLING_TESTS)
+    add_executable(${fileName} "${fileName}.cpp")
+endforeach()
+set(ALL_LOG4CXX_TESTS ${ALL_LOG4CXX_TESTS} ${ROLLING_TESTS} PARENT_SCOPE)
diff --git a/src/test/cpp/spi/CMakeLists.txt b/src/test/cpp/spi/CMakeLists.txt
new file mode 100644
index 0000000..380269f
--- /dev/null
+++ b/src/test/cpp/spi/CMakeLists.txt
@@ -0,0 +1,2 @@
+add_executable(spitestcase loggingeventtest.cpp)
+set(ALL_LOG4CXX_TESTS ${ALL_LOG4CXX_TESTS} spitestcase PARENT_SCOPE)
diff --git a/src/test/cpp/util/CMakeLists.txt b/src/test/cpp/util/CMakeLists.txt
new file mode 100644
index 0000000..dd25dd7
--- /dev/null
+++ b/src/test/cpp/util/CMakeLists.txt
@@ -0,0 +1,21 @@
+# Components required by all tests
+add_library(testingUtilities STATIC
+    serializationtesthelper.cpp
+    absolutedateandtimefilter.cpp
+    absolutetimefilter.cpp
+    binarycompare.cpp
+    compare.cpp
+    controlfilter.cpp
+    filenamefilter.cpp
+    iso8601filter.cpp
+    linenumberfilter.cpp
+    relativetimefilter.cpp
+    threadfilter.cpp
+    transformer.cpp
+    utilfilter.cpp
+    xmlfilenamefilter.cpp
+    xmllineattributefilter.cpp
+    xmlthreadfilter.cpp
+    xmltimestampfilter.cpp
+)
+target_include_directories(testingUtilities PRIVATE ${CMAKE_CURRENT_LIST_DIR} $<TARGET_PROPERTY:log4cxx,INCLUDE_DIRECTORIES>)
diff --git a/src/test/cpp/varia/CMakeLists.txt b/src/test/cpp/varia/CMakeLists.txt
new file mode 100644
index 0000000..aeaeeb4
--- /dev/null
+++ b/src/test/cpp/varia/CMakeLists.txt
@@ -0,0 +1,10 @@
+# Tests defined in this directory
+set(VARIA_TESTS
+    errorhandlertestcase
+    levelmatchfiltertestcase
+    levelrangefiltertestcase
+)
+foreach(fileName  IN LISTS VARIA_TESTS)
+    add_executable(${fileName} "${fileName}.cpp")
+endforeach()
+set(ALL_LOG4CXX_TESTS ${ALL_LOG4CXX_TESTS} ${VARIA_TESTS} PARENT_SCOPE)
diff --git a/src/test/cpp/xml/CMakeLists.txt b/src/test/cpp/xml/CMakeLists.txt
new file mode 100644
index 0000000..cd8bcf5
--- /dev/null
+++ b/src/test/cpp/xml/CMakeLists.txt
@@ -0,0 +1,7 @@
+add_executable(xmltests
+    domtestcase
+    xmllayouttest
+    xmllayouttestcase
+)
+target_link_libraries(xmltests PRIVATE ${APR_UTIL_LIBRARIES})
+set(ALL_LOG4CXX_TESTS ${ALL_LOG4CXX_TESTS} xmltests PARENT_SCOPE)