=== modified file 'CMakeLists.txt'
--- CMakeLists.txt	2016-01-11 09:13:13 +0000
+++ CMakeLists.txt	2016-01-13 23:20:40 +0000
@@ -60,6 +60,12 @@
 # when not defined by user, the default is python.exe under Windows and python2 for others
 # python binary file should be is exec path.
 
+# KICAD_SCRIPTING_MODULES requires KICAD_SCRIPTING enable it here if KICAD_SCRIPTING_MODULES is ON
+if ( KICAD_SCRIPTING_MODULES AND NOT KICAD_SCRIPTING )
+    message(STATUS "Changing KICAD_SCRIPTING to ON as needed by KICAD_SCRIPTING_MODULES")
+    set ( KICAD_SCRIPTING ON )
+endif()
+
 option( BUILD_GITHUB_PLUGIN "Build the GITHUB_PLUGIN for pcbnew." ON )
 
 
@@ -209,27 +215,7 @@
     set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-strict-aliasing" )
 
     if( APPLE )
-
-        set( CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -D__ASSERTMACROS__" )
-        set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__ASSERTMACROS__" )
-
-        # Allows .dylib relocation in the future - needed by fixbundle
-        set( CMAKE_LD_FLAGS "${CMAKE_LD_FLAGS} -headerpad_max_install_names")
-
-        if( NOT CMAKE_CXX_COMPILER )
-            EXEC_PROGRAM( wx-config ARGS --cc  OUTPUT_VARIABLE CMAKE_C_COMPILER )
-        endif()
-
-        if( NOT CMAKE_CXX_COMPILER )
-            EXEC_PROGRAM( wx-config ARGS --cxx OUTPUT_VARIABLE CMAKE_CXX_COMPILER )
-        endif()
-
-        # There seems to be no consistent behavior when -mmacosx-min-version is
-        # not specified, so force user to set minimum OSX version to build for
-        if( NOT CMAKE_OSX_DEPLOYMENT_TARGET )
-            message( FATAL_ERROR "Please specify target OS X version using -DCMAKE_OSX_DEPLOYMENT_TARGET=10.x" )
-        endif()
-
+        set( CMAKE_LD_FLAGS "${CMAKE_LD_FLAGS} -headerpad_max_install_names") # needed by fixbundle
     endif()
 
 endif( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
@@ -360,6 +346,11 @@
 
             set( \${default_embedded_path_var} \"\${path}\" PARENT_SCOPE )
         endfunction(gp_item_default_embedded_path_override)
+
+        # If `BU_CHMOD_BUNDLE_ITEMS` is not set, `install_name_tool` will fail to re-write some
+        # loader paths due to lack of writable permissions if the build dependencies were installed
+        # by brew (or didn't have writable permissions)
+        set ( BU_CHMOD_BUNDLE_ITEMS ON )
         "
         )
 endif()
@@ -487,7 +478,6 @@
 
 set( INC_AFTER
     ${Boost_INCLUDE_DIR}
-    #include <config.h>
     ${CMAKE_BINARY_DIR}
     )
 
@@ -590,12 +580,6 @@
     add_definitions( -DHAVE_SVN_REVISION )
 endif()
 
-
-#================================================
-# Let CMake look in these directories for nested
-# 'CMakeLists.txt' files to process
-#================================================
-
 if( APPLE )
     # Remove app bundles in ${KICAD_BIN} before installing anything new.
     # Must be defined before all includes so that it is executed first.
@@ -614,39 +598,10 @@
         )
 endif()
 
-############################
-# Binaries ( CMake targets ) #
-############################
-
-add_subdirectory( bitmaps_png )
-add_subdirectory( common )
-add_subdirectory( 3d-viewer )
-add_subdirectory( cvpcb )
-add_subdirectory( eeschema )
-add_subdirectory( gerbview )
-add_subdirectory( lib_dxf )
-add_subdirectory( pcbnew )
-add_subdirectory( polygon )
-add_subdirectory( pagelayout_editor )
-add_subdirectory( potrace )
-add_subdirectory( bitmap2component )
-add_subdirectory( pcb_calculator )
-add_subdirectory( kicad )               # should follow pcbnew, eeschema
-add_subdirectory( tools )
-add_subdirectory( utils )
-add_subdirectory( qa )
-
-#add_subdirectory( new )
-
-#############
-# Resources #
-#############
-add_subdirectory( demos )
-add_subdirectory( template )
-
 #================================================
 # Doxygen Output
 #================================================
+
 find_package( Doxygen )
 if( DOXYGEN_FOUND )
     add_custom_target( doxygen-docs
@@ -671,6 +626,18 @@
 configure_file( ${PROJECT_SOURCE_DIR}/CMakeModules/config.h.cmake
     ${CMAKE_BINARY_DIR}/config.h )
 
+###
+# Generate Map file
+###
+if( KICAD_MAKE_LINK_MAPS )
+    # Currently only works on linux/gcc
+    if( UNIX AND NOT APPLE )
+        set( MAKE_LINK_MAPS true )
+    else()
+        set( MAKE_LINK_MAPS false )
+    endif()
+endif()
+
 #================================================
 # "make uninstall" rules
 #================================================
@@ -740,7 +707,6 @@
 
 #include( CTest )
 
-
 if( UNIX AND NOT APPLE )
 
     # Create a *.deb file:
@@ -756,3 +722,31 @@
     include( CPack )
 
 endif()
+
+#================================================
+# Let CMake look in these directories for nested
+# 'CMakeLists.txt' files to process
+#================================================
+
+# Binaries ( CMake targets )
+add_subdirectory( bitmaps_png )
+add_subdirectory( common )
+add_subdirectory( 3d-viewer )
+add_subdirectory( cvpcb )
+add_subdirectory( eeschema )
+add_subdirectory( gerbview )
+add_subdirectory( lib_dxf )
+add_subdirectory( pcbnew )
+add_subdirectory( polygon )
+add_subdirectory( pagelayout_editor )
+add_subdirectory( potrace )
+add_subdirectory( bitmap2component )
+add_subdirectory( pcb_calculator )
+add_subdirectory( kicad )               # should follow pcbnew, eeschema
+add_subdirectory( tools )
+add_subdirectory( utils )
+add_subdirectory( qa )
+
+# Resources
+add_subdirectory( demos )
+add_subdirectory( template )

=== modified file 'cvpcb/CMakeLists.txt'
--- cvpcb/CMakeLists.txt	2016-01-06 07:36:08 +0000
+++ cvpcb/CMakeLists.txt	2016-01-13 22:35:49 +0000
@@ -1,11 +1,3 @@
-# the map generation creates on Windows/gcc a lot of useless warnings
-# so disable it on windows
-if( WIN32 AND NOT CMAKE_CROSSCOMPILING )
-    set( MAKE_LINK_MAPS false )
-else()
-    set( MAKE_LINK_MAPS true )
-endif()
-
 add_definitions( -DCVPCB )
 
 include_directories( BEFORE ${INC_BEFORE} )

=== modified file 'eeschema/CMakeLists.txt'
--- eeschema/CMakeLists.txt	2016-01-13 19:09:07 +0000
+++ eeschema/CMakeLists.txt	2016-01-13 22:35:49 +0000
@@ -1,14 +1,5 @@
-# the map generation creates on Windows/gcc a lot of useless warnings
-# so disable it on windows
-if( WIN32 AND NOT CMAKE_CROSSCOMPILING )
-    set( MAKE_LINK_MAPS false )
-else()
-    set( MAKE_LINK_MAPS true )
-endif()
-
 add_definitions( -DEESCHEMA )
 
-
 include_directories( BEFORE ${INC_BEFORE} )
 include_directories(
     ./dialogs
@@ -297,6 +288,7 @@
         DESTINATION ${KICAD_BIN}
         COMPONENT binary
         )
+
     install( CODE "
             # override default embedded path settings
             ${OSX_BUNDLE_OVERRIDE_PATHS}

=== modified file 'gerbview/CMakeLists.txt'
--- gerbview/CMakeLists.txt	2015-10-29 19:43:04 +0000
+++ gerbview/CMakeLists.txt	2016-01-13 22:35:49 +0000
@@ -1,11 +1,3 @@
-# the map generation creates on Windows/gcc a lot of useless warnings
-# so disable it on windows
-if( WIN32 AND NOT CMAKE_CROSSCOMPILING )
-    set( MAKE_LINK_MAPS false )
-else()
-    set( MAKE_LINK_MAPS true )
-endif()
-
 add_definitions(-DGERBVIEW)
 
 include_directories( BEFORE ${INC_BEFORE} )

=== modified file 'kicad/CMakeLists.txt'
--- kicad/CMakeLists.txt	2015-10-29 19:43:04 +0000
+++ kicad/CMakeLists.txt	2016-01-13 22:35:49 +0000
@@ -107,9 +107,6 @@
         # do all the work
         include( BundleUtilities )
 
-        # If `BU_CHMOD_BUNDLE_ITEMS` is not set, `install_name_tool` will fail to re-write some loader paths due to lack of writable permissions if the build dependencies were installed by brew (or didn't have writable permissions)
-        set(BU_CHMOD_BUNDLE_ITEMS ON)
-
         fixup_bundle( ${OSX_BUNDLE_INSTALL_BIN_DIR}/kicad
             \"\${BUNDLE_FIX_LIBS}\"
             \"\"

=== modified file 'pagelayout_editor/CMakeLists.txt'
--- pagelayout_editor/CMakeLists.txt	2015-10-29 19:43:04 +0000
+++ pagelayout_editor/CMakeLists.txt	2016-01-13 22:35:49 +0000
@@ -1,11 +1,3 @@
-# the map generation creates on Windows/gcc a lot of useless warnings
-# so disable it on windows
-if( WIN32 AND NOT CMAKE_CROSSCOMPILING )
-    set( MAKE_LINK_MAPS false )
-else()
-    set( MAKE_LINK_MAPS true )
-endif()
-
 add_definitions(-DPL_EDITOR)
 
 include_directories(BEFORE ${INC_BEFORE})

=== modified file 'pcbnew/CMakeLists.txt'
--- pcbnew/CMakeLists.txt	2016-01-10 21:44:37 +0000
+++ pcbnew/CMakeLists.txt	2016-01-13 22:35:49 +0000
@@ -1,12 +1,5 @@
-# the map generation creates on Windows/gcc a lot of useless warnings
-# so disable it on windows
-if( WIN32 AND NOT CMAKE_CROSSCOMPILING )
-    set( MAKE_LINK_MAPS false )
-else()
-    set( MAKE_LINK_MAPS true )
-endif()
-
 add_definitions( -DPCBNEW )
+
 add_subdirectory(router)
 
 # psnrouter depends on make_lexer outputs in common (bug # 1285878 )
@@ -455,7 +448,6 @@
 # Doxygen python documentation
 ###
 
-find_package( Doxygen )
 if( DOXYGEN_FOUND )
     if( KICAD_SCRIPTING )
 
@@ -491,8 +483,6 @@
             COMMENT "building doxygen docs into directory doxygen-python/html"
             )
     endif()
-else()
-    message( STATUS "WARNING: Doxygen not found - doxygen-docs (Source Docs) target not created" )
 endif()
 
 
@@ -694,18 +684,6 @@
         COMMENT "Fixing swig_import_helper in Kicad scripting modules"
         )
 
-    if( NOT APPLE )
-        install( FILES ${CMAKE_BINARY_DIR}/pcbnew/pcbnew.py DESTINATION ${PYTHON_DEST} )
-    else()
-        # put everything into bundle at build time, it is relocated at install
-        add_custom_target( ScriptingModulesPcbnewPyCopy ALL
-            COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_BINARY_DIR}/pcbnew/pcbnew.py" "${PYTHON_DEST}/"
-            DEPENDS FixSwigImportsModuleScripting
-            COMMENT "Copying pcbnew.py into ${PYTHON_DEST}"
-            )
-        add_dependencies( ScriptingModulesPcbnewPyCopy ScriptingWxpythonCopy )
-    endif()
-
     if( MINGW )
         install( FILES ${CMAKE_BINARY_DIR}/pcbnew/_pcbnew.pyd DESTINATION ${PYTHON_DEST} )
     elseif( APPLE )

=== modified file 'tools/CMakeLists.txt'
--- tools/CMakeLists.txt	2014-07-07 19:49:14 +0000
+++ tools/CMakeLists.txt	2016-01-13 22:35:49 +0000
@@ -1,47 +1,4 @@
 
-set( MAKE_LINK_MAPS true )
-
-if( 0 )
-
-    project(kicad-tools)
-
-    cmake_minimum_required( VERSION 2.8 FATAL_ERROR )
-
-    set( PROJECT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../ )
-
-    # message( "PROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR}" )
-
-    # Path to local CMake modules.
-    set( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules )
-
-    include( CheckFindPackageResult )
-
-    ##########################
-    # Find wxWidgets library #
-    ##########################
-    # Here you can define what libraries of wxWidgets you need for your
-    # application. You can figure out what libraries you need here;
-    # http://www.wxwidgets.org/manuals/2.8/wx_librarieslist.html
-
-    # On Apple only wxwidgets 2.9 or higher doesn't need to find aui part of base
-    if(APPLE)
-        find_package(wxWidgets COMPONENTS gl adv html core net base xml QUIET)
-    else(APPLE)
-        find_package(wxWidgets COMPONENTS gl aui adv html core net base xml QUIET)
-    endif(APPLE)
-    check_find_package_result(wxWidgets_FOUND "wxWidgets")
-
-
-    # Include wxWidgets macros.
-    include(${wxWidgets_USE_FILE})
-
-    # make config.h
-    include( PerformFeatureChecks )
-    perform_feature_checks()
-
-
-endif()
-
 include_directories(
     ${PROJECT_SOURCE_DIR}/include
     ${PROJECT_SOURCE_DIR}/pcbnew
@@ -77,4 +34,3 @@
 target_link_libraries( property_tree
     ${wxWidgets_LIBRARIES}
     )
-

