# HG changeset patch
# User Miguel A. Figueroa-Villanueva <miguelf@ieee.org>
# Date 1267955449 14400
# Node ID 577c0f1c4e5a6df447dfa1f9e39485accc15e730
# Parent  61e7b54830c30730011ac76ad9241ed9be1af387
BUG #9419: Added wxWidgets_EXCLUDE_COMMON_LIBRARIES option.

This allows the user not to link to the common libraries,
which are regularly required. The user must specify all
libraries that he does want to link in the find_package
line (png tiff jpeg zlib regex expat).

diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake
--- a/Modules/FindwxWidgets.cmake
+++ b/Modules/FindwxWidgets.cmake
@@ -18,6 +18,10 @@
 #                            (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
@@ -213,8 +217,12 @@
     ENDIF(wxWidgets_USE_MONOLITHIC)
   ENDIF(NOT wxWidgets_FIND_COMPONENTS)
 
-  # Always add the common required libs.
-  LIST(APPEND wxWidgets_FIND_COMPONENTS ${wxWidgets_COMMON_LIBRARIES})
+  # 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(NOT wxWidgets_EXCLUDE_COMMON_LIBRARIES)
 
   #-------------------------------------------------------------------
   # WIN32: Helper MACROS
