Commit bcbcdebf authored by stambaughw's avatar stambaughw
Browse files

Fix wxWidgets library find order and SVN create version header bugs.

parent 85d65db5
Loading
Loading
Loading
Loading
+3 −6
Original line number Original line Diff line number Diff line
@@ -117,7 +117,7 @@ check_find_package_result(Boost_FOUND "Boost")
# Here you can define what libraries of wxWidgets you need for your
# Here you can define what libraries of wxWidgets you need for your
# application. You can figure out what libraries you need here;
# application. You can figure out what libraries you need here;
# http://www.wxwidgets.org/manuals/2.8/wx_librarieslist.html
# http://www.wxwidgets.org/manuals/2.8/wx_librarieslist.html
find_package(wxWidgets COMPONENTS base core adv gl html net QUIET)
find_package(wxWidgets COMPONENTS gl html adv core net base QUIET)
check_find_package_result(wxWidgets_FOUND "wxWidgets")
check_find_package_result(wxWidgets_FOUND "wxWidgets")




@@ -129,11 +129,8 @@ include(${wxWidgets_USE_FILE})
include(MinGWResourceCompiler)
include(MinGWResourceCompiler)


# Automagically create version header file.
# Automagically create version header file.
# does not work with mingw for me (jpc)
if(UNIX)
include(CreateSVNVersionHeader)
include(CreateSVNVersionHeader)
create_svn_version_header()
create_svn_version_header()
endif(UNIX)


if(EXISTS ${CMAKE_SOURCE_DIR}/include/config.h)
if(EXISTS ${CMAKE_SOURCE_DIR}/include/config.h)
    # This file may exist (created by an alternate process to the svn test above),
    # This file may exist (created by an alternate process to the svn test above),
+41 −2
Original line number Original line Diff line number Diff line
macro(create_svn_version_header)
macro(create_svn_version_header)
    # Include Subversion support to automagically create version header file.
    # Include Subversion support to automagically create version header file.
    find_package(Subversion)
    find_package(Subversion)

    if(Subversion_FOUND)
    if(Subversion_FOUND)
        Subversion_WC_INFO(${PROJECT_SOURCE_DIR} Kicad)
        # Copied from the CMake module FindSubversion.cmake.  The default
        # version prevents generating the output files when the "svn info"
        # command fails.  Just fall back to using "build_version.h" for
        # the version strings.
        set(_Subversion_SAVED_LC_ALL "$ENV{LC_ALL}")
        set(ENV{LC_ALL} C)

        execute_process(
            COMMAND ${Subversion_SVN_EXECUTABLE} info ${PROJECT_SOURCE_DIR}
            OUTPUT_VARIABLE Kicad_WC_INFO
            ERROR_VARIABLE _svn_error
            RESULT_VARIABLE _svn_result
            OUTPUT_STRIP_TRAILING_WHITESPACE)

        if(NOT ${_svn_result} EQUAL 0)
            message(STATUS
                    "Using <build_version.h> for version string.")
        else(NOT ${_svn_result} EQUAL 0)
            string(REGEX REPLACE "^(.*\n)?URL: ([^\n]+).*"
                   "\\2" Kicad_WC_URL "${Kicad_WC_INFO}")
            string(REGEX REPLACE "^(.*\n)?Revision: ([^\n]+).*"
                   "\\2" Kicad_WC_REVISION "${Kicad_WC_INFO}")
            string(REGEX REPLACE "^(.*\n)?Last Changed Author: ([^\n]+).*"
                   "\\2" Kicad_WC_LAST_CHANGED_AUTHOR "${Kicad_WC_INFO}")
            string(REGEX REPLACE "^(.*\n)?Last Changed Rev: ([^\n]+).*"
                   "\\2" Kicad_WC_LAST_CHANGED_REV "${Kicad_WC_INFO}")
            string(REGEX REPLACE "^(.*\n)?Last Changed Date: ([^\n]+).*"
                   "\\2" Kicad_WC_LAST_CHANGED_DATE "${Kicad_WC_INFO}")
        endif(NOT ${_svn_result} EQUAL 0)

        set(ENV{LC_ALL} ${_Subversion_SAVED_LC_ALL})
    endif(Subversion_FOUND)

    # Check to make sure 'svn info' command did not fail.  Otherwise fallback
    # to vesion strings defined in "<kicad-src-dir>/include/build_version.h".
    if(Kicad_WC_LAST_CHANGED_DATE)
        string(REGEX REPLACE "^([0-9]+)\\-([0-9]+)\\-([0-9]+).*" "\\1\\2\\3"
        string(REGEX REPLACE "^([0-9]+)\\-([0-9]+)\\-([0-9]+).*" "\\1\\2\\3"
               _kicad_svn_date ${Kicad_WC_LAST_CHANGED_DATE})
               _kicad_svn_date ${Kicad_WC_LAST_CHANGED_DATE})
        set(KICAD_SVN_VERSION
        set(KICAD_SVN_VERSION
@@ -21,5 +57,8 @@ macro(create_svn_version_header)
        # Generate config.h.
        # Generate config.h.
        configure_file(${CMAKE_SOURCE_DIR}/CMakeModules/config.h.cmake
        configure_file(${CMAKE_SOURCE_DIR}/CMakeModules/config.h.cmake
                       ${CMAKE_BINARY_DIR}/config.h)
                       ${CMAKE_BINARY_DIR}/config.h)
    endif(Subversion_FOUND)

        message(STATUS "Kicad SVN version: ${KICAD_SVN_VERSION}")
        message(STATUS "Kicad about version: ${KICAD_ABOUT_VERSION}")
    endif(Kicad_WC_LAST_CHANGED_DATE)
endmacro(create_svn_version_header)
endmacro(create_svn_version_header)
+10 −0
Original line number Original line Diff line number Diff line
@@ -5,6 +5,16 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
Please add newer entries at the top, list the date and your name with
email address.
email address.


2008-Dec-02 UPDATE Wayne Stambaugh <stambaughw@verizon.net>
================================================================================
++build fixes
  * Changed wxWidgets library find order so monolithic build is no longer
    required (at least on MinGW).
  * Changed CreateSVNVersionHeader.cmake to fall back to "build_version.h"
    when 'svn info' command fails.  The default macro that ships with CMake
    will not create build files when 'svn info' fails.


2008-Nov-25 UPDATE Dick Hollenbeck <dick@softplc.com>
2008-Nov-25 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
================================================================================
+eeschema
+eeschema