haskell-cmake-improvements: revert change causing haskell plugins not to be included anymore

--- cmake/Modules/LibAddHaskellPlugin.cmake
+++ cmake/Modules/LibAddHaskellPlugin.cmake
@@ -212,80 +212,6 @@
 									     "${CMAKE_INSTALL_RPATH}"
 									     "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/elektra/haskell")

-									set (
-										SANDBOX_PACKAGEDB
-										"${HASKELL_SHARED_SANDBOX}/${GHC_TARGET_PLATFORM}-ghc-${GHC_VERSION}-packages.conf.d/"
-										)
-									set (PLUGIN_LD_LIBRARY_PATH
-									     "${CMAKE_BINARY_DIR}/lib:${CMAKE_CURRENT_BINARY_DIR}/haskell")
-									set (PLUGIN_ARGS "")
-									if (ARG_TEST_README)
-										list (APPEND PLUGIN_ARGS "TEST_README")
-										list (APPEND PLUGIN_ARGS "TEST_ENVIRONMENT")
-										list (APPEND PLUGIN_ARGS
-											     "SANDBOX_PACKAGEDB=${SANDBOX_PACKAGEDB}")
-										list (APPEND PLUGIN_ARGS
-											     "LD_LIBRARY_PATH=${PLUGIN_LD_LIBRARY_PATH}")
-										if (ARG_TEST_ENVIRONMENT)
-											list (APPEND PLUGIN_ARGS "${ARG_TEST_ENVIRONMENT}")
-										endif (ARG_TEST_ENVIRONMENT)
-
-										if (ARG_TEST_REQUIRED_PLUGINS)
-											list (APPEND PLUGIN_ARGS "TEST_REQUIRED_PLUGINS")
-											list (APPEND PLUGIN_ARGS
-												     "${ARG_TEST_REQUIRED_PLUGINS}")
-										endif (ARG_TEST_REQUIRED_PLUGINS)
-
-									endif (ARG_TEST_README)
-
-									# compile our c wrapper which takes care of invoking the haskell
-									# runtime
-									# the actual haskell plugin gets linked in dynamically as a library
-									add_plugin (${target}
-										    SOURCES ${CMAKE_CURRENT_BINARY_DIR}/haskell.h
-											    ${CMAKE_CURRENT_BINARY_DIR}/haskell.c
-										    INCLUDE_DIRECTORIES ${GHC_INCLUDE_DIRS}
-										    LINK_LIBRARIES ${GHC_LIBS}
-										    LINK_ELEKTRA elektra-pluginprocess
-												 "${PLUGIN_ARGS}"
-										    DEPENDS ${target}
-											    c2hs_haskell)
-
-									if (DEPENDENCY_PHASE AND TARGET elektra-${target})
-										set_target_properties (elektra-${target}
-												       PROPERTIES INSTALL_RPATH
-														  "${HASKELL_RPATH}"
-														  SANDBOX_PACKAGEDB
-														  "${SANDBOX_PACKAGEDB}")
-									endif (DEPENDENCY_PHASE AND TARGET elektra-${target})
-
-									set (PLUGINTEST_ARGS "")
-									if (ARG_INSTALL_TEST_DATA)
-										list (APPEND PLUGINTEST_ARGS "INSTALL_TEST_DATA")
-									endif (ARG_INSTALL_TEST_DATA)
-
-									if (ADDTESTING_PHASE AND TARGET elektra-${target})
-										add_plugintest (${target} MEMLEAK "${PLUGINTEST_ARGS}")
-										get_target_property (HASKELL_RPATH
-												     elektra-${target}
-												     INSTALL_RPATH)
-										get_target_property (SANDBOX_PACKAGEDB
-												     elektra-${target}
-												     SANDBOX_PACKAGEDB)
-
-										# this is required so that it finds the type checker plugin
-										# and all the libraries
-										set_target_properties (testmod_${target}
-												       PROPERTIES INSTALL_RPATH
-														  "${HASKELL_RPATH}")
-										set_property (
-											TEST testmod_${target}
-											PROPERTY
-												ENVIRONMENT
-												"SANDBOX_PACKAGEDB=${SANDBOX_PACKAGEDB};LD_LIBRARY_PATH=${PLUGIN_LD_LIBRARY_PATH}"
-											)
-									endif (ADDTESTING_PHASE AND TARGET elektra-${target})
-
 								else (GHC_PRIM_LIB)
 									remove_plugin (${target} "GHC_PRIM_LIB not found")
 								endif (GHC_PRIM_LIB)
@@ -298,7 +224,6 @@
 					else (GHC_RTS_LIB)
 						remove_plugin (${target} "GHC_RTS_LIB not found")
 					endif (GHC_RTS_LIB)
-
 				else (HAVE_HASKELL_BINDING)
 					remove_plugin (${target} "haskell bindings are not included in the cmake configuration")
 				endif (HAVE_HASKELL_BINDING)
@@ -309,6 +234,61 @@
 			remove_plugin (${target} "${PLUGINPROCESS_NOTFOUND_INFO}, but required for haskell plugins")
 		endif (PLUGINPROCESS_FOUND)
 	endif (DEPENDENCY_PHASE)
+
+	set (SANDBOX_PACKAGEDB "${HASKELL_SHARED_SANDBOX}/${GHC_TARGET_PLATFORM}-ghc-${GHC_VERSION}-packages.conf.d/")
+	set (PLUGIN_LD_LIBRARY_PATH "${CMAKE_BINARY_DIR}/lib:${CMAKE_CURRENT_BINARY_DIR}/haskell")
+	set (PLUGIN_ARGS "")
+	if (ARG_TEST_README)
+		list (APPEND PLUGIN_ARGS "TEST_README")
+		list (APPEND PLUGIN_ARGS "TEST_ENVIRONMENT")
+		list (APPEND PLUGIN_ARGS "SANDBOX_PACKAGEDB=${SANDBOX_PACKAGEDB}")
+		list (APPEND PLUGIN_ARGS "LD_LIBRARY_PATH=${PLUGIN_LD_LIBRARY_PATH}")
+		if (ARG_TEST_ENVIRONMENT)
+			list (APPEND PLUGIN_ARGS "${ARG_TEST_ENVIRONMENT}")
+		endif (ARG_TEST_ENVIRONMENT)
+
+		if (ARG_TEST_REQUIRED_PLUGINS)
+			list (APPEND PLUGIN_ARGS "TEST_REQUIRED_PLUGINS")
+			list (APPEND PLUGIN_ARGS "${ARG_TEST_REQUIRED_PLUGINS}")
+		endif (ARG_TEST_REQUIRED_PLUGINS)
+
+	endif (ARG_TEST_README)
+
+	# compile our c wrapper which takes care of invoking the haskell
+	# runtime
+	# the actual haskell plugin gets linked in dynamically as a library
+	add_plugin (${target}
+		    SOURCES ${CMAKE_CURRENT_BINARY_DIR}/haskell.h
+			    ${CMAKE_CURRENT_BINARY_DIR}/haskell.c
+		    INCLUDE_DIRECTORIES ${GHC_INCLUDE_DIRS}
+		    LINK_LIBRARIES ${GHC_LIBS}
+		    LINK_ELEKTRA elektra-pluginprocess
+				 "${PLUGIN_ARGS}"
+		    DEPENDS ${target}
+			    c2hs_haskell)
+
+	if (DEPENDENCY_PHASE AND TARGET elektra-${target})
+		set_target_properties (
+			elektra-${target} PROPERTIES INSTALL_RPATH "${HASKELL_RPATH}" SANDBOX_PACKAGEDB "${SANDBOX_PACKAGEDB}")
+	endif (DEPENDENCY_PHASE AND TARGET elektra-${target})
+
+	set (PLUGINTEST_ARGS "")
+	if (ARG_INSTALL_TEST_DATA)
+		list (APPEND PLUGINTEST_ARGS "INSTALL_TEST_DATA")
+	endif (ARG_INSTALL_TEST_DATA)
+
+	if (ADDTESTING_PHASE AND TARGET elektra-${target})
+		add_plugintest (${target} MEMLEAK "${PLUGINTEST_ARGS}")
+		get_target_property (HASKELL_RPATH elektra-${target} INSTALL_RPATH)
+		get_target_property (SANDBOX_PACKAGEDB elektra-${target} SANDBOX_PACKAGEDB)
+
+		# this is required so that it finds the type checker plugin
+		# and all the libraries
+		set_target_properties (testmod_${target} PROPERTIES INSTALL_RPATH "${HASKELL_RPATH}")
+		set_property (TEST testmod_${target}
+			      PROPERTY ENVIRONMENT
+				       "SANDBOX_PACKAGEDB=${SANDBOX_PACKAGEDB};LD_LIBRARY_PATH=${PLUGIN_LD_LIBRARY_PATH}")
+	endif (ADDTESTING_PHASE AND TARGET elektra-${target})

 	mark_as_advanced (GHC_FFI_LIB GHC_RTS_LIB GHC_BASE_LIB GHC_GMP_LIB GHC_PRIM_LIB)
 endmacro (add_haskell_plugin)


Qt 5.9 Windows: Link Qt5AccessibilitySupport.lib

--- cmake/Qt5Widgets_HunterPlugin_5_9.cmake
+++ cmake/Qt5Widgets_HunterPlugin_5_9.cmake
@@ -321,6 +321,13 @@
       "${_qt_install_prefix}/lib/Qt5ThemeSupport.lib"
       "${_qt_install_prefix}/lib/Qt5ThemeSupportd.lib"
   )
