 +if(UNIX)
 +  ###################
 +  # wxWidgets
++  set(wxWidgets_CONFIG_EXECUTABLE ${externpro}/bin/wx-config)
 +  if(${CMAKE_BUILD_TYPE} MATCHES Debug)
 +    set(wxWidgets_CONFIG_OPTIONS --prefix=${externpro} --version=${wxver} --debug=yes)
 +  else()
 +    set(wxWidgets_CONFIG_OPTIONS --prefix=${externpro} --version=${wxver} --debug=no)
 +  endif()
-+  # NOTE: find_program wasn't always working, so changed to set
-+  set(wxWidgets_CONFIG_EXECUTABLE ${externpro}/bin/wx-config)
 +  find_package(wxWidgets REQUIRED)
 +  include(${wxWidgets_USE_FILE})
-+  #set(wx_DEBUG TRUE)
 +  if(wx_DEBUG)
 +    message(STATUS "wxWidgets_USE_FILE: ${wxWidgets_USE_FILE}")
 +    message(STATUS "wxWidgets_INCLUDE_DIRS: ${wxWidgets_INCLUDE_DIRS}")

+#######################################
+function(set_wxxtarget_properties target)
+  if(MSVC)
+    # toolset
+    if(MSVC_VERSION GREATER 1910 AND MSVC_VERSION LESS 1919) # VS 15.0 2017
+      set(toolset vc141)
+    elseif(MSVC_VERSION EQUAL 1900) # VS 14.0 2015
+      set(toolset vc140)
+    elseif(MSVC_VERSION EQUAL 1800) # VS 12.0 2013
+      set(toolset vc120)
+    elseif(MSVC_VERSION EQUAL 1700) # VS 11.0 2012
+      set(toolset vc110)
+    elseif(MSVC_VERSION EQUAL 1600) # VS 10.0 2010
+      set(toolset vc100)
+    elseif(MSVC_VERSION EQUAL 1500) # VS 9.0 2008
+      set(toolset vc90)
+    else()
+      set(toolset vcXX)
+      message(SEND_ERROR "wxx CMakeLists.txt: MSVC compiler support lacking")
+    endif()
+    if(XP_BUILD_STATIC_RT) # from flags include, xpCommonFlags, xpopts.cmake
+      set(static s)

+      # wxplotctrl plotdraw.cpp needs to include wx/gtk/dcclient.h when building against gtk2
+      include_directories(${WX_SOURCE}/include)
+    endif()
+  endif()
+  string(REPLACE "wx_" "wxx_" wxbasename ${wxbasename})
+elseif(MSVC)
+  set(wxbasename wxxmsw)
+  # find wx headers and custom wx/setup.h