+
+  # defined: QAccessibleBridgeUtils::effectiveActionNames
+  _qt_cmake_extra_helpers_add_interface_release_debug(
+      Qt5::Widgets
+      "${_qt_install_prefix}/lib/Qt5AccessibilitySupport.lib"
+      "${_qt_install_prefix}/lib/Qt5AccessibilitySupportd.lib"
+  )
 elseif(MINGW)
   _qt_cmake_extra_helpers_add_source(
       Qt5::Widgets


fix(flexisip.spec): explicit exported files, do not export all libdir with wildcard

--- build/rpm/flexisip.spec.cmake
+++ build/rpm/flexisip.spec.cmake
@@ -125,8 +125,8 @@
 install -p -m 0644 scripts/flexisip.service $RPM_BUILD_ROOT/lib/systemd/system
 install -p -m 0644 scripts/flexisip\@.service $RPM_BUILD_ROOT/lib/systemd/system
 %if @ENABLE_PRESENCE@
-  install -p -m 0644 scripts/flexisip-presence.service $RPM_BUILD_ROOT/lib/systemd/system
-  install -p -m 0644 scripts/flexisip-presence\@.service $RPM_BUILD_ROOT/lib/systemd/system
+install -p -m 0644 scripts/flexisip-presence.service $RPM_BUILD_ROOT/lib/systemd/system
+install -p -m 0644 scripts/flexisip-presence\@.service $RPM_BUILD_ROOT/lib/systemd/system
 %endif
 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d
 install -p -m 0644 scripts/flexisip-logrotate $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d
@@ -176,7 +176,9 @@
 %docdir %{_docdir}
 %{_docdir}
 %{_bindir}/*
-%{_libdir}/*
+%{_libdir}/*.so
+%{_libdir}/*.so.*
+%{_libdir}/pkgconfig/*.pc

 %if @ENABLE_PRESENCE@
 %{_sysconfdir}/init.d/flexisip-presence


Manually add "-liomp5" when using OpenMP with icc, fixes #115

--- components/ospcommon/cmake/macros.cmake
+++ components/ospcommon/cmake/macros.cmake
@@ -357,15 +357,7 @@
     SET(CILK_STRING "Cilk")
   ENDIF()

-  # NOTE(jda) - Always default to TBB, at least until Cilk is *exactly* the same
-  #             as TBB...
-  #IF(${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel")
-  #  SET(TASKING_DEFAULT ${CILK_STRING})
-  #ELSE()
-    SET(TASKING_DEFAULT TBB)
-  #ENDIF()
-
-  SET(OSPRAY_TASKING_SYSTEM ${TASKING_DEFAULT} CACHE STRING
+  SET(OSPRAY_TASKING_SYSTEM TBB CACHE STRING
       "Per-node thread tasking system [TBB,OpenMP,Cilk,LibDispatch,Internal,Debug]")

   SET_PROPERTY(CACHE OSPRAY_TASKING_SYSTEM PROPERTY
@@ -414,8 +406,9 @@
       IF (OPENMP_FOUND)
         SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
         SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
-        SET(CMAKE_EXE_LINKER_FLAGS
-            "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
+        IF(OSPRAY_COMPILER_ICC) # workaround linker issue #115
+          SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -liomp5")
+        ENDIF()
         ADD_DEFINITIONS(-DOSPRAY_TASKING_OMP)
       ENDIF()
     ELSEIF(OSPRAY_TASKING_CILK)


Try cmake command to create symbolic link with DEPENDS modifier.

--- itk/CMake/itkExternal_FFTW.cmake
+++ itk/CMake/itkExternal_FFTW.cmake
@@ -106,7 +106,13 @@
       if(CMAKE_SIZEOF_VOID_P MATCHES 8)
       add_custom_command(TARGET fftwd
         POST_BUILD
-          COMMAND [ -d ${ITK_BINARY_DIR}/fftw/lib64 ] && ln -sf ${ITK_BINARY_DIR}/fftw/lib64 ${ITK_BINARY_DIR}/fftw/lib)
+          COMMAND ${CMAKE_COMMAND} ARGS -E create_symlink ${ITK_BINARY_DIR}/fftw/lib64 ${ITK_BINARY_DIR}/fftw/lib
+          DEPENDS ${ITK_BINARY_DIR}/fftw/lib64
+      )
+      #add_custom_command(TARGET fftwd
+      #  POST_BUILD
+      #    COMMAND [ -d ${ITK_BINARY_DIR}/fftw/lib64 ] || ${CMAKE_COMMAND} ARGS -E create_symlink ${ITK_BINARY_DIR}/fftw/lib64 ${ITK_BINARY_DIR}/fftw/lib
+      #)
       endif()
     endif()
     #


appveyor: build bindings using latest python3

--- ci-build.cmake
+++ ci-build.cmake
@@ -54,6 +54,8 @@
         -DCMAKE_GENERATOR_PLATFORM=x64
         -DOGRE_BUILD_DEPENDENCIES=TRUE
         -DOGRE_BUILD_COMPONENT_CSHARP=FALSE
+        "-DPYTHON_EXECUTABLE=C:\\Python37-x64\\python.exe"
+        "-DPYTHON_LIBRARY=C:\\Python37-x64\\libs\\python37.lib"
         -DOGRE_DEPENDENCIES_DIR=${CMAKE_CURRENT_SOURCE_DIR}/ogredeps)

     set(BUILD_DEPS TRUE)


Add flow to sugar.cmake

Add flow to sugar.cmake

--- ogles_gpgpu/common/proc/sugar.cmake
+++ ogles_gpgpu/common/proc/sugar.cmake
@@ -24,12 +24,16 @@
     fifo.h
     filter3x3.cpp
     filter3x3.h
+    flow.cpp
+    flow.h
     gauss.h
     gauss_opt.h
     grad.cpp
     grad.h
     grayscale.cpp
     grayscale.h
+    ixyt.cpp
+    ixyt.h
     lnorm.h
     lbp.cpp
     lbp.h


Nonlocalmeans test as module test.

Nonlocalmeans test as module test.

--- Modules/DiffusionImaging/DiffusionCore/Testing/files.cmake
+++ Modules/DiffusionImaging/DiffusionCore/Testing/files.cmake
@@ -1,12 +1,12 @@
 set(MODULE_TESTS
   mitkFactoryRegistrationTest.cpp
   mitkDiffusionImageEqualTest.cpp
+  mitkNonLocalMeansDenoisingTest.cpp
 )

 set(MODULE_CUSTOM_TESTS
   mitkPyramidImageRegistrationMethodTest.cpp
   mitkDWHeadMotionCorrectionTest.cpp
   mitkImageReconstructionTest.cpp
-  mitkNonLocalMeansDenoisingTest.cpp
 )


[INTERNAL] Will remove legacy build system in 1.4.1, not 1.4.

git-svn-id: a7f2a8f7432d210e972fb03898013d213e2b549b@13997 e6417c60-b987-48fd-844e-b20f0fcc1017

--- util/cmake/SeqAnLegacyBuildSystem.cmake
+++ util/cmake/SeqAnLegacyBuildSystem.cmake
@@ -331,7 +331,7 @@
   message ("    For now, we still support the old build system such that you can")
   message ("    migrate to the new system on a slower upgrade path.  However, please")
   message ("    do so in the near future since support for the new build system will")
-  message ("    stop before the next (1.4) release in early 2013.")
+  message ("    stop before the next (1.4.1) release in spring/summer 2013.")
   message ("")
   message ("  ***************************************************************************")
   message ("  * /!\\ NOTICE: YOU HAVE USED THE THE OLD SEQAN BUILD SYSTEMS FUNCTIONS /!\\*")


Revert change in 5471: it broke all dashboards as CTestConfig.cmake was no longer found.

--- src/Testing/Dashboard/elxDashboardCommon.cmake
+++ src/Testing/Dashboard/elxDashboardCommon.cmake
@@ -64,8 +64,7 @@

 # Select a source directory name.
 if( NOT DEFINED CTEST_SOURCE_DIRECTORY )
-  set( CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}" )
-  #set( CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/src" )
+  set( CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/src" )
 endif()

 # Select a build directory name.


Upgrade downloaded eigen version to latest bugfix release

--- modules/LookUpEigen3.cmake
+++ modules/LookUpEigen3.cmake
@@ -12,7 +12,7 @@
   # with SSL
   set(file_found FALSE)
   set(Eigen3_URL "${EXTERNAL_ROOT}/eigen.tgz")
-  set(Eigen3_MD5 8cc513ac6ec687117acadddfcacf551b)
+  set(Eigen3_MD5 6a578dba42d1c578d531ab5b6fa3f741)
   if(EXISTS "${EXTERNAL_ROOT}/eigen.tgz")
       file(MD5 "${EXTERNAL_ROOT}/eigen.tgz" file_md5)
       if(file_md5 EQUAL "${Eigen3_MD5}")
@@ -24,13 +24,13 @@
       find_package(Wget)
       if(WGET_FOUND)
           execute_process(COMMAND ${WGET_EXECUTABLE}
-            http://bitbucket.org/eigen/eigen/get/3.2.5.tar.gz
+            http://bitbucket.org/eigen/eigen/get/3.2.9.tar.gz
             -O ${EXTERNAL_ROOT}/eigen.tgz
           )
       else()
           find_program(CURL_EXECUTABLE curl)
           execute_process(COMMAND ${CURL_EXECUTABLE}
-            -L http://bitbucket.org/eigen/eigen/get/3.2.5.tar.gz
+            -L http://bitbucket.org/eigen/eigen/get/3.2.9.tar.gz
             -o ${EXTERNAL_ROOT}/eigen.tgz
           )
       endif()


#1503 - Changing CMakeExternals\OPENIGTLINK.cmake to fetch latest
development version of the CMIC OpenIGTLink fork

git-svn-id: f70d4c833b20674991d6651a5f592bbdbe6b47b2@9083 30ced1d1-d8fb-0310-b896-84269ee58dd6

--- CMake/CMakeExternals/OPENIGTLINK.cmake
+++ CMake/CMakeExternals/OPENIGTLINK.cmake
@@ -34,7 +34,7 @@

 IF(NOT DEFINED OpenIGTLink_DIR)

-    SET(revision_tag 7812256420)
+    SET(revision_tag development)
     IF(${proj}_REVISION_TAG)
         SET(revision_tag ${${proj}_REVISION_TAG})
     ENDIF()


Enable event tracing for Tizen. (#14137)

--- clrfeatures.cmake
+++ clrfeatures.cmake
@@ -1,5 +1,5 @@
 if(CLR_CMAKE_TARGET_TIZEN_LINUX)
-  set(FEATURE_EVENT_TRACE 0)
+  set(FEATURE_EVENT_TRACE 1)
   set(FEATURE_GDBJIT_LANGID_CS 1)
 endif()


Removed the health check binary from libprocess.

With https://reviews.apache.org/r/49389/ and
https://reviews.apache.org/r/49555/, both command and
docker executors use health checks via the library. Hence
the mesos-health-check binary is not necessary anymore.

Review: https://reviews.apache.org/r/50657/

--- 3rdparty/libprocess/cmake/Process3rdpartyConfigure.cmake
+++ 3rdparty/libprocess/cmake/Process3rdpartyConfigure.cmake
@@ -152,11 +152,6 @@
   MESOS_FETCHER mesos-fetcher
   CACHE STRING "Target for fetcher")

-# Define target for health-check.
-set(
-  MESOS_HEALTH_CHECK mesos-health-check
-  CACHE STRING "Target for healt-check")
-
 # Define target for master.
 set(
   MESOS_MASTER mesos-master


Add CMake option DISABLE_GDAL for linux

Add CMake option DISABLE_GDAL for linux

By default GDAL is enabled.

--- cmake/Linux.cmake
+++ cmake/Linux.cmake
@@ -1,4 +1,12 @@
 message(STATUS "System Name: ${CMAKE_SYSTEM_NAME}")
 message(STATUS "Install Prefix: ${CMAKE_INSTALL_PREFIX}")
+
+option(DISABLE_GDAL "Disable GDAL" OFF)
+
 set(CMAKE_CXX_FLAGS "-DUNIX -D_REENTRANT -DFMI_COMPRESSION -DBOOST -DBOOST_IOSTREAMS_NO_LIB")
+
+if(DISABLE_GDAL)
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDISABLED_GDAL")
+endif()
+
 add_compile_options(-std=c++11 -fPIC -MD -Wall -W -Wno-unused-parameter)


Fix cmake function to resolve libraries correctly

Summary:
Previous behavior may fail to resolve the correct library name. A rework of https://github.com/caffe2/caffe2/pull/1935 as it was messed up in the rebase...
Closes https://github.com/caffe2/caffe2/pull/1950

Reviewed By: bddppq

Differential Revision: D6974530

Pulled By: yinghai

fbshipit-source-id: 924b653e8ac0b68c46341edfd3eb05d9cc0155f2

--- cmake/Utils.cmake
+++ cmake/Utils.cmake
@@ -180,7 +180,7 @@
     set(${output_var} -WHOLEARCHIVE:$<TARGET_FILE:${lib}> PARENT_SCOPE)
   else()
     # Assume everything else is like gcc
-    set(${output_var} -Wl,--whole-archive ${lib} -Wl,--no-whole-archive PARENT_SCOPE)
+    set(${output_var} -Wl,--whole-archive $<TARGET_FILE:${lib}> -Wl,--no-whole-archive PARENT_SCOPE)
   endif()
 endfunction()


Missing space

Missing space

--- cmake/CMakemacosx64.cmake
+++ cmake/CMakemacosx64.cmake
@@ -59,7 +59,7 @@
 set ( CLIBCOPT )
 set ( CLIBFOPT  ${CLIBDEFS})

-set ( CXXWARN  "-Wall -Wconversion-Wno-long-long -W -Weffc++ -Wshadow -Woverloaded-virtual -ansi")
+set ( CXXWARN  "-Wall -Wconversion -Wno-long-long -W -Weffc++ -Wshadow -Woverloaded-virtual -ansi")

 set ( CXXSTF  "-pipe -fbounds-check -fsigned-char -fno-common -fmessage-length=0 -fno-default-inline -fno-inline -I/usr/X11R6/include -I${FINK_ROOT}/include")


Tried to make every version of FindCUDA.cmake happy with FindCUDA_wrap.cmake

--- cmake/FindCUDA_wrap.cmake
+++ cmake/FindCUDA_wrap.cmake
@@ -14,7 +14,11 @@
   if (CMAKE_COMPILER_IS_GNUCC)
     set (CUDA_PROPAGATE_HOST_FLAGS OFF)
     if (CMAKE_C_FLAGS)
+      if(CMAKE_VERSION VERSION_LESS "2.8.7")
+        set (CUDA_NVCC_FLAGS --compiler-options "${CMAKE_C_FLAGS}")
+      else ()
         set (CUDA_NVCC_FLAGS "--compiler-options \"${CMAKE_C_FLAGS}\"")
+      endif()
     endif ()
   endif ()


added scalapack-openmpi detection

added scalapack-openmpi detection

--- cmake/FindScalapack.cmake
+++ cmake/FindScalapack.cmake
@@ -89,7 +89,7 @@
   endif()
 else()
   find_library(SCALAPACK_LIBRARIES
-    NAMES scalapack
+    NAMES scalapack scalapack-openmpi
     HINTS $ENV{SCALAPACK_ROOT}/build/lib
     ${CMAKE_SOURCE_DIR}/../scalapack-2.0.2/build/lib
     $ENV{HOME}/scalapack-2.0.2/build/lib
@@ -98,7 +98,8 @@
     ${CMAKE_LIBRARY_PATH}
     /usr/local/scalapack/lib
     /usr/local/lib
-    /usr/lib)
+    /usr/lib
+    /usr/lib/x86_64-linux-gnu)
   unset(WITH_MKL)
   find_package_handle_standard_args(Scalapack
     DEFAULT_MSG SCALAPACK_LIBRARIES)


Added ability to set `USBDevice_HID_CONFIG_DIR` to allow the user to add customized USB HID descriptors that are found in `hsbd_hid.x`

--- cmake/FindUSBDevice.cmake
+++ cmake/FindUSBDevice.cmake
@@ -1,6 +1,11 @@
 IF(NOT STM32Cube_DIR)
     SET(STM32Cube_DIR "/opt/STM32Cube_FW_F1_V1.2.0")
     MESSAGE(STATUS "No STM32Cube_DIR specified, using default: " ${STM32Cube_DIR})
+ENDIF()
+
+IF(NOT USBDevice_FIND_COMPONENTS)
+    SET(USBDevice_FIND_COMPONENTS ${USBDevice_COMPONENTS})
+    MESSAGE(STATUS "No USBDevice components selected, using all: ${USBDevice_FIND_COMPONENTS}")
 ENDIF()

 SET(USBDevice_SRC
@@ -69,12 +74,20 @@
 #    Class/MSC/Src/usbd_msc_storage_template.c
 )

-SET(USBDevice_COMPONENTS_HID_HEADERS
-    Class/HID/Inc/usbd_hid.h
-)
-SET(USBDevice_COMPONENTS_HID_SOURCES
-    Class/HID/Src/usbd_hid.c
-)
+IF(NOT USBDevice_HID_CONFIG_DIR)
+    MESSAGE(STATUS "No user defined HID sources, using library sources")
+    SET(USBDevice_COMPONENTS_HID_HEADERS
+        Class/HID/Inc/usbd_hid.h
+    )
+    SET(USBDevice_COMPONENTS_HID_SOURCES
+        Class/HID/Src/usbd_hid.c
+    )
+ELSE()
+    MESSAGE(STATUS "Using user defined HID sources in ${USBDevice_HID_CONFIG_DIR}")
+    LIST(APPEND USBDevice_SOURCES ${USBDevice_HID_CONFIG_DIR}/usbd_hid.c)
+    LIST(APPEND USBDevice_INCLUDE_DIR ${USBDevice_HID_CONFIG_DIR})
+    LIST(REMOVE_ITEM USBDevice_FIND_COMPONENTS HID)
+ENDIF()

 SET(USBDevice_COMPONENTS_CustomHID_HEADERS
 #    Class/CustomHID/Inc/usbd_customhid_if_template.h
@@ -84,11 +97,6 @@
     Class/CustomHID/Src/usbd_customhid.c
 #    Class/CustomHID/Src/usbd_customhid_if_template.c
 )
-
-IF(NOT USBDevice_FIND_COMPONENTS)
-    SET(USBDevice_FIND_COMPONENTS ${USBDevice_COMPONENTS})
-    MESSAGE(STATUS "No USBDevice components selected, using all: ${USBDevice_FIND_COMPONENTS}")
-ENDIF()

 FOREACH(cmp ${USBDevice_FIND_COMPONENTS})
     LIST(FIND USBDevice_COMPONENTS ${cmp} USBDevice_FOUND_INDEX)


Update FindwxWidgets.

Update FindwxWidgets.

--- cmake/FindwxWidgets.cmake
+++ cmake/FindwxWidgets.cmake
@@ -1,94 +1,119 @@
-# - Find a wxWidgets (a.k.a., wxWindows) installation.
-# This module finds if wxWidgets is installed and selects a default
-# configuration to use. wxWidgets is a modular library. To specify the
-# modules that you will use, you need to name them as components to
-# the package:
-#
-# FIND_PACKAGE(wxWidgets COMPONENTS base core ...)
-#
-# There are two search branches: a windows style and a unix style. For
-# windows, the following variables are searched for and set to
-# defaults in case of multiple choices. Change them if the defaults
-# are not desired (i.e., these are the only variables you should
-# change to select a configuration):
-#
-#  wxWidgets_ROOT_DIR      - Base wxWidgets directory
-#                            (e.g., C:/wxWidgets-2.6.3).
-#  wxWidgets_LIB_DIR       - Path to wxWidgets libraries
-#                            (e.g., C:/wxWidgets-2.6.3/lib/vc_lib).
-#  wxWidgets_CONFIGURATION - Configuration to use
-#                            (e.g., msw, mswd, mswu, mswunivud, etc.)
-#
-# For unix style it uses the wx-config utility. You can select between
-# debug/release, unicode/ansi, universal/non-universal, and
-# static/shared in the QtDialog or ccmake interfaces by turning ON/OFF
-# the following variables:
-#
-#  wxWidgets_USE_DEBUG
-#  wxWidgets_USE_UNICODE
-#  wxWidgets_USE_UNIVERSAL
-#  wxWidgets_USE_STATIC
-#
-# The following are set after the configuration is done for both
-# windows and unix style:
-#
-#  wxWidgets_FOUND            - Set to TRUE if wxWidgets was found.
-#  wxWidgets_INCLUDE_DIRS     - Include directories for WIN32
-#                               i.e., where to find "wx/wx.h" and
-#                               "wx/setup.h"; possibly empty for unices.
-#  wxWidgets_LIBRARIES        - Path to the wxWidgets libraries.
-#  wxWidgets_LIBRARY_DIRS     - compile time link dirs, useful for
-#                               rpath on UNIX. Typically an empty string
-#                               in WIN32 environment.
-#  wxWidgets_DEFINITIONS      - Contains defines required to compile/link
-#                               against WX, e.g. WXUSINGDLL
-#  wxWidgets_DEFINITIONS_DEBUG- Contains defines required to compile/link
-#                               against WX debug builds, e.g. __WXDEBUG__
-#  wxWidgets_CXX_FLAGS        - Include dirs and compiler flags for
-#                               unices, empty on WIN32. Essentially
-#                               "`wx-config --cxxflags`".
-#  wxWidgets_USE_FILE         - Convenience include file.
-#
-# Sample usage:
-#   FIND_PACKAGE(wxWidgets COMPONENTS base core gl net)
-#   IF(wxWidgets_FOUND)
-#     INCLUDE(${wxWidgets_USE_FILE})
-#     # and for each of your dependant executable/library targets:
-#     TARGET_LINK_LIBRARIES(<YourTarget> ${wxWidgets_LIBRARIES})
-#   ENDIF(wxWidgets_FOUND)
-#
-# If wxWidgets is required (i.e., not an optional part):
-#   FIND_PACKAGE(wxWidgets REQUIRED base core gl net)
-#   INCLUDE(${wxWidgets_USE_FILE})
-#   # and for each of your dependant executable/library targets:
-#   TARGET_LINK_LIBRARIES(<YourTarget> ${wxWidgets_LIBRARIES})
-
-# OpenCMISS-Cmgui Application
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-#=============================================================================
-# Copyright 2004-2009 Kitware, Inc.
-# Copyright 2007-2009 Miguel A. Figueroa-Villanueva <miguelf at ieee dot org>
-#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
-#  License text for the above reference.)
+# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+#[=======================================================================[.rst:
+FindwxWidgets
+-------------
+
+Find a wxWidgets (a.k.a., wxWindows) installation.
+
+This module finds if wxWidgets is installed and selects a default
+configuration to use.  wxWidgets is a modular library.  To specify the
+modules that you will use, you need to name them as components to the
+package:
+
+find_package(wxWidgets COMPONENTS core base ... OPTIONAL_COMPONENTS net ...)
+
+There are two search branches: a windows style and a unix style.  For
+windows, the following variables are searched for and set to defaults
+in case of multiple choices.  Change them if the defaults are not
+desired (i.e., these are the only variables you should change to
+select a configuration):
+
+::
+
+  wxWidgets_ROOT_DIR      - Base wxWidgets directory
+                            (e.g., C:/wxWidgets-2.6.3).
+  wxWidgets_LIB_DIR       - Path to wxWidgets libraries
+                            (e.g., C:/wxWidgets-2.6.3/lib/vc_lib).
+  wxWidgets_CONFIGURATION - Configuration to use
+                            (e.g., msw, mswd, mswu, mswunivud, etc.)
+  wxWidgets_EXCLUDE_COMMON_LIBRARIES
+                          - Set to TRUE to exclude linking of
+                            commonly required libs (e.g., png tiff
+                            jpeg zlib regex expat).
+
+
+
+For unix style it uses the wx-config utility.  You can select between
+debug/release, unicode/ansi, universal/non-universal, and
+static/shared in the QtDialog or ccmake interfaces by turning ON/OFF
+the following variables:
+
+::
+
+  wxWidgets_USE_DEBUG
+  wxWidgets_USE_UNICODE
+  wxWidgets_USE_UNIVERSAL
+  wxWidgets_USE_STATIC
+
+
+
+There is also a wxWidgets_CONFIG_OPTIONS variable for all other
+options that need to be passed to the wx-config utility.  For example,
+to use the base toolkit found in the /usr/local path, set the variable
+(before calling the FIND_PACKAGE command) as such:
+
+::
+
+  set(wxWidgets_CONFIG_OPTIONS --toolkit=base --prefix=/usr)
+
+
+
+The following are set after the configuration is done for both windows
+and unix style:
+
+::
+
+  wxWidgets_FOUND            - Set to TRUE if wxWidgets was found.
+  wxWidgets_INCLUDE_DIRS     - Include directories for WIN32
+                               i.e., where to find "wx/wx.h" and
+                               "wx/setup.h"; possibly empty for unices.
+  wxWidgets_LIBRARIES        - Path to the wxWidgets libraries.
+  wxWidgets_LIBRARY_DIRS     - compile time link dirs, useful for
+                               rpath on UNIX. Typically an empty string
+                               in WIN32 environment.
+  wxWidgets_DEFINITIONS      - Contains defines required to compile/link
+                               against WX, e.g. WXUSINGDLL
+  wxWidgets_DEFINITIONS_DEBUG- Contains defines required to compile/link
+                               against WX debug builds, e.g. __WXDEBUG__
+  wxWidgets_CXX_FLAGS        - Include dirs and compiler flags for
+                               unices, empty on WIN32. Essentially
+                               "`wx-config --cxxflags`".
+  wxWidgets_USE_FILE         - Convenience include file.
+
+
+
+Sample usage:
+
+::
+
+   # Note that for MinGW users the order of libs is important!
+   find_package(wxWidgets COMPONENTS gl core base OPTIONAL_COMPONENTS net)
+   if(wxWidgets_FOUND)
+     include(${wxWidgets_USE_FILE})
+     # and for each of your dependent executable/library targets:
+     target_link_libraries(<YourTarget> ${wxWidgets_LIBRARIES})
+   endif()
+
+
+
+If wxWidgets is required (i.e., not an optional part):
+
+::
+
+   find_package(wxWidgets REQUIRED gl core base OPTIONAL_COMPONENTS net)
+   include(${wxWidgets_USE_FILE})
+   # and for each of your dependent executable/library targets:
+   target_link_libraries(<YourTarget> ${wxWidgets_LIBRARIES})
+#]=======================================================================]

 #
 # FIXME: check this and provide a correct sample usage...
 #        Remember to connect back to the upper text.
 # Sample usage with monolithic wx build:
 #
-#   FIND_PACKAGE(wxWidgets COMPONENTS mono)
+#   find_package(wxWidgets COMPONENTS mono)
 #   ...

 # NOTES
@@ -134,36 +159,24 @@

 # FIXME: This and all the DBG_MSG calls should be removed after the
 # module stabilizes.
-#
+#
 # Helper macro to control the debugging output globally. There are
 # two versions for controlling how verbose your output should be.
-MACRO(DBG_MSG _MSG)
-#  MESSAGE(STATUS
+macro(DBG_MSG _MSG)
+  message(STATUS
+    "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${_MSG}")
+endmacro()
+macro(DBG_MSG_V _MSG)
+#  message(STATUS
 #    "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${_MSG}")
-ENDMACRO(DBG_MSG)
-MACRO(DBG_MSG_V _MSG)
-#  MESSAGE(STATUS
-#    "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${_MSG}")
-ENDMACRO(DBG_MSG_V)
+endmacro()

 # Clear return values in case the module is loaded more than once.
-# SET(wxWidgets_FOUND FALSE)
-# SET(wxWidgets_INCLUDE_DIRS "")
-# SET(wxWidgets_LIBRARIES    "")
-# SET(wxWidgets_LIBRARY_DIRS "")
-# SET(wxWidgets_CXX_FLAGS    "")
-
-# Using SYSTEM with INCLUDE_DIRECTORIES in conjunction with wxWidgets on
-# the Mac produces compiler errors. Set wxWidgets_INCLUDE_DIRS_NO_SYSTEM
-# to prevent UsewxWidgets.cmake from using SYSTEM.
-#
-# See cmake mailing list discussions for more info:
-#   http://www.cmake.org/pipermail/cmake/2008-April/021115.html
-#   http://www.cmake.org/pipermail/cmake/2008-April/021146.html
-#
-IF(APPLE)
-	SET(wxWidgets_INCLUDE_DIRS_NO_SYSTEM 1)
-ENDIF(APPLE)
+set(wxWidgets_FOUND FALSE)
+set(wxWidgets_INCLUDE_DIRS "")
+set(wxWidgets_LIBRARIES    "")
+set(wxWidgets_LIBRARY_DIRS "")
+set(wxWidgets_CXX_FLAGS    "")

 # DEPRECATED: This is a patch to support the DEPRECATED use of
 # wxWidgets_USE_LIBS.
@@ -171,9 +184,9 @@
 # If wxWidgets_USE_LIBS is set:
 # - if using <components>, then override wxWidgets_USE_LIBS
 # - else set wxWidgets_FIND_COMPONENTS to wxWidgets_USE_LIBS
-IF(wxWidgets_USE_LIBS AND NOT wxWidgets_FIND_COMPONENTS)
-	SET(wxWidgets_FIND_COMPONENTS ${wxWidgets_USE_LIBS})
-ENDIF(wxWidgets_USE_LIBS AND NOT wxWidgets_FIND_COMPONENTS)
+if(wxWidgets_USE_LIBS AND NOT wxWidgets_FIND_COMPONENTS)
+  set(wxWidgets_FIND_COMPONENTS ${wxWidgets_USE_LIBS})
+endif()
 DBG_MSG("wxWidgets_FIND_COMPONENTS : ${wxWidgets_FIND_COMPONENTS}")

 # Add the convenience use file if available.
@@ -181,232 +194,781 @@
 # Get dir of this file which may reside in:
 # - CMAKE_MAKE_ROOT/Modules on CMake installation
 # - CMAKE_MODULE_PATH if user prefers his own specialized version
-SET(wxWidgets_USE_FILE "")
-GET_FILENAME_COMPONENT(
-	wxWidgets_CURRENT_LIST_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
+set(wxWidgets_USE_FILE "")
+get_filename_component(
+  wxWidgets_CURRENT_LIST_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
 # Prefer an existing customized version, but the user might override
 # the FindwxWidgets module and not the UsewxWidgets one.
-IF(EXISTS "${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake")
-	SET(wxWidgets_USE_FILE
-	"${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake")
-ELSE(EXISTS "${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake")
-	SET(wxWidgets_USE_FILE UsewxWidgets.cmake)
-ENDIF(EXISTS "${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake")
+if(EXISTS "${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake")
+  set(wxWidgets_USE_FILE
+    "${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake")
+else()
+  set(wxWidgets_USE_FILE UsewxWidgets)
+endif()

 #=====================================================================
+# Determine whether unix or win32 paths should be used
 #=====================================================================
-IF(WIN32 AND NOT CYGWIN AND NOT MSYS)
-	SET(wxWidgets_FIND_STYLE "win32")
-ELSE(WIN32 AND NOT CYGWIN AND NOT MSYS)
-	IF(UNIX OR MSYS)
-		SET(wxWidgets_FIND_STYLE "unix")
-	ENDIF(UNIX OR MSYS)
-ENDIF(WIN32 AND NOT CYGWIN AND NOT MSYS)
+if(WIN32 AND NOT CYGWIN AND NOT MSYS AND NOT CMAKE_CROSSCOMPILING)
+  set(wxWidgets_FIND_STYLE "win32")
+else()
+  set(wxWidgets_FIND_STYLE "unix")
+endif()

 #=====================================================================
 # WIN32_FIND_STYLE
 #=====================================================================
-IF(wxWidgets_FIND_STYLE STREQUAL "win32")
-	SET( wxWidgets_DIR "" CACHE PATH "Where is wxWidgets installed?" )
-	INCLUDE( ${wxWidgets_DIR}/wxWidgets-config.cmake )
+if(wxWidgets_FIND_STYLE STREQUAL "win32")
+  # Useful common wx libs needed by almost all components.
+  set(wxWidgets_COMMON_LIBRARIES png tiff jpeg zlib regex expat)
+
+  # DEPRECATED: Use find_package(wxWidgets COMPONENTS mono) instead.
+  if(NOT wxWidgets_FIND_COMPONENTS)
+    if(wxWidgets_USE_MONOLITHIC)
+      set(wxWidgets_FIND_COMPONENTS mono)
+    else()
+      set(wxWidgets_FIND_COMPONENTS core base) # this is default
+    endif()
+  endif()
+
+  # Add the common (usually required libs) unless
+  # wxWidgets_EXCLUDE_COMMON_LIBRARIES has been set.
+  if(NOT wxWidgets_EXCLUDE_COMMON_LIBRARIES)
+    list(APPEND wxWidgets_FIND_COMPONENTS
+      ${wxWidgets_COMMON_LIBRARIES})
+  endif()
+
+  #-------------------------------------------------------------------
+  # WIN32: Helper MACROS
+  #-------------------------------------------------------------------
+  #
+  # Get filename components for a configuration. For example,
+  #   if _CONFIGURATION = mswunivud, then _UNV=univ, _UCD=u _DBG=d
+  #   if _CONFIGURATION = mswu,      then _UNV="",   _UCD=u _DBG=""
+  #
+  macro(WX_GET_NAME_COMPONENTS _CONFIGURATION _UNV _UCD _DBG)
+    string(REGEX MATCH "univ" ${_UNV} "${_CONFIGURATION}")
+    string(REGEX REPLACE "msw.*(u)[d]*$" "u" ${_UCD} "${_CONFIGURATION}")
+    if(${_UCD} STREQUAL ${_CONFIGURATION})
+      set(${_UCD} "")
+    endif()
+    string(REGEX MATCH "d$" ${_DBG} "${_CONFIGURATION}")
+  endmacro()
+
+  #
+  # Find libraries associated to a configuration.
+  #
+  macro(WX_FIND_LIBS _UNV _UCD _DBG)
+    DBG_MSG_V("m_unv = ${_UNV}")
+    DBG_MSG_V("m_ucd = ${_UCD}")
+    DBG_MSG_V("m_dbg = ${_DBG}")
+
+    # FIXME: What if both regex libs are available. regex should be
+    # found outside the loop and only wx${LIB}${_UCD}${_DBG}.
+    # Find wxWidgets common libraries.
+    foreach(LIB ${wxWidgets_COMMON_LIBRARIES} scintilla)
+      find_library(WX_${LIB}${_DBG}
+        NAMES
+        wx${LIB}${_UCD}${_DBG} # for regex
+        wx${LIB}${_DBG}
+        PATHS ${WX_LIB_DIR}
+        NO_DEFAULT_PATH
+        )
+      mark_as_advanced(WX_${LIB}${_DBG})
+    endforeach()
+
+    # Find wxWidgets multilib base libraries.
+    find_library(WX_base${_DBG}
+      NAMES
+      wxbase31${_UCD}${_DBG}
+      wxbase30${_UCD}${_DBG}
+      wxbase29${_UCD}${_DBG}
+      wxbase28${_UCD}${_DBG}
+      wxbase27${_UCD}${_DBG}
+      wxbase26${_UCD}${_DBG}
+      wxbase25${_UCD}${_DBG}
+      PATHS ${WX_LIB_DIR}
+      NO_DEFAULT_PATH
+      )
+    mark_as_advanced(WX_base${_DBG})
+    foreach(LIB net odbc xml)
+      find_library(WX_${LIB}${_DBG}
+        NAMES
+        wxbase31${_UCD}${_DBG}_${LIB}
+        wxbase30${_UCD}${_DBG}_${LIB}
+        wxbase29${_UCD}${_DBG}_${LIB}
+        wxbase28${_UCD}${_DBG}_${LIB}
+        wxbase27${_UCD}${_DBG}_${LIB}
+        wxbase26${_UCD}${_DBG}_${LIB}
+        wxbase25${_UCD}${_DBG}_${LIB}
+        PATHS ${WX_LIB_DIR}
+        NO_DEFAULT_PATH
+        )
+      mark_as_advanced(WX_${LIB}${_DBG})
+    endforeach()
+
+    # Find wxWidgets monolithic library.
+    find_library(WX_mono${_DBG}
+      NAMES
+      wxmsw${_UNV}31${_UCD}${_DBG}
+      wxmsw${_UNV}30${_UCD}${_DBG}
+      wxmsw${_UNV}29${_UCD}${_DBG}
+      wxmsw${_UNV}28${_UCD}${_DBG}
+      wxmsw${_UNV}27${_UCD}${_DBG}
+      wxmsw${_UNV}26${_UCD}${_DBG}
+      wxmsw${_UNV}25${_UCD}${_DBG}
+      PATHS ${WX_LIB_DIR}
+      NO_DEFAULT_PATH
+      )
+    mark_as_advanced(WX_mono${_DBG})
+
+    # Find wxWidgets multilib libraries.
+    foreach(LIB core adv aui html media xrc dbgrid gl qa richtext
+                stc ribbon propgrid webview)
+      find_library(WX_${LIB}${_DBG}
+        NAMES
+        wxmsw${_UNV}31${_UCD}${_DBG}_${LIB}
+        wxmsw${_UNV}30${_UCD}${_DBG}_${LIB}
+        wxmsw${_UNV}29${_UCD}${_DBG}_${LIB}
+        wxmsw${_UNV}28${_UCD}${_DBG}_${LIB}
+        wxmsw${_UNV}27${_UCD}${_DBG}_${LIB}
+        wxmsw${_UNV}26${_UCD}${_DBG}_${LIB}
+        wxmsw${_UNV}25${_UCD}${_DBG}_${LIB}
+        PATHS ${WX_LIB_DIR}
+        NO_DEFAULT_PATH
+        )
+      mark_as_advanced(WX_${LIB}${_DBG})
+    endforeach()
+  endmacro()
+
+  #
+  # Clear all library paths, so that FIND_LIBRARY refinds them.
+  #
+  # Clear a lib, reset its found flag, and mark as advanced.
+  macro(WX_CLEAR_LIB _LIB)
+    set(${_LIB} "${_LIB}-NOTFOUND" CACHE FILEPATH "Cleared." FORCE)
+    set(${_LIB}_FOUND FALSE)
+    mark_as_advanced(${_LIB})
+  endmacro()
+  # Clear all debug or release library paths (arguments are "d" or "").
+  macro(WX_CLEAR_ALL_LIBS _DBG)
+    # Clear wxWidgets common libraries.
+    foreach(LIB ${wxWidgets_COMMON_LIBRARIES} scintilla)
+      WX_CLEAR_LIB(WX_${LIB}${_DBG})
+    endforeach()
+
+    # Clear wxWidgets multilib base libraries.
+    WX_CLEAR_LIB(WX_base${_DBG})
+    foreach(LIB net odbc xml)
+      WX_CLEAR_LIB(WX_${LIB}${_DBG})
+    endforeach()
+
+    # Clear wxWidgets monolithic library.
+    WX_CLEAR_LIB(WX_mono${_DBG})
+
+    # Clear wxWidgets multilib libraries.
+    foreach(LIB core adv aui html media xrc dbgrid gl qa richtext
+                webview stc ribbon propgrid)
+      WX_CLEAR_LIB(WX_${LIB}${_DBG})
+    endforeach()
+  endmacro()
+  # Clear all wxWidgets debug libraries.
+  macro(WX_CLEAR_ALL_DBG_LIBS)
+    WX_CLEAR_ALL_LIBS("d")
+  endmacro()
+  # Clear all wxWidgets release libraries.
+  macro(WX_CLEAR_ALL_REL_LIBS)
+    WX_CLEAR_ALL_LIBS("")
+  endmacro()
+
+  #
+  # Set the wxWidgets_LIBRARIES variable.
+  # Also, Sets output variable wxWidgets_FOUND to FALSE if it fails.
+  #
+  macro(WX_SET_LIBRARIES _LIBS _DBG)
+    DBG_MSG_V("Looking for ${${_LIBS}}")
+    if(WX_USE_REL_AND_DBG)
+      foreach(LIB ${${_LIBS}})
+        DBG_MSG_V("Searching for ${LIB} and ${LIB}d")
+        DBG_MSG_V("WX_${LIB}  : ${WX_${LIB}}")
+        DBG_MSG_V("WX_${LIB}d : ${WX_${LIB}d}")
+        if(WX_${LIB} AND WX_${LIB}d)
+          DBG_MSG_V("Found ${LIB} and ${LIB}d")
+          list(APPEND wxWidgets_LIBRARIES
+            debug ${WX_${LIB}d} optimized ${WX_${LIB}}
+            )
+          set(wxWidgets_${LIB}_FOUND TRUE)
+        elseif(NOT wxWidgets_FIND_REQUIRED_${LIB})
+          DBG_MSG_V("- ignored optional missing WX_${LIB}=${WX_${LIB}} or WX_${LIB}d=${WX_${LIB}d}")
+        else()
+          DBG_MSG_V("- not found due to missing WX_${LIB}=${WX_${LIB}} or WX_${LIB}d=${WX_${LIB}d}")
+          set(wxWidgets_FOUND FALSE)
+        endif()
+      endforeach()
+    else()
+      foreach(LIB ${${_LIBS}})
+        DBG_MSG_V("Searching for ${LIB}${_DBG}")
+        DBG_MSG_V("WX_${LIB}${_DBG} : ${WX_${LIB}${_DBG}}")
+        if(WX_${LIB}${_DBG})
+          DBG_MSG_V("Found ${LIB}${_DBG}")
+          list(APPEND wxWidgets_LIBRARIES ${WX_${LIB}${_DBG}})
+          set(wxWidgets_${LIB}_FOUND TRUE)
+        elseif(NOT wxWidgets_FIND_REQUIRED_${LIB})
+          DBG_MSG_V("- ignored optional missing WX_${LIB}${_DBG}=${WX_${LIB}${_DBG}}")
+        else()
+          DBG_MSG_V("- not found due to missing WX_${LIB}${_DBG}=${WX_${LIB}${_DBG}}")
+          set(wxWidgets_FOUND FALSE)
+        endif()
+      endforeach()
+    endif()
+
+    DBG_MSG_V("OpenGL")
+    list(FIND ${_LIBS} gl WX_USE_GL)
+    if(NOT WX_USE_GL EQUAL -1)
+      DBG_MSG_V("- is required.")
+      list(APPEND wxWidgets_LIBRARIES opengl32 glu32)
+    endif()
+
+    list(APPEND wxWidgets_LIBRARIES winmm comctl32 oleacc rpcrt4 shlwapi version wsock32)
+  endmacro()
+
+  #-------------------------------------------------------------------
+  # WIN32: Start actual work.
+  #-------------------------------------------------------------------
+
+  # Look for an installation tree.
+  find_path(wxWidgets_ROOT_DIR
+    NAMES include/wx/wx.h
+    PATHS
+      ENV wxWidgets_ROOT_DIR
+      ENV WXWIN
+      "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\wxWidgets_is1;Inno Setup: App Path]"  # WX 2.6.x
+      C:/
+      D:/
+      ENV ProgramFiles
+    PATH_SUFFIXES
+      wxWidgets-3.1.0
+      wxWidgets-3.0.2
+      wxWidgets-3.0.1
+      wxWidgets-3.0.0
+      wxWidgets-2.9.5
+      wxWidgets-2.9.4
+      wxWidgets-2.9.3
+      wxWidgets-2.9.2
+      wxWidgets-2.9.1
+      wxWidgets-2.9.0
+      wxWidgets-2.8.9
+      wxWidgets-2.8.8
+      wxWidgets-2.8.7
+      wxWidgets-2.8.6
+      wxWidgets-2.8.5
+      wxWidgets-2.8.4
+      wxWidgets-2.8.3
+      wxWidgets-2.8.2
+      wxWidgets-2.8.1
+      wxWidgets-2.8.0
+      wxWidgets-2.7.4
+      wxWidgets-2.7.3
+      wxWidgets-2.7.2
+      wxWidgets-2.7.1
+      wxWidgets-2.7.0
+      wxWidgets-2.7.0-1
+      wxWidgets-2.6.4
+      wxWidgets-2.6.3
+      wxWidgets-2.6.2
+      wxWidgets-2.6.1
+      wxWidgets-2.5.4
+      wxWidgets-2.5.3
+      wxWidgets-2.5.2
+      wxWidgets-2.5.1
+      wxWidgets
+    DOC "wxWidgets base/installation directory"
+    )
+
+  # If wxWidgets_ROOT_DIR changed, clear lib dir.
+  if(NOT WX_ROOT_DIR STREQUAL wxWidgets_ROOT_DIR)
+    set(WX_ROOT_DIR ${wxWidgets_ROOT_DIR}
+        CACHE INTERNAL "wxWidgets_ROOT_DIR")
+    set(wxWidgets_LIB_DIR "wxWidgets_LIB_DIR-NOTFOUND"
+        CACHE PATH "Cleared." FORCE)
+  endif()
+
+  if(WX_ROOT_DIR)
+    # Select one default tree inside the already determined wx tree.
+    # Prefer static/shared order usually consistent with build
+    # settings.
+    set(_WX_TOOL "")
+    set(_WX_TOOLVER "")
+    set(_WX_ARCH "")
+    if(MINGW)
+      set(_WX_TOOL gcc)
+    elseif(MSVC)
+      set(_WX_TOOL vc)
+      set(_WX_TOOLVER ${MSVC_TOOLSET_VERSION})
+      if(CMAKE_SIZEOF_VOID_P EQUAL 8)
+        set(_WX_ARCH _x64)
+      endif()
+    endif()
+    if(BUILD_SHARED_LIBS)
+      find_path(wxWidgets_LIB_DIR
+        NAMES
+          msw/wx/setup.h
+          mswd/wx/setup.h
+          mswu/wx/setup.h
+          mswud/wx/setup.h
+          mswuniv/wx/setup.h
+          mswunivd/wx/setup.h
+          mswunivu/wx/setup.h
+          mswunivud/wx/setup.h
+        PATHS
+        ${WX_ROOT_DIR}/lib/${_WX_TOOL}${_WX_TOOLVER}_xp${_WX_ARCH}_dll   # prefer shared
+        ${WX_ROOT_DIR}/lib/${_WX_TOOL}${_WX_TOOLVER}${_WX_ARCH}_dll   # prefer shared
+        ${WX_ROOT_DIR}/lib/${_WX_TOOL}${_WX_ARCH}_dll                 # prefer shared
+        ${WX_ROOT_DIR}/lib/${_WX_TOOL}${_WX_TOOLVER}_xp${_WX_ARCH}_lib
+        ${WX_ROOT_DIR}/lib/${_WX_TOOL}${_WX_TOOLVER}${_WX_ARCH}_lib
+        ${WX_ROOT_DIR}/lib/${_WX_TOOL}${_WX_ARCH}_lib
+        DOC "Path to wxWidgets libraries"
+        NO_DEFAULT_PATH
+        )
+    else()
+      find_path(wxWidgets_LIB_DIR
+        NAMES
+          msw/wx/setup.h
+          mswd/wx/setup.h
+          mswu/wx/setup.h
+          mswud/wx/setup.h
+          mswuniv/wx/setup.h
+          mswunivd/wx/setup.h
+          mswunivu/wx/setup.h
+          mswunivud/wx/setup.h
+        PATHS
+        ${WX_ROOT_DIR}/lib/${_WX_TOOL}${_WX_TOOLVER}_xp${_WX_ARCH}_lib   # prefer static
+        ${WX_ROOT_DIR}/lib/${_WX_TOOL}${_WX_TOOLVER}${_WX_ARCH}_lib   # prefer static
+        ${WX_ROOT_DIR}/lib/${_WX_TOOL}${_WX_ARCH}_lib                 # prefer static
+        ${WX_ROOT_DIR}/lib/${_WX_TOOL}${_WX_TOOLVER}_xp${_WX_ARCH}_dll
+        ${WX_ROOT_DIR}/lib/${_WX_TOOL}${_WX_TOOLVER}${_WX_ARCH}_dll
+        ${WX_ROOT_DIR}/lib/${_WX_TOOL}${_WX_ARCH}_dll
+        DOC "Path to wxWidgets libraries"
+        NO_DEFAULT_PATH
+        )
+    endif()
+    unset(_WX_TOOL)
+    unset(_WX_TOOLVER)
+    unset(_WX_ARCH)
+
+    # If wxWidgets_LIB_DIR changed, clear all libraries.
+    if(NOT WX_LIB_DIR STREQUAL wxWidgets_LIB_DIR)
+      set(WX_LIB_DIR ${wxWidgets_LIB_DIR} CACHE INTERNAL "wxWidgets_LIB_DIR")
+      WX_CLEAR_ALL_DBG_LIBS()
+      WX_CLEAR_ALL_REL_LIBS()
+    endif()
+
+    if(WX_LIB_DIR)
+      # If building shared libs, define WXUSINGDLL to use dllimport.
+      if(WX_LIB_DIR MATCHES "[dD][lL][lL]")
+        set(wxWidgets_DEFINITIONS WXUSINGDLL)
+        DBG_MSG_V("detected SHARED/DLL tree WX_LIB_DIR=${WX_LIB_DIR}")
+      endif()
+
+      # Search for available configuration types.
+      foreach(CFG mswunivud mswunivd mswud mswd mswunivu mswuniv mswu msw)
+        set(WX_${CFG}_FOUND FALSE)
+        if(EXISTS ${WX_LIB_DIR}/${CFG})
+          list(APPEND WX_CONFIGURATION_LIST ${CFG})
+          set(WX_${CFG}_FOUND TRUE)
+          set(WX_CONFIGURATION ${CFG})
+        endif()
+      endforeach()
+      DBG_MSG_V("WX_CONFIGURATION_LIST=${WX_CONFIGURATION_LIST}")
+
+      if(WX_CONFIGURATION)
+        set(wxWidgets_FOUND TRUE)
+
+        # If the selected configuration wasn't found force the default
+        # one. Otherwise, use it but still force a refresh for
+        # updating the doc string with the current list of available
+        # configurations.
+        if(NOT WX_${wxWidgets_CONFIGURATION}_FOUND)
+          set(wxWidgets_CONFIGURATION ${WX_CONFIGURATION} CACHE STRING
+            "Set wxWidgets configuration (${WX_CONFIGURATION_LIST})" FORCE)
+        else()
+          set(wxWidgets_CONFIGURATION ${wxWidgets_CONFIGURATION} CACHE STRING
+            "Set wxWidgets configuration (${WX_CONFIGURATION_LIST})" FORCE)
+        endif()
+
+        # If release config selected, and both release/debug exist.
+        if(WX_${wxWidgets_CONFIGURATION}d_FOUND)
+          option(wxWidgets_USE_REL_AND_DBG
+            "Use release and debug configurations?" TRUE)
+          set(WX_USE_REL_AND_DBG ${wxWidgets_USE_REL_AND_DBG})
+        else()
+          # If the option exists (already in cache), force it false.
+          if(wxWidgets_USE_REL_AND_DBG)
+            set(wxWidgets_USE_REL_AND_DBG FALSE CACHE BOOL
+              "No ${wxWidgets_CONFIGURATION}d found." FORCE)
+          endif()
+          set(WX_USE_REL_AND_DBG FALSE)
+        endif()
+
+        # Get configuration parameters from the name.
+        WX_GET_NAME_COMPONENTS(${wxWidgets_CONFIGURATION} UNV UCD DBG)
+
+        # Set wxWidgets lib setup include directory.
+        if(EXISTS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h)
+          set(wxWidgets_INCLUDE_DIRS
+            ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION})
+        else()
+          DBG_MSG("wxWidgets_FOUND FALSE because ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h does not exists.")
+          set(wxWidgets_FOUND FALSE)
+        endif()
+
+        # Set wxWidgets main include directory.
+        if(EXISTS ${WX_ROOT_DIR}/include/wx/wx.h)
+          list(APPEND wxWidgets_INCLUDE_DIRS ${WX_ROOT_DIR}/include)
+        else()
+          DBG_MSG("wxWidgets_FOUND FALSE because WX_ROOT_DIR=${WX_ROOT_DIR} has no ${WX_ROOT_DIR}/include/wx/wx.h")
+          set(wxWidgets_FOUND FALSE)
+        endif()
+
+        # Find wxWidgets libraries.
+        WX_FIND_LIBS("${UNV}" "${UCD}" "${DBG}")
+        if(WX_USE_REL_AND_DBG)
+          WX_FIND_LIBS("${UNV}" "${UCD}" "d")
+        endif()
+
+        # Settings for requested libs (i.e., include dir, libraries, etc.).
+        WX_SET_LIBRARIES(wxWidgets_FIND_COMPONENTS "${DBG}")
+
+        # Add necessary definitions for unicode builds
+        if("${UCD}" STREQUAL "u")
+          list(APPEND wxWidgets_DEFINITIONS UNICODE _UNICODE)
+        endif()
+
+        # Add necessary definitions for debug builds
+        set(wxWidgets_DEFINITIONS_DEBUG _DEBUG __WXDEBUG__)
+
+      endif()
+    endif()
+  endif()
+
 #=====================================================================
 # UNIX_FIND_STYLE
 #=====================================================================
-ELSEIF(wxWidgets_FIND_STYLE STREQUAL "unix")
-	#-----------------------------------------------------------------
-	# UNIX: Helper MACROS
-	#-----------------------------------------------------------------
-	#
-	# Set the default values based on "wx-config --selected-config".
-	#
-	MACRO(WX_CONFIG_SELECT_GET_DEFAULT)
-		EXECUTE_PROCESS(
-			COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}" --selected-config
-			OUTPUT_VARIABLE _wx_selected_config
-			RESULT_VARIABLE _wx_result
-			ERROR_QUIET
-			)
-		IF(_wx_result EQUAL 0)
-			FOREACH(_opt_name debug static unicode universal)
-			STRING(TOUPPER ${_opt_name} _upper_opt_name)
-			IF(_wx_selected_config MATCHES ".*${_opt_name}.*")
-				SET(wxWidgets_DEFAULT_${_upper_opt_name} ON)
-			ELSE(_wx_selected_config MATCHES ".*${_opt_name}.*")
-				SET(wxWidgets_DEFAULT_${_upper_opt_name} OFF)
-			ENDIF(_wx_selected_config MATCHES ".*${_opt_name}.*")
-			ENDFOREACH(_opt_name)
-		ELSE(_wx_result EQUAL 0)
-			FOREACH(_upper_opt_name DEBUG STATIC UNICODE UNIVERSAL)
-			SET(wxWidgets_DEFAULT_${_upper_opt_name} OFF)
-			ENDFOREACH(_upper_opt_name)
-		ENDIF(_wx_result EQUAL 0)
-	ENDMACRO(WX_CONFIG_SELECT_GET_DEFAULT)
-
-	#
-	# Query a boolean configuration option to determine if the system
-	# has both builds available. If so, provide the selection option
-	# to the user.
-	#
-	MACRO(WX_CONFIG_SELECT_QUERY_BOOL _OPT_NAME _OPT_HELP)
-		EXECUTE_PROCESS(
-			COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}" --${_OPT_NAME}=yes
-			RESULT_VARIABLE _wx_result_yes
-			OUTPUT_QUIET
-			ERROR_QUIET
-			)
-		EXECUTE_PROCESS(
-			COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}" --${_OPT_NAME}=no
-			RESULT_VARIABLE _wx_result_no
-			OUTPUT_QUIET
-			ERROR_QUIET
-			)
-		STRING(TOUPPER ${_OPT_NAME} _UPPER_OPT_NAME)
-		IF(_wx_result_yes EQUAL 0 AND _wx_result_no EQUAL 0)
-			OPTION(wxWidgets_USE_${_UPPER_OPT_NAME}
-			${_OPT_HELP} ${wxWidgets_DEFAULT_${_UPPER_OPT_NAME}})
-		ELSE(_wx_result_yes EQUAL 0 AND _wx_result_no EQUAL 0)
-			# If option exists (already in cache), force to available one.
-			IF(DEFINED wxWidgets_USE_${_UPPER_OPT_NAME})
-			IF(_wx_result_yes EQUAL 0)
-				SET(wxWidgets_USE_${_UPPER_OPT_NAME} ON CACHE BOOL ${_OPT_HELP} FORCE)
-			ELSE(_wx_result_yes EQUAL 0)
-				SET(wxWidgets_USE_${_UPPER_OPT_NAME} OFF CACHE BOOL ${_OPT_HELP} FORCE)
-			ENDIF(_wx_result_yes EQUAL 0)
-			ENDIF(DEFINED wxWidgets_USE_${_UPPER_OPT_NAME})
-		ENDIF(_wx_result_yes EQUAL 0 AND _wx_result_no EQUAL 0)
-	ENDMACRO(WX_CONFIG_SELECT_QUERY_BOOL)
-
-	#
-	# Set wxWidgets_SELECT_OPTIONS to wx-config options for selecting
-	# among multiple builds.
-	#
-	MACRO(WX_CONFIG_SELECT_SET_OPTIONS)
-		SET(wxWidgets_SELECT_OPTIONS "")
-		FOREACH(_opt_name debug static unicode universal)
-			STRING(TOUPPER ${_opt_name} _upper_opt_name)
-			IF(DEFINED wxWidgets_USE_${_upper_opt_name})
-			IF(wxWidgets_USE_${_upper_opt_name})
-				LIST(APPEND wxWidgets_SELECT_OPTIONS --${_opt_name}=yes)
-			ELSE(wxWidgets_USE_${_upper_opt_name})
-				LIST(APPEND wxWidgets_SELECT_OPTIONS --${_opt_name}=no)
-			ENDIF(wxWidgets_USE_${_upper_opt_name})
-			ENDIF(DEFINED wxWidgets_USE_${_upper_opt_name})
-		ENDFOREACH(_opt_name)
-	ENDMACRO(WX_CONFIG_SELECT_SET_OPTIONS)
-
-	#-----------------------------------------------------------------
-	# UNIX: Start actual work.
-	#-----------------------------------------------------------------
-	# Support cross-compiling, only search in the target platform.
-	FIND_PROGRAM(wxWidgets_CONFIG_EXECUTABLE wx-config
-		ONLY_CMAKE_FIND_ROOT_PATH)
-
-	IF(wxWidgets_CONFIG_EXECUTABLE)
-		SET(wxWidgets_FOUND TRUE)
-
-		# get defaults based on "wx-config --selected-config"
-		WX_CONFIG_SELECT_GET_DEFAULT()
-
-		# for each option: if both builds are available, provide option
-		WX_CONFIG_SELECT_QUERY_BOOL(debug "Use debug build?")
-		WX_CONFIG_SELECT_QUERY_BOOL(unicode "Use unicode build?")
-		WX_CONFIG_SELECT_QUERY_BOOL(universal "Use universal build?")
-		WX_CONFIG_SELECT_QUERY_BOOL(static "Link libraries statically?")
-
-		# process selection to set wxWidgets_SELECT_OPTIONS
-		WX_CONFIG_SELECT_SET_OPTIONS()
-		DBG_MSG("wxWidgets_SELECT_OPTIONS=${wxWidgets_SELECT_OPTIONS}")
-
-		# run the wx-config program to get cxxflags
-		EXECUTE_PROCESS(
-			COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}"
-			${wxWidgets_SELECT_OPTIONS} --cxxflags
-			OUTPUT_VARIABLE wxWidgets_CXX_FLAGS
-			RESULT_VARIABLE RET
-			ERROR_QUIET
-			)
-		IF(RET EQUAL 0)
-			STRING(STRIP "${wxWidgets_CXX_FLAGS}" wxWidgets_CXX_FLAGS)
-			SEPARATE_ARGUMENTS(wxWidgets_CXX_FLAGS)
-
-			DBG_MSG_V("wxWidgets_CXX_FLAGS=${wxWidgets_CXX_FLAGS}")
-
-			# parse definitions from cxxflags; drop -D* from CXXFLAGS and the -D prefix
-			STRING(REGEX MATCHALL "-D[^;]+"
-				wxWidgets_DEFINITIONS "${wxWidgets_CXX_FLAGS}")
-			STRING(REGEX REPLACE "-D[^;]+;" ""
-				wxWidgets_CXX_FLAGS "${wxWidgets_CXX_FLAGS}")
-			STRING(REPLACE "-D" ""
-				wxWidgets_DEFINITIONS "${wxWidgets_DEFINITIONS}")
-
-			# parse include dirs from cxxflags; drop -I prefix
-			STRING(REGEX MATCHALL "-I[^;]+"
-			wxWidgets_INCLUDE_DIRS "${wxWidgets_CXX_FLAGS}")
-			STRING(REGEX REPLACE "-I[^;]+;" ""
-			wxWidgets_CXX_FLAGS "${wxWidgets_CXX_FLAGS}")
-			STRING(REPLACE "-I" ""
-			wxWidgets_INCLUDE_DIRS "${wxWidgets_INCLUDE_DIRS}")
-
-			DBG_MSG_V("wxWidgets_DEFINITIONS=${wxWidgets_DEFINITIONS}")
-			DBG_MSG_V("wxWidgets_INCLUDE_DIRS=${wxWidgets_INCLUDE_DIRS}")
-			DBG_MSG_V("wxWidgets_CXX_FLAGS=${wxWidgets_CXX_FLAGS}")
-
-		ELSE(RET EQUAL 0)
-			SET(wxWidgets_FOUND FALSE)
-			DBG_MSG_V(
-			"${wxWidgets_CONFIG_EXECUTABLE} --cxxflags FAILED with RET=${RET}")
-		ENDIF(RET EQUAL 0)
-
-		# run the wx-config program to get the libs
-		# - NOTE: wx-config doesn't verify that the libs requested exist
-		# it just produces the names. Maybe a TRY_COMPILE would
-		# be useful here...
-		STRING(REPLACE ";" ","
-			wxWidgets_FIND_COMPONENTS "${wxWidgets_FIND_COMPONENTS}")
-		EXECUTE_PROCESS(
-			COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}"
-			${wxWidgets_SELECT_OPTIONS} --libs ${wxWidgets_FIND_COMPONENTS}
-			OUTPUT_VARIABLE wxWidgets_LIBRARIES
-			RESULT_VARIABLE RET
-			ERROR_QUIET
-			)
-		IF(RET EQUAL 0)
-			STRING(STRIP "${wxWidgets_LIBRARIES}" wxWidgets_LIBRARIES)
-			SEPARATE_ARGUMENTS(wxWidgets_LIBRARIES)
-			STRING(REPLACE "-framework;" "-framework "
-			wxWidgets_LIBRARIES "${wxWidgets_LIBRARIES}")
-			STRING(REPLACE "-arch;" "-arch "
-			wxWidgets_LIBRARIES "${wxWidgets_LIBRARIES}")
-			STRING(REPLACE "-isysroot;" "-isysroot "
-			wxWidgets_LIBRARIES "${wxWidgets_LIBRARIES}")
-
-			# extract linkdirs (-L) for rpath (i.e., LINK_DIRECTORIES)
-			STRING(REGEX MATCHALL "-L[^;]+"
-			wxWidgets_LIBRARY_DIRS "${wxWidgets_LIBRARIES}")
-			STRING(REPLACE "-L" ""
-			wxWidgets_LIBRARY_DIRS "${wxWidgets_LIBRARY_DIRS}")
-
-			DBG_MSG_V("wxWidgets_LIBRARIES=${wxWidgets_LIBRARIES}")
-			DBG_MSG_V("wxWidgets_LIBRARY_DIRS=${wxWidgets_LIBRARY_DIRS}")
-
-		ELSE(RET EQUAL 0)
-			SET(wxWidgets_FOUND FALSE)
-			DBG_MSG("${wxWidgets_CONFIG_EXECUTABLE} --libs ${wxWidgets_FIND_COMPONENTS} FAILED with RET=${RET}")
-		ENDIF(RET EQUAL 0)
-	ENDIF(wxWidgets_CONFIG_EXECUTABLE)
+else()
+  if(wxWidgets_FIND_STYLE STREQUAL "unix")
+    #-----------------------------------------------------------------
+    # UNIX: Helper MACROS
+    #-----------------------------------------------------------------
+    #
+    # Set the default values based on "wx-config --selected-config".
+    #
+    macro(WX_CONFIG_SELECT_GET_DEFAULT)
+      execute_process(
+        COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}"
+          ${wxWidgets_CONFIG_OPTIONS} --selected-config
+        OUTPUT_VARIABLE _wx_selected_config
+        RESULT_VARIABLE _wx_result
+        ERROR_QUIET
+        )
+      if(_wx_result EQUAL 0)
+        foreach(_opt_name debug static unicode universal)
+          string(TOUPPER ${_opt_name} _upper_opt_name)
+          if(_wx_selected_config MATCHES "${_opt_name}")
+            set(wxWidgets_DEFAULT_${_upper_opt_name} ON)
+          else()
+            set(wxWidgets_DEFAULT_${_upper_opt_name} OFF)
+          endif()
+        endforeach()
+      else()
+        foreach(_upper_opt_name DEBUG STATIC UNICODE UNIVERSAL)
+          set(wxWidgets_DEFAULT_${_upper_opt_name} OFF)
+        endforeach()
+      endif()
+    endmacro()
+
+    #
+    # Query a boolean configuration option to determine if the system
+    # has both builds available. If so, provide the selection option
+    # to the user.
+    #
+    macro(WX_CONFIG_SELECT_QUERY_BOOL _OPT_NAME _OPT_HELP)
+      execute_process(
+        COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}"
+          ${wxWidgets_CONFIG_OPTIONS} --${_OPT_NAME}=yes
+        RESULT_VARIABLE _wx_result_yes
+        OUTPUT_QUIET
+        ERROR_QUIET
+        )
+      execute_process(
+        COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}"
+          ${wxWidgets_CONFIG_OPTIONS} --${_OPT_NAME}=no
+        RESULT_VARIABLE _wx_result_no
+        OUTPUT_QUIET
+        ERROR_QUIET
+        )
+      string(TOUPPER ${_OPT_NAME} _UPPER_OPT_NAME)
+      if(_wx_result_yes EQUAL 0 AND _wx_result_no EQUAL 0)
+        option(wxWidgets_USE_${_UPPER_OPT_NAME}
+          ${_OPT_HELP} ${wxWidgets_DEFAULT_${_UPPER_OPT_NAME}})
+      else()
+        # If option exists (already in cache), force to available one.
+        if(DEFINED wxWidgets_USE_${_UPPER_OPT_NAME})
+          if(_wx_result_yes EQUAL 0)
+            set(wxWidgets_USE_${_UPPER_OPT_NAME} ON  CACHE BOOL ${_OPT_HELP} FORCE)
+          else()
+            set(wxWidgets_USE_${_UPPER_OPT_NAME} OFF CACHE BOOL ${_OPT_HELP} FORCE)
+          endif()
+        endif()
+      endif()
+    endmacro()
+
+    #
+    # Set wxWidgets_SELECT_OPTIONS to wx-config options for selecting
+    # among multiple builds.
+    #
+    macro(WX_CONFIG_SELECT_SET_OPTIONS)
+      set(wxWidgets_SELECT_OPTIONS ${wxWidgets_CONFIG_OPTIONS})
+      foreach(_opt_name debug static unicode universal)
+        string(TOUPPER ${_opt_name} _upper_opt_name)
+        if(DEFINED wxWidgets_USE_${_upper_opt_name})
+          if(wxWidgets_USE_${_upper_opt_name})
+            list(APPEND wxWidgets_SELECT_OPTIONS --${_opt_name}=yes)
+          else()
+            list(APPEND wxWidgets_SELECT_OPTIONS --${_opt_name}=no)
+          endif()
+        endif()
+      endforeach()
+    endmacro()
+
+    #-----------------------------------------------------------------
+    # UNIX: Start actual work.
+    #-----------------------------------------------------------------
+    # Support cross-compiling, only search in the target platform.
+    find_program(wxWidgets_CONFIG_EXECUTABLE
+      NAMES $ENV{WX_CONFIG} wx-config wx-config-3.1 wx-config-3.0 wx-config-2.9 wx-config-2.8
+      DOC "Location of wxWidgets library configuration provider binary (wx-config)."
+#      ONLY_CMAKE_FIND_ROOT_PATH
+      )
+
+    if(wxWidgets_CONFIG_EXECUTABLE)
+      set(wxWidgets_FOUND TRUE)
+
+      # get defaults based on "wx-config --selected-config"
+      WX_CONFIG_SELECT_GET_DEFAULT()
+
+      # for each option: if both builds are available, provide option
+      WX_CONFIG_SELECT_QUERY_BOOL(debug "Use debug build?")
+      WX_CONFIG_SELECT_QUERY_BOOL(unicode "Use unicode build?")
+      WX_CONFIG_SELECT_QUERY_BOOL(universal "Use universal build?")
+      WX_CONFIG_SELECT_QUERY_BOOL(static "Link libraries statically?")
+
+      # process selection to set wxWidgets_SELECT_OPTIONS
+      WX_CONFIG_SELECT_SET_OPTIONS()
+      DBG_MSG("wxWidgets_SELECT_OPTIONS=${wxWidgets_SELECT_OPTIONS}")
+
+      # run the wx-config program to get cxxflags
+      execute_process(
+        COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}"
+          ${wxWidgets_SELECT_OPTIONS} --cxxflags
+        OUTPUT_VARIABLE wxWidgets_CXX_FLAGS
+        RESULT_VARIABLE RET
+        ERROR_QUIET
+        )
+      if(RET EQUAL 0)
+        string(STRIP "${wxWidgets_CXX_FLAGS}" wxWidgets_CXX_FLAGS)
+        separate_arguments(wxWidgets_CXX_FLAGS_LIST NATIVE_COMMAND "${wxWidgets_CXX_FLAGS}")
+
+        DBG_MSG_V("wxWidgets_CXX_FLAGS=${wxWidgets_CXX_FLAGS}")
+
+        # parse definitions and include dirs from cxxflags
+        #   drop the -D and -I prefixes
+        set(wxWidgets_CXX_FLAGS)
+        foreach(arg IN LISTS wxWidgets_CXX_FLAGS_LIST)
+          if("${arg}" MATCHES "^-I(.*)$")
+            # include directory
+            list(APPEND wxWidgets_INCLUDE_DIRS "${CMAKE_MATCH_1}")
+          elseif("${arg}" MATCHES "^-D(.*)$")
+            # compile definition
+            list(APPEND wxWidgets_DEFINITIONS "${CMAKE_MATCH_1}")
+          else()
+            list(APPEND wxWidgets_CXX_FLAGS "${arg}")
+          endif()
+        endforeach()
+
+        DBG_MSG_V("wxWidgets_DEFINITIONS=${wxWidgets_DEFINITIONS}")
+        DBG_MSG_V("wxWidgets_INCLUDE_DIRS=${wxWidgets_INCLUDE_DIRS}")
+        DBG_MSG_V("wxWidgets_CXX_FLAGS=${wxWidgets_CXX_FLAGS}")
+
+      else()
+        set(wxWidgets_FOUND FALSE)
+        DBG_MSG_V(
+          "${wxWidgets_CONFIG_EXECUTABLE} --cxxflags FAILED with RET=${RET}")
+      endif()
+
+      # run the wx-config program to get the libs
+      # - NOTE: wx-config doesn't verify that the libs requested exist
+      #         it just produces the names. Maybe a TRY_COMPILE would
+      #         be useful here...
+      unset(_cmp_req)
+      unset(_cmp_opt)
+      foreach(_cmp IN LISTS wxWidgets_FIND_COMPONENTS)
+        if(wxWidgets_FIND_REQUIRED_${_cmp})
+          list(APPEND _cmp_req "${_cmp}")
+        else()
+          list(APPEND _cmp_opt "${_cmp}")
+        endif()
+      endforeach()
+      DBG_MSG_V("wxWidgets required components : ${_cmp_req}")
+      DBG_MSG_V("wxWidgets optional components : ${_cmp_opt}")
+      if(DEFINED _cmp_opt)
+        string(REPLACE ";" "," _cmp_opt "--optional-libs ${_cmp_opt}")
+      endif()
+      string(REPLACE ";" "," _cmp_req "${_cmp_req}")
+      message(STATUS "=========")
+      message(STATUS "${wxWidgets_CONFIG_EXECUTABLE} ${wxWidgets_SELECT_OPTIONS} --libs ${_cmp_req} ${_cmp_opt}")
+      execute_process(
+        COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}"
+          ${wxWidgets_SELECT_OPTIONS} --libs ${_cmp_req} ${_cmp_opt}
+        OUTPUT_VARIABLE wxWidgets_LIBRARIES
+        RESULT_VARIABLE RET
+        ERROR_QUIET
+        )
+      if(RET EQUAL 0)
+        string(STRIP "${wxWidgets_LIBRARIES}" wxWidgets_LIBRARIES)
+        separate_arguments(wxWidgets_LIBRARIES)
+        string(REPLACE "-framework;" "-framework "
+          wxWidgets_LIBRARIES "${wxWidgets_LIBRARIES}")
+        string(REPLACE "-arch;" "-arch "
+          wxWidgets_LIBRARIES "${wxWidgets_LIBRARIES}")
+        string(REPLACE "-isysroot;" "-isysroot "
+          wxWidgets_LIBRARIES "${wxWidgets_LIBRARIES}")
+
+        # extract linkdirs (-L) for rpath (i.e., LINK_DIRECTORIES)
+        string(REGEX MATCHALL "-L[^;]+"
+          wxWidgets_LIBRARY_DIRS "${wxWidgets_LIBRARIES}")
+        string(REGEX REPLACE "-L([^;]+)" "\\1"
+          wxWidgets_LIBRARY_DIRS "${wxWidgets_LIBRARY_DIRS}")
+
+        DBG_MSG_V("wxWidgets_LIBRARIES=${wxWidgets_LIBRARIES}")
+        DBG_MSG_V("wxWidgets_LIBRARY_DIRS=${wxWidgets_LIBRARY_DIRS}")
+
+      else()
+        set(wxWidgets_FOUND FALSE)
+        DBG_MSG("${wxWidgets_CONFIG_EXECUTABLE} --libs ${_cmp_req} ${_cmp_opt} FAILED with RET=${RET}")
+      endif()
+      unset(_cmp_req)
+      unset(_cmp_opt)
+    endif()
+
+    # When using wx-config in MSYS, the include paths are UNIX style paths which may or may
+    # not work correctly depending on you MSYS/MinGW configuration.  CMake expects native
+    # paths internally.
+    if(wxWidgets_FOUND AND MSYS)
+      find_program(_cygpath_exe cygpath ONLY_CMAKE_FIND_ROOT_PATH)
+      DBG_MSG_V("_cygpath_exe:  ${_cygpath_exe}")
+      if(_cygpath_exe)
+        set(_tmp_path "")
+        foreach(_path ${wxWidgets_INCLUDE_DIRS})
+          execute_process(
+            COMMAND cygpath -w ${_path}
+            OUTPUT_VARIABLE _native_path
+            RESULT_VARIABLE _retv
+            OUTPUT_STRIP_TRAILING_WHITESPACE
+            ERROR_QUIET
+            )
+          if(_retv EQUAL 0)
+            file(TO_CMAKE_PATH ${_native_path} _native_path)
+            DBG_MSG_V("Path ${_path} converted to ${_native_path}")
+            string(APPEND _tmp_path " ${_native_path}")
+          endif()
+        endforeach()
+        DBG_MSG("Setting wxWidgets_INCLUDE_DIRS = ${_tmp_path}")
+        set(wxWidgets_INCLUDE_DIRS ${_tmp_path})
+        separate_arguments(wxWidgets_INCLUDE_DIRS)
+        list(REMOVE_ITEM wxWidgets_INCLUDE_DIRS "")
+
+        set(_tmp_path "")
+        foreach(_path ${wxWidgets_LIBRARY_DIRS})
+          execute_process(
+            COMMAND cygpath -w ${_path}
+            OUTPUT_VARIABLE _native_path
+            RESULT_VARIABLE _retv
+            OUTPUT_STRIP_TRAILING_WHITESPACE
+            ERROR_QUIET
+            )
+          if(_retv EQUAL 0)
+            file(TO_CMAKE_PATH ${_native_path} _native_path)
+            DBG_MSG_V("Path ${_path} converted to ${_native_path}")
+            string(APPEND _tmp_path " ${_native_path}")
+          endif()
+        endforeach()
+        DBG_MSG("Setting wxWidgets_LIBRARY_DIRS = ${_tmp_path}")
+        set(wxWidgets_LIBRARY_DIRS ${_tmp_path})
+        separate_arguments(wxWidgets_LIBRARY_DIRS)
+        list(REMOVE_ITEM wxWidgets_LIBRARY_DIRS "")
+      endif()
+      unset(_cygpath_exe CACHE)
+    endif()

 #=====================================================================
 # Neither UNIX_FIND_STYLE, nor WIN32_FIND_STYLE
 #=====================================================================
-ELSE(wxWidgets_FIND_STYLE STREQUAL "win32")
-	IF(NOT wxWidgets_FIND_QUIETLY)
-	  MESSAGE(STATUS
-		"${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): \n"
-		"  Platform unknown/unsupported. It's neither WIN32 nor UNIX "
-		"find style."
-		)
-	ENDIF(NOT wxWidgets_FIND_QUIETLY)
-ENDIF(wxWidgets_FIND_STYLE STREQUAL "win32")
+  else()
+    if(NOT wxWidgets_FIND_QUIETLY)
+      message(STATUS
+        "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): \n"
+        "  Platform unknown/unsupported. It's neither WIN32 nor UNIX "
+        "find style."
+        )
+    endif()
+  endif()
+endif()
+
+# Check that all libraries are present, as wx-config does not check it
+set(_wx_lib_missing "")
+foreach(_wx_lib_ ${wxWidgets_LIBRARIES})
+  if("${_wx_lib_}" MATCHES "^-l(.*)")
+    set(_wx_lib_name "${CMAKE_MATCH_1}")
+    unset(_wx_lib_found CACHE)
+    find_library(_wx_lib_found NAMES ${_wx_lib_name} HINTS ${wxWidgets_LIBRARY_DIRS})
+    if(_wx_lib_found STREQUAL _wx_lib_found-NOTFOUND)
+      list(APPEND _wx_lib_missing ${_wx_lib_name})
+    endif()
+    unset(_wx_lib_found CACHE)
+  endif()
+endforeach()
+
+if (_wx_lib_missing)
+  string(REPLACE ";" " " _wx_lib_missing "${_wx_lib_missing}")
+  DBG_MSG_V("wxWidgets not found due to following missing libraries: ${_wx_lib_missing}")
+  set(wxWidgets_FOUND FALSE)
+  unset(wxWidgets_LIBRARIES)
+endif()
+unset(_wx_lib_missing)
+
+# Check if a specific version was requested by find_package().
+if(wxWidgets_FOUND)
+  unset(_wx_filename)
+  find_file(_wx_filename wx/version.h PATHS ${wxWidgets_INCLUDE_DIRS} NO_DEFAULT_PATH)
+  dbg_msg("_wx_filename:  ${_wx_filename}")
+
+  if(NOT _wx_filename)
+    message(FATAL_ERROR "wxWidgets wx/version.h file not found in ${wxWidgets_INCLUDE_DIRS}.")
+  endif()
+
+  file(READ "${_wx_filename}" _wx_version_h)
+  unset(_wx_filename CACHE)
+
+  string(REGEX REPLACE "^(.*\n)?#define +wxMAJOR_VERSION +([0-9]+).*"
+    "\\2" wxWidgets_VERSION_MAJOR "${_wx_version_h}" )
+  string(REGEX REPLACE "^(.*\n)?#define +wxMINOR_VERSION +([0-9]+).*"
+    "\\2" wxWidgets_VERSION_MINOR "${_wx_version_h}" )
+  string(REGEX REPLACE "^(.*\n)?#define +wxRELEASE_NUMBER +([0-9]+).*"
+    "\\2" wxWidgets_VERSION_PATCH "${_wx_version_h}" )
+  set(wxWidgets_VERSION_STRING
+    "${wxWidgets_VERSION_MAJOR}.${wxWidgets_VERSION_MINOR}.${wxWidgets_VERSION_PATCH}" )
+  dbg_msg("wxWidgets_VERSION_STRING:    ${wxWidgets_VERSION_STRING}")
+endif()

 # Debug output:
 DBG_MSG("wxWidgets_FOUND           : ${wxWidgets_FOUND}")
@@ -418,10 +980,21 @@

 #=====================================================================
 #=====================================================================
-INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(wxWidgets DEFAULT_MSG wxWidgets_FOUND)
-# Maintain consistency with all other variables.
-SET(wxWidgets_FOUND ${WXWIDGETS_FOUND})
+
+include(FindPackageHandleStandardArgs)
+
+# FIXME: set wxWidgets_<comp>_FOUND for wx-config branch
+#        and use HANDLE_COMPONENTS on Unix too
+if(wxWidgets_FIND_STYLE STREQUAL "win32")
+  set(wxWidgets_HANDLE_COMPONENTS "HANDLE_COMPONENTS")
+endif()
+
+find_package_handle_standard_args(wxWidgets
+  REQUIRED_VARS wxWidgets_LIBRARIES wxWidgets_INCLUDE_DIRS
+  VERSION_VAR   wxWidgets_VERSION_STRING
+  ${wxWidgets_HANDLE_COMPONENTS}
+  )
+unset(wxWidgets_HANDLE_COMPONENTS)

 #=====================================================================
 # Macros for use in wxWidgets apps.
@@ -432,24 +1005,26 @@
 #=====================================================================

 # Resource file compiler.
-FIND_PROGRAM(wxWidgets_wxrc_EXECUTABLE wxrc
-	${wxWidgets_ROOT_DIR}/utils/wxrc/vc_msw
-	)
-
-#
+find_program(wxWidgets_wxrc_EXECUTABLE
+  NAMES $ENV{WXRC_CMD} wxrc
+  PATHS ${wxWidgets_ROOT_DIR}/utils/wxrc/vc_msw
+  DOC "Location of wxWidgets resource file compiler binary (wxrc)"
+  )
+
+#
 # WX_SPLIT_ARGUMENTS_ON(<keyword> <left> <right> <arg1> <arg2> ...)
-#
+#
 # Sets <left> and <right> to contain arguments to the left and right,
 # respectively, of <keyword>.
-#
+#
 # Example usage:
-#  FUNCTION(WXWIDGETS_ADD_RESOURCES outfiles)
+#  function(WXWIDGETS_ADD_RESOURCES outfiles)
 #    WX_SPLIT_ARGUMENTS_ON(OPTIONS wxrc_files wxrc_options ${ARGN})
 #    ...
-#  ENDFUNCTION(WXWIDGETS_ADD_RESOURCES)
+#  endfunction()
 #
 #  WXWIDGETS_ADD_RESOURCES(sources ${xrc_files} OPTIONS -e -o file.C)
-#
+#
 # NOTE: This is a generic piece of code that should be renamed to
 # SPLIT_ARGUMENTS_ON and put in a file serving the same purpose as
 # FindPackageStandardArgs.cmake. At the time of this writing
@@ -457,29 +1032,29 @@
 # here a bit more generalized. So, there are already two find modules
 # using this approach.
 #
-FUNCTION(WX_SPLIT_ARGUMENTS_ON _keyword _leftvar _rightvar)
-	# FIXME: Document that the input variables will be cleared.
-	#LIST(APPEND ${_leftvar}  "")
-	#LIST(APPEND ${_rightvar} "")
-	SET(${_leftvar}  "")
-	SET(${_rightvar} "")
-
-	SET(_doing_right FALSE)
-	FOREACH(element ${ARGN})
-		IF("${element}" STREQUAL "${_keyword}")
-			SET(_doing_right TRUE)
-		ELSE("${element}" STREQUAL "${_keyword}")
-			IF(_doing_right)
-				LIST(APPEND ${_rightvar} "${element}")
-			ELSE(_doing_right)
-				LIST(APPEND ${_leftvar} "${element}")
-			ENDIF(_doing_right)
-		ENDIF("${element}" STREQUAL "${_keyword}")
-	ENDFOREACH(element)
-
-	SET(${_leftvar}  ${${_leftvar}}  PARENT_SCOPE)
-	SET(${_rightvar} ${${_rightvar}} PARENT_SCOPE)
-ENDFUNCTION(WX_SPLIT_ARGUMENTS_ON)
+function(WX_SPLIT_ARGUMENTS_ON _keyword _leftvar _rightvar)
+  # FIXME: Document that the input variables will be cleared.
+  #list(APPEND ${_leftvar}  "")
+  #list(APPEND ${_rightvar} "")
+  set(${_leftvar}  "")
+  set(${_rightvar} "")
+
+  set(_doing_right FALSE)
+  foreach(element ${ARGN})
+    if("${element}" STREQUAL "${_keyword}")
+      set(_doing_right TRUE)
+    else()
+      if(_doing_right)
+        list(APPEND ${_rightvar} "${element}")
+      else()
+        list(APPEND ${_leftvar} "${element}")
+      endif()
+    endif()
+  endforeach()
+
+  set(${_leftvar}  ${${_leftvar}}  PARENT_SCOPE)
+  set(${_rightvar} ${${_rightvar}} PARENT_SCOPE)
+endfunction()

 #
 # WX_GET_DEPENDENCIES_FROM_XML(
@@ -492,144 +1067,144 @@
 #
 # FIXME: Add documentation here...
 #
-FUNCTION(WX_GET_DEPENDENCIES_FROM_XML
-	_depends
-	_match_patt
-	_clean_patt
-	_xml_contents
-	_depends_path
-	)
-
-	STRING(REGEX MATCHALL
-		${_match_patt}
-		dep_file_list
-		"${${_xml_contents}}"
-		)
-	FOREACH(dep_file ${dep_file_list})
-		STRING(REGEX REPLACE ${_clean_patt} "" dep_file "${dep_file}")
-
-		# make the file have an absolute path
-		IF(NOT IS_ABSOLUTE "${dep_file}")
-			SET(dep_file "${${_depends_path}}/${dep_file}")
-		ENDIF(NOT IS_ABSOLUTE "${dep_file}")
-
-		# append file to dependency list
-		LIST(APPEND ${_depends} "${dep_file}")
-	ENDFOREACH(dep_file)
-
-	SET(${_depends} ${${_depends}} PARENT_SCOPE)
-ENDFUNCTION(WX_GET_DEPENDENCIES_FROM_XML)
-
-# #
-# # WXWIDGETS_ADD_RESOURCES(<sources> <xrc_files>
-# #                         OPTIONS <options> [NO_CPP_CODE])
-# #
-# # Adds a custom command for resource file compilation of the
-# # <xrc_files> and appends the output files to <sources>.
-# #
-# # Example usages:
-# #   WXWIDGETS_ADD_RESOURCES(sources xrc/main_frame.xrc)
-# #   WXWIDGETS_ADD_RESOURCES(sources ${xrc_files} OPTIONS -e -o altname.cxx)
-# #
-FUNCTION(WXWIDGETS_ADD_RESOURCES _outfiles)
-	WX_SPLIT_ARGUMENTS_ON(OPTIONS rc_file_list rc_options ${ARGN})
-
-	# Parse files for dependencies.
-	SET(rc_file_list_abs "")
-	SET(rc_depends "")
-	FOREACH(rc_file ${rc_file_list})
-		GET_FILENAME_COMPONENT(depends_path ${rc_file} PATH)
-
-		GET_FILENAME_COMPONENT(rc_file_abs ${rc_file} ABSOLUTE)
-		LIST(APPEND rc_file_list_abs "${rc_file_abs}")
-
-		# All files have absolute paths or paths relative to the location
-		# of the rc file.
-		FILE(READ "${rc_file_abs}" rc_file_contents)
-
-		# get bitmap/bitmap2 files
-		WX_GET_DEPENDENCIES_FROM_XML(
-			rc_depends
-			"<bitmap[^<]+"
-			"^<bitmap[^>]*>"
-			rc_file_contents
-			depends_path
-			)
-
-		# get url files
-		WX_GET_DEPENDENCIES_FROM_XML(
-			rc_depends
-			"<url[^<]+"
-			"^<url[^>]*>"
-			rc_file_contents
-			depends_path
-			)
-
-		# get wxIcon files
-		WX_GET_DEPENDENCIES_FROM_XML(
-			rc_depends
-			"<object[^>]*class=\"wxIcon\"[^<]+"
-			"^<object[^>]*>"
-			rc_file_contents
-			depends_path
-			)
-	ENDFOREACH(rc_file)
-
-	#
-	# Parse options.
-	#
-	# If NO_CPP_CODE option specified, then produce .xrs file rather
-	# than a .cpp file (i.e., don't add the default --cpp-code option).
-	LIST(FIND rc_options NO_CPP_CODE index)
-	IF(index EQUAL -1)
-		LIST(APPEND rc_options --cpp-code)
-		# wxrc's default output filename for cpp code.
-		SET(outfile resource.cpp)
-	ELSE(index EQUAL -1)
-		LIST(REMOVE_AT rc_options ${index})
-		# wxrc's default output filename for xrs file.
-		SET(outfile resource.xrs)
-	ENDIF(index EQUAL -1)
-
-	# Get output name for use in ADD_CUSTOM_COMMAND.
-	# - short option scanning
-	LIST(FIND rc_options -o index)
-	IF(NOT index EQUAL -1)
-		MATH(EXPR filename_index "${index} + 1")
-		LIST(GET rc_options ${filename_index} outfile)
-		#LIST(REMOVE_AT rc_options ${index} ${filename_index})
-	ENDIF(NOT index EQUAL -1)
-	# - long option scanning
-	STRING(REGEX MATCH "--output=[^;]*" outfile_opt "${rc_options}")
-	IF(outfile_opt)
-		STRING(REPLACE "--output=" "" outfile "${outfile_opt}")
-	ENDIF(outfile_opt)
-	#STRING(REGEX REPLACE "--output=[^;]*;?" "" rc_options "${rc_options}")
-	#STRING(REGEX REPLACE ";$" "" rc_options "${rc_options}")
-
-	IF(NOT IS_ABSOLUTE "${outfile}")
-		SET(outfile "${CMAKE_CURRENT_BINARY_DIR}/${outfile}")
-	ENDIF(NOT IS_ABSOLUTE "${outfile}")
-	ADD_CUSTOM_COMMAND(
-		OUTPUT "${outfile}"
-		COMMAND ${wxWidgets_wxrc_EXECUTABLE} ${rc_options} ${rc_file_list_abs}
-		DEPENDS ${rc_file_list_abs} ${rc_depends}
-		)
-
-	# Add generated header to output file list.
-	LIST(FIND rc_options -e short_index)
-	LIST(FIND rc_options --extra-cpp-code long_index)
-	IF(NOT short_index EQUAL -1 OR NOT long_index EQUAL -1)
-		GET_FILENAME_COMPONENT(outfile_ext ${outfile} EXT)
-		STRING(REPLACE "${outfile_ext}" ".h" outfile_header "${outfile}")
-		LIST(APPEND ${_outfiles} "${outfile_header}")
-		SET_SOURCE_FILES_PROPERTIES(
-		"${outfile_header}" PROPERTIES GENERATED TRUE
-		)
-	ENDIF(NOT short_index EQUAL -1 OR NOT long_index EQUAL -1)
-
-	# Add generated file to output file list.
-	LIST(APPEND ${_outfiles} "${outfile}")
-
-	SET(${_outfiles} ${${_outfiles}} PARENT_SCOPE)
-ENDFUNCTION(WXWIDGETS_ADD_RESOURCES)
+function(WX_GET_DEPENDENCIES_FROM_XML
+    _depends
+    _match_patt
+    _clean_patt
+    _xml_contents
+    _depends_path
+    )
+
+  string(REGEX MATCHALL
+    ${_match_patt}
+    dep_file_list
+    "${${_xml_contents}}"
+    )
+  foreach(dep_file ${dep_file_list})
+    string(REGEX REPLACE ${_clean_patt} "" dep_file "${dep_file}")
+
+    # make the file have an absolute path
+    if(NOT IS_ABSOLUTE "${dep_file}")
+      set(dep_file "${${_depends_path}}/${dep_file}")
+    endif()
+
+    # append file to dependency list
+    list(APPEND ${_depends} "${dep_file}")
+  endforeach()
+
+  set(${_depends} ${${_depends}} PARENT_SCOPE)
+endfunction()
+
+#
+# WXWIDGETS_ADD_RESOURCES(<sources> <xrc_files>
+#                         OPTIONS <options> [NO_CPP_CODE])
+#
+# Adds a custom command for resource file compilation of the
+# <xrc_files> and appends the output files to <sources>.
+#
+# Example usages:
+#   WXWIDGETS_ADD_RESOURCES(sources xrc/main_frame.xrc)
+#   WXWIDGETS_ADD_RESOURCES(sources ${xrc_files} OPTIONS -e -o altname.cxx)
+#
+function(WXWIDGETS_ADD_RESOURCES _outfiles)
+  WX_SPLIT_ARGUMENTS_ON(OPTIONS rc_file_list rc_options ${ARGN})
+
+  # Parse files for dependencies.
+  set(rc_file_list_abs "")
+  set(rc_depends       "")
+  foreach(rc_file ${rc_file_list})
+    get_filename_component(depends_path ${rc_file} PATH)
+
+    get_filename_component(rc_file_abs ${rc_file} ABSOLUTE)
+    list(APPEND rc_file_list_abs "${rc_file_abs}")
+
+    # All files have absolute paths or paths relative to the location
+    # of the rc file.
+    file(READ "${rc_file_abs}" rc_file_contents)
+
+    # get bitmap/bitmap2 files
+    WX_GET_DEPENDENCIES_FROM_XML(
+      rc_depends
+      "<bitmap[^<]+"
+      "^<bitmap[^>]*>"
+      rc_file_contents
+      depends_path
+      )
+
+    # get url files
+    WX_GET_DEPENDENCIES_FROM_XML(
+      rc_depends
+      "<url[^<]+"
+      "^<url[^>]*>"
+      rc_file_contents
+      depends_path
+      )
+
+    # get wxIcon files
+    WX_GET_DEPENDENCIES_FROM_XML(
+      rc_depends
+      "<object[^>]*class=\"wxIcon\"[^<]+"
+      "^<object[^>]*>"
+      rc_file_contents
+      depends_path
+      )
+  endforeach()
+
+  #
+  # Parse options.
+  #
+  # If NO_CPP_CODE option specified, then produce .xrs file rather
+  # than a .cpp file (i.e., don't add the default --cpp-code option).
+  list(FIND rc_options NO_CPP_CODE index)
+  if(index EQUAL -1)
+    list(APPEND rc_options --cpp-code)
+    # wxrc's default output filename for cpp code.
+    set(outfile resource.cpp)
+  else()
+    list(REMOVE_AT rc_options ${index})
+    # wxrc's default output filename for xrs file.
+    set(outfile resource.xrs)
+  endif()
+
+  # Get output name for use in ADD_CUSTOM_COMMAND.
+  # - short option scanning
+  list(FIND rc_options -o index)
+  if(NOT index EQUAL -1)
+    math(EXPR filename_index "${index} + 1")
+    list(GET rc_options ${filename_index} outfile)
+    #list(REMOVE_AT rc_options ${index} ${filename_index})
+  endif()
+  # - long option scanning
+  string(REGEX MATCH "--output=[^;]*" outfile_opt "${rc_options}")
+  if(outfile_opt)
+    string(REPLACE "--output=" "" outfile "${outfile_opt}")
+  endif()
+  #string(REGEX REPLACE "--output=[^;]*;?" "" rc_options "${rc_options}")
+  #string(REGEX REPLACE ";$" "" rc_options "${rc_options}")
+
+  if(NOT IS_ABSOLUTE "${outfile}")
+    set(outfile "${CMAKE_CURRENT_BINARY_DIR}/${outfile}")
+  endif()
+  add_custom_command(
+    OUTPUT "${outfile}"
+    COMMAND ${wxWidgets_wxrc_EXECUTABLE} ${rc_options} ${rc_file_list_abs}
+    DEPENDS ${rc_file_list_abs} ${rc_depends}
+    )
+
+  # Add generated header to output file list.
+  list(FIND rc_options -e short_index)
+  list(FIND rc_options --extra-cpp-code long_index)
+  if(NOT short_index EQUAL -1 OR NOT long_index EQUAL -1)
+    get_filename_component(outfile_ext ${outfile} EXT)
+    string(REPLACE "${outfile_ext}" ".h" outfile_header "${outfile}")
+    list(APPEND ${_outfiles} "${outfile_header}")
+    set_source_files_properties(
+      "${outfile_header}" PROPERTIES GENERATED TRUE
+      )
+  endif()
+
+  # Add generated file to output file list.
+  list(APPEND ${_outfiles} "${outfile}")
+
+  set(${_outfiles} ${${_outfiles}} PARENT_SCOPE)
+endfunction()


Avoid copying DLLs to "RelWithDebInfo"

Avoid copying DLLs to "RelWithDebInfo"

--- cmake/OpenSimMacros.cmake
+++ cmake/OpenSimMacros.cmake
@@ -353,15 +353,12 @@
             message(FATAL_ERROR "Zero DLLs found in directory "
                                 "${DEP_INSTALL_DIR}.")
         endif()
-        foreach(DLL IN LISTS DLLS)
-            get_filename_component(DLL_NAME ${DLL} NAME)
-            set(DEST_DIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR})
-            add_custom_command(OUTPUT ${DLL_NAME}
-                               COMMAND ${CMAKE_COMMAND} -E copy ${DLL} ${DEST_DIR}
-                               COMMENT "Copying ${DLL_NAME} to ${DEST_DIR}.")
-            list(APPEND DLL_NAMES ${DLL_NAME})
-        endforeach()
-        add_custom_target(Copy_${DEP_NAME}_DLLs ALL DEPENDS ${DLL_NAMES})
+	set(DEST_DIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR})
+	add_custom_command(OUTPUT ${DLLS}
+	                   COMMAND ${CMAKE_COMMAND -E make_directory ${DEST_DIR}
+                           COMMAND ${CMAKE_COMMAND} -E copy ${DLLS} ${DEST_DIR}
+                           COMMENT "Copying ${DLLS} to ${DEST_DIR}.")
+        add_custom_target(Copy_${DEP_NAME}_DLLs ALL DEPENDS ${DLLS})
         set_target_properties(Copy_${DEP_NAME}_DLLs PROPERTIES
             PROJECT_LABEL "Copy ${DEP_NAME} DLLs")
         if(OPENSIM_COPY_DEPENDENCIES)


Update C++ JSON to 3.7.3 (#4261)

Update C++ JSON to 3.7.3 (#4261)

--- cmake/external_json.cmake
+++ cmake/external_json.cmake
@@ -22,7 +22,7 @@
 #------------------------------------------------------------------------------

 SET(JSON_GIT_REPO_URL https://github.com/nlohmann/json)
-SET(JSON_GIT_LABEL v3.5.0)
+SET(JSON_GIT_LABEL v3.7.3)

 ExternalProject_Add(
     ext_json


Add /usr/share/R/include to search list -- HJB

--- cmake/modules/FindR.cmake
+++ cmake/modules/FindR.cmake
@@ -39,7 +39,7 @@

 set(R_PKGCONF_INCLUDE_DIRS
         "${R_HOME}/include"
-        "/usr/local/include" "/usr/include"
+        "/usr/local/include" "/usr/include" "/usr/share/R/include"
         )

 # Finf the R, Rblas and Rlapack libraries


fix gcc 9 freeimage link

fix gcc 9 freeimage link

--- cmake/Dependencies_core.cmake
+++ cmake/Dependencies_core.cmake
@@ -74,10 +74,11 @@
 PackageHelper(OpenMP ${OPENMP_FOUND} "${OPENMP_INCLUDE_DIRS}" "${OPENMP_LIBRARIES}")

 #libfreeimage
+
+find_package(FreeImagePlus QUIET)
+PackageHelper(FreeImagePlus ${FREEIMAGEPLUS_FOUND} "${FREEIMAGEPLUS_INCLUDE_PATH}" "${FREEIMAGEPLUS_LIBRARIES}")
 find_package(FreeImage QUIET)
 PackageHelper(FreeImage ${FREEIMAGE_FOUND} "${FREEIMAGE_INCLUDE_PATH}" "${FREEIMAGE_LIBRARIES}")
-find_package(FreeImagePlus QUIET)
-PackageHelper(FreeImagePlus ${FREEIMAGEPLUS_FOUND} "${FREEIMAGEPLUS_INCLUDE_PATH}" "${FREEIMAGEPLUS_LIBRARIES}")
 if(FREEIMAGE_FOUND AND FREEIMAGEPLUS_FOUND)
     SET(SAIGA_USE_FREEIMAGE 1)
 endif()
@@ -110,3 +111,5 @@
 set(CORE_LIBS ${LIBS})
 set(CORE_TARGETS ${LIB_TARGETS})
 set(MODULE_CORE 1)
+
+message(STATUS ${LIBS})


CMake: Respect BZIP2_DIR in FindBZIP2.cmake

--- cmake/modules/FindBZIP2.cmake
+++ cmake/modules/FindBZIP2.cmake
@@ -23,15 +23,19 @@
 #   BZIP2_VERSION
 #

-#
-# Houston, we have a problem: CMake ships its own FindBZip2.cmake module.
-# Unfortunately we want to call DEAL_II_PACKAGE_HANDLE. Therefore, use the
-# original find module and do a dummy call to DEAL_II_PACKAGE_HANDLE:
-#
+SET(BZIP2_DIR "" CACHE PATH "An optional hint to a BZIP2 installation")
+SET_IF_EMPTY(BZIP2_DIR "$ENV{BZIP2_DIR}")
+
+SET(_cmake_prefix_path_backup "${CMAKE_PREFIX_PATH}")

 # temporarily disable ${CMAKE_SOURCE_DIR}/cmake/modules for module lookup
 LIST(REMOVE_ITEM CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/)
+
+SET(CMAKE_PREFIX_PATH ${BZIP2_DIR} ${_cmake_prefix_path_backup})
+
 FIND_PACKAGE(BZip2)
+
+SET(CMAKE_PREFIX_PATH ${_cmake_prefix_path_backup})
 LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/)

 SET(BZIP2_VERSION ${BZIP2_VERSION_STRING})


add feature: compatible with cudnn 8

add feature: compatible with cudnn 8

--- cmake/modules/FindCUDNN.cmake
+++ cmake/modules/FindCUDNN.cmake
@@ -21,8 +21,13 @@
 find_package_handle_standard_args(CUDNN DEFAULT_MSG ${__looked_for})

 if (CUDNN_FOUND)
-  parse_header(${CUDNN_INCLUDE_DIRS}/cudnn.h
-               CUDNN_MAJOR CUDNN_MINOR CUDNN_PATCHLEVEL)
+  set(__version_files "cudnn.h" "cudnn_version.h")
+  foreach (__version_file ${__version_files})
+    if (EXISTS ${CUDNN_INCLUDE_DIRS}/${__version_file})
+      parse_header(${CUDNN_INCLUDE_DIRS}/${__version_file}
+                   CUDNN_MAJOR CUDNN_MINOR CUDNN_PATCHLEVEL)
+    endif ()
+  endforeach ()
   if (NOT CUDNN_MAJOR)
     set(CUDNN_VERSION "?")
   else ()


Add ISA targeting flags for SSE42 and AVX512SKX to use with the CrayPE

--- common/cmake/crayprgenv.cmake
+++ common/cmake/crayprgenv.cmake
@@ -15,8 +15,8 @@
 ## ======================================================================== ##

 SET(FLAGS_SSE2      "-target-cpu=xeon")
-SET(FLAGS_SSE42     "ERROR_ISA_NOT_SUPPORTED")
+SET(FLAGS_SSE42     "-target-cpu=interlagos")
 SET(FLAGS_AVX       "-target-cpu=sandybridge")
 SET(FLAGS_AVX2      "-target-cpu=haswell")
 SET(FLAGS_AVX512KNL "-target-cpu=mic-knl")
-SET(FLAGS_AVX512SKX "ERROR_ISA_NOT_SUPPORTED")
+SET(FLAGS_AVX512SKX "-target-cpu=x86-skylake")


Disable RTTI since libstdc++ doesn't have it enabled. See https://github.com/espressif/esp-idf/issues/3573#issuecomment-499386470

--- lib/smooth/compiler_options.cmake
+++ lib/smooth/compiler_options.cmake
@@ -5,6 +5,8 @@
     target_compile_options(${target} PRIVATE -Wcast-align -Wunused )
     target_compile_options(${target} PRIVATE -Wconversion -Wsign-conversion)
     target_compile_options(${target} PRIVATE -Wlogical-op -Wdouble-promotion -Wformat=2)
+    target_compile_options(${target} PUBLIC $<$<COMPILE_LANGUAGE:CXX>: -fno-rtti>)
+

     if( NOT ESP_PLATFORM )
         target_compile_options(${target} PRIVATE -Wmisleading-indentation -Wduplicated-cond -Wduplicated-branches -Wnull-dereference)


Fix defaults.cmake.

Fix defaults.cmake.

--- defaults.cmake
+++ defaults.cmake
@@ -279,8 +279,8 @@
   if(${MSVC})
     check_include_directory_msvc("freetype-" "include")
     check_link_directory_msvc("freetype-" "objs/vc2010/Win32")
-    set(FREETYPE_LIBRARY_DEBUG "freetype255MTd.lib" PARENT_SCOPE)
-    set(FREETYPE_LIBRARY "freetype255MT.lib" PARENT_SCOPE)
+    set(FREETYPE_LIBRARY_DEBUG "freetype255d.lib" PARENT_SCOPE)
+    set(FREETYPE_LIBRARY "freetype255.lib" PARENT_SCOPE)
   else()
     set(lib_mode SHARED)
     if(1 LESS ${ARGC})


libgcc and libstdc++ are not required by MSVC

--- resources/Installer/Packaging.cmake
+++ resources/Installer/Packaging.cmake
@@ -15,7 +15,7 @@
 # Packaging
 set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP ON)
 include(InstallRequiredSystemLibraries)
-if(WIN32)
+if(WIN32 AND NOT MSVC)
 	install(FILES ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION bin COMPONENT runtimelibraries)
 	# Search the "libgcc_s_sjlj-1.dll" file
 	execute_process(


fix needed in cdash script

fix needed in cdash script

--- test/run_tests.cmake
+++ test/run_tests.cmake
@@ -64,7 +64,7 @@
 #ctest_update()
 ctest_build(BUILD ${CTEST_SOURCE_DIRECTORY}/src)

-file(GLOB build_libdir src/build/lib.*)
+file(GLOB build_libdir ${CTEST_SOURCE_DIRECTORY}/src/build/lib.*)
 set(ENV{PYTHONPATH} "${build_libdir}:$ENV{PYTHONPATH}")

 # only run quick tests:


[Build] Made various updates to the CMake framework.

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -30,6 +30,13 @@
   # Set the project name
   project (${PACKAGE})
 endmacro (set_project_names)
+
+##
+# Set the project brief
+macro (set_project_brief _project_brief)
+  set (PACKAGE_BRIEF ${_project_brief})
+endmacro (set_project_brief)
+

 ##
 # Set the project versions
@@ -148,12 +155,8 @@
   include (InstallRequiredSystemLibraries)

   set (CPACK_PACKAGE_NAME "${_project_name}")
+  set (CPACK_PACKAGE_DESCRIPTION "${PACKAGE_BRIEF}")
 endmacro (packaging_init)
-
-#
-macro (packaging_set_description _project_description)
-  set (CPACK_PACKAGE_DESCRIPTION "${_project_description}")
-endmacro (packaging_set_description)

 #
 macro (packaging_set_summary _project_summary)
@@ -817,8 +820,13 @@
   #  * on external libraries (Boost, MySQL, SOCI, StdAir), as calculated by
   #    the get_external_libs() macro above;
   #  * on the other module libraries, as provided as paramaters to this macro
-  target_link_libraries (${_lib_target}
-    ${PROJ_DEP_LIBS_FOR_LIB} ${_intermodule_dependencies})
+  #  * on the main/standard library of the module (when, of course, the
+  #    current library is not the main/standard library).
+  if (NOT "${_lib_short_name}" STREQUAL "${MODULE_NAME}")
+	set (_intramodule_dependencies ${MODULE_NAME}lib)
+  endif (NOT "${_lib_short_name}" STREQUAL "${MODULE_NAME}")
+  target_link_libraries (${_lib_target} ${PROJ_DEP_LIBS_FOR_LIB}
+	${_intermodule_dependencies} ${_intramodule_dependencies})

   # Register the library target in the project (for reporting purpose).
   # Note, the list() commands creates a new variable value in the current scope:
@@ -969,15 +977,23 @@
 # Add a Python script to be installed
 macro (module_python_add _script_file)
   #
-  set (_full_python_script_path ${CMAKE_CURRENT_SOURCE_DIR}/${_script_file})
-  if (EXISTS ${_full_python_script_path})
-    # Install the development helpers
-    install (PROGRAMS ${_script_file} DESTINATION bin COMPONENT devel)
-
-  else (EXISTS ${_full_python_script_path})
+  set (_full_script_src_path ${CMAKE_CURRENT_SOURCE_DIR}/${_script_file}.in)
+  set (_full_script_path ${CMAKE_CURRENT_BINARY_DIR}/${_script_file})
+  if (EXISTS ${_full_script_src_path})
+	#
+    configure_file (${_full_script_src_path} ${_full_script_path} @ONLY)
+
+    # Add the 'scripts_${MODULE_NAME}' target, depending on the
+    # converted (Python) scripts
+    add_custom_target (scripts_${MODULE_NAME} ALL DEPENDS ${_full_script_path})
+
+    # Install the (Python) script file
+    install (PROGRAMS ${_full_script_path} DESTINATION bin COMPONENT devel)
+
+  else (EXISTS ${_full_script_src_path})
     message (FATAL_ERROR
-      "The Python script to be installed, '${_script_file}', does not exist")
-  endif (EXISTS ${_full_python_script_path})
+      "The Python template script, '${_script_file}.in', does not exist")
+  endif (EXISTS ${_full_script_src_path})

   # Register the binary target in the project (for reporting purpose)
   get_filename_component (_script_alone ${_script_file} NAME)
@@ -1286,6 +1302,7 @@
   message (STATUS "PACKAGE_PRETTY_NAME ............ : ${PACKAGE_PRETTY_NAME}")
   message (STATUS "PACKAGE ........................ : ${PACKAGE}")
   message (STATUS "PACKAGE_NAME ................... : ${PACKAGE_NAME}")
+  message (STATUS "PACKAGE_BRIEF .................. : ${PACKAGE_BRIEF}")
   message (STATUS "PACKAGE_VERSION ................ : ${PACKAGE_VERSION}")
   message (STATUS "GENERIC_LIB_VERSION ............ : ${GENERIC_LIB_VERSION}")
   message (STATUS "GENERIC_LIB_SOVERSION .......... : ${GENERIC_LIB_SOVERSION}")


SVN_SILENT made messages (.desktop file)

--- src/vlc.desktop.cmake
+++ src/vlc.desktop.cmake
@@ -18,6 +18,7 @@
 Name[de]=VLC
 Name[es]=VLC
 Name[et]=VLC
+Name[fi]=VLC
 Name[hu]=VLC
 Name[ko]=VLC
 Name[nb]=VLC
@@ -48,6 +49,7 @@
 Comment[de]=Phonon-Treiber für VLC
 Comment[es]=Motor VLC para Phonon
 Comment[et]=Phononi VLC taustaprogramm
+Comment[fi]=Phonon VLC-taustaohjelma
 Comment[hu]=Phonon VLC-backend
 Comment[ko]=Phonon VLC 백엔드
 Comment[nb]=Phonon VLC-motor


SVN_SILENT made messages (.desktop file) - always resolve ours

In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"

--- src/vlc.desktop.cmake
+++ src/vlc.desktop.cmake
@@ -20,10 +20,12 @@
 Name[fr]=VLC
 Name[gl]=VLC
 Name[id]=VLC
+Name[it]=VLC
 Name[ko]=VLC
 Name[nb]=VLC
 Name[nl]=VLC
 Name[nn]=VLC
+Name[pt_BR]=VLC
 Name[sk]=VLC
 Name[sr]=ВЛЦ
 Name[sr@ijekavian]=ВЛЦ
@@ -44,10 +46,12 @@
 Comment[fr]=Module VLC pour Phonon
 Comment[gl]=Infraestrutura de VLC para Phonon
 Comment[id]=Backend phonon VLC
+Comment[it]=Motore VLC di Phonon
 Comment[ko]=Phonon VLC 백엔드
 Comment[nb]=Phonon VLC-motor
 Comment[nl]=VLC-backend van Phonon
 Comment[nn]=VLC-motor for Phonon
+Comment[pt_BR]=Infraestrutura VLC do Phonon
 Comment[sk]=Backend Phonon VLC
 Comment[sr]=ВЛЦ као позадина Фонона
 Comment[sr@ijekavian]=ВЛЦ као позадина Фонона


BUG: Fix itkUltrasoundProbeGeometryCalculatorSerializerTest #138

This is fixed in ParameterSerializer.

--- CMake/Superbuild/ExternalProjectsConfig.cmake
+++ CMake/Superbuild/ExternalProjectsConfig.cmake
@@ -59,7 +59,7 @@
 # TubeTK Parameter Serializer snapshot 2013-08-21 11:14:41
 set( ParameterSerializer_URL
   ${github_protocol}://github.com/TubeTK/TubeTK-ParameterSerializer.git )
-set( ParameterSerializer_HASH_OR_TAG 819e3f6df97ab385f8c7b09203c07aa2fa56ade0 )
+set( ParameterSerializer_HASH_OR_TAG 2dce11a61af383780d6be67950e850a8e089cd90 )

 # Slicer Execution Model (TubeTK fork) snapshot 2013-08-05 10:16:50
 set( SlicerExecutionModel_URL


Update External_freetype.cmake

Update External_freetype.cmake

--- SuperBuild/CMake/External_freetype.cmake
+++ SuperBuild/CMake/External_freetype.cmake
@@ -30,7 +30,7 @@

 ExternalProject_Add(FREETYPE
   PREFIX FREETYPE
-  URL "https://download.savannah.gnu.org/releases/freetype/freetype-2.6.tar.gz"
+  URL "https://download.savannah.gnu.org/releases/freetype/freetype-old/freetype-2.6.tar.gz"
   URL_MD5 1d733ea6c1b7b3df38169fbdbec47d2b
   BINARY_DIR ${FREETYPE_SB_BUILD_DIR}
   INSTALL_DIR ${SB_INSTALL_PREFIX}


Adding missing api source files.  https://tracker.physiomeproject.org/show_bug.cgi?id=2648

git-svn-id: 4705079bc6b8aadf675e3696f5c015a6aa4916e3@8085 3c1deb5b-d424-0410-962d-aba41a686d42

--- source/cmake/api_source_files.cmake
+++ source/cmake/api_source_files.cmake
@@ -3,8 +3,8 @@

 SET( API_SRCS
 	source/api/cmiss_context.c
+	source/api/cmiss_core.c
 	source/api/cmiss_element.c
-	source/api/cmiss_graphics_window.c
 	source/api/cmiss_field.c
 	source/api/cmiss_graphic.c
 	source/api/cmiss_graphics_window.c
@@ -13,6 +13,8 @@
 	source/api/cmiss_node.c
 	source/api/cmiss_region.c
 	source/api/cmiss_rendition.c
+	source/api/cmiss_scene_viewer.cpp
+	source/api/cmiss_texture.c
 	source/api/cmiss_time.c
 	source/api/cmiss_time_keeper.c
 	source/api/cmiss_time_sequence.c


more user friendly

more user friendly

--- BuildSetup.cmake
+++ BuildSetup.cmake
@@ -19,27 +19,42 @@
 SET( ILC_HOME "/afs/desy.de/group/it/ilcsoft/v01-01_beta"
     CACHE PATH "Path to ILC Software" FORCE )

+# CMake Modules Path
+SET( CMAKE_MODULE_PATH "${ILC_HOME}/CMakeModules/v01-00"
+    CACHE PATH "Path to CMake Modules" FORCE )
+
+#############################################################################
+# Java
+#############################################################################
+
+# If you don't want to use the java version automatically detected by cmake
+# you can define here what java to use
+
 # Path to Java
-SET( JAVA_HOME "${ILC_HOME}/java/1.5.0"
-    CACHE PATH "Path to Java" FORCE )
+#SET( JAVA_HOME "${ILC_HOME}/java/1.5.0"
+#    CACHE PATH "Path to Java" FORCE )
+
+# If you don't need lcio.jar you can set this to OFF
+#SET( INSTALL_JAR OFF CACHE BOOL "Set to OFF to skip build/install lcio.jar" FORCE )
+
+#############################################################################
+# CLHEP
+#############################################################################
+
+# Enable this for building LCIO with CLHEP
+#SET( BUILD_WITH "CLHEP" CACHE STRING "Build LCIO with these optional packages" FORCE )

 # Path to CLHEP
 SET( CLHEP_HOME "${ILC_HOME}/CLHEP/2.0.2.2"
     CACHE PATH "Path to CLHEP" FORCE )

-# CMake Modules Path
-SET( CMAKE_MODULE_PATH "${ILC_HOME}/CMakeModules/v01-00"
-    CACHE PATH "Path to CMake Modules" FORCE )
-
 #############################################################################
 # Project options
 #############################################################################

-#SET( BUILD_WITH "CLHEP" CACHE STRING "Build LCIO with these optional packages" FORCE )

 #SET( BUILD_SHARED_LIBS OFF CACHE BOOL "Set to OFF to build static libraries" FORCE )
 #SET( INSTALL_DOC OFF CACHE BOOL "Set to OFF to skip build/install Documentation" FORCE )
-#SET( INSTALL_JAR OFF CACHE BOOL "Set to OFF to skip build/install lcio.jar" FORCE )
 #SET( BUILD_LCIO_TESTJOBS ON CACHE BOOL "Set to ON to build LCIO testjobs" FORCE )
 #SET( BUILD_F77_TESTJOBS ON CACHE BOOL "Set to ON to build LCIO F77 testjobs" FORCE )


[cdash] move to own site (crash.0xdeadbabe.info)

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -2,6 +2,6 @@
 set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")

 set(CTEST_DROP_METHOD "http")
-set(CTEST_DROP_SITE "my.cdash.org")
+set(CTEST_DROP_SITE "cdash.0xdeadbabe.info")
 set(CTEST_DROP_LOCATION "/submit.php?project=nix")
 set(CTEST_DROP_SITE_CDASH TRUE)


Use the public dashboard URL

Use the public dashboard URL

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -2,6 +2,6 @@
 set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC")

 set(CTEST_DROP_METHOD     "http")
-set(CTEST_DROP_SITE       "www.kitware.com")
-set(CTEST_DROP_LOCATION   "/CDash/submit.php?project=sprokit")
+set(CTEST_DROP_SITE       "open.cdash.org")
+set(CTEST_DROP_LOCATION   "/submit.php?project=sprokit")
 set(CTEST_DROP_SITE_CDASH TRUE)


ditto.

ditto.

--- ModularDeps.cmake
+++ ModularDeps.cmake
@@ -40,7 +40,7 @@
   add_subdirectory("${PROJECT_SOURCE_DIR}/deps/${DEP_NAME}")

   # Mark the dependency as satisfied.
-  set(${DEP_NAME}_DEP_SATISFIED YES CACHE INTERNAL "${DEP_NAME} dependency.")
+  set(${DEP_NAME}_DEP_SATISFIED YES CACHE BOOL "${DEP_NAME} dependency.")
   mark_as_advanced(${DEP_NAME}_DEP_SATISFIED)
 endfunction()


Remove debug.

Remove debug.

--- ModularDeps.cmake
+++ ModularDeps.cmake
@@ -8,7 +8,6 @@
 set(DEPENDENCY_LIST)

 function(add_dependency DEP_NAME DEP_REPO)
-  message("dsdada: ${PROJECT_SOURCE_DIR}")
   # Determine if the dependency has already been added.
   set(DEP_INDEX)
   list(FIND DEPENDENCY_LIST "${DEP_NAME}" DEP_INDEX)


BUG: Update LSTK version to sync with VTK 6.0.

Update LSTK version to include new fixes
to sync LSTK with VTK6.0.

Change-Id: Ia641c2640df2bc56d3868cc2ba3a999fae097f2d

--- Modules/Remote/LesionSizingToolkit.remote.cmake
+++ Modules/Remote/LesionSizingToolkit.remote.cmake
@@ -1,5 +1,5 @@
 itk_fetch_module(LesionSizingToolkit
   "Framework for determining the sizes of lesions in medical images."
   GIT_REPOSITORY http://public.kitware.com/LesionSizingToolkit.git
-  GIT_TAG ac2b1a02e
+  GIT_TAG 60cc50ff7
   )