diff --git a/CMakeLists.txt b/CMakeLists.txt index 522730b230..58b06f47af 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -117,7 +117,7 @@ check_find_package_result(Boost_FOUND "Boost") # 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 -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") @@ -129,11 +129,8 @@ include(${wxWidgets_USE_FILE}) include(MinGWResourceCompiler) # Automagically create version header file. -# does not work with mingw for me (jpc) -if(UNIX) - include(CreateSVNVersionHeader) - create_svn_version_header() -endif(UNIX) +include(CreateSVNVersionHeader) +create_svn_version_header() if(EXISTS ${CMAKE_SOURCE_DIR}/include/config.h) # This file may exist (created by an alternate process to the svn test above), diff --git a/CMakeModules/CreateSVNVersionHeader.cmake b/CMakeModules/CreateSVNVersionHeader.cmake index 9e4f718998..4ad9aa6d27 100644 --- a/CMakeModules/CreateSVNVersionHeader.cmake +++ b/CMakeModules/CreateSVNVersionHeader.cmake @@ -1,8 +1,44 @@ macro(create_svn_version_header) # Include Subversion support to automagically create version header file. find_package(Subversion) + 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 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 "/include/build_version.h". + if(Kicad_WC_LAST_CHANGED_DATE) string(REGEX REPLACE "^([0-9]+)\\-([0-9]+)\\-([0-9]+).*" "\\1\\2\\3" _kicad_svn_date ${Kicad_WC_LAST_CHANGED_DATE}) set(KICAD_SVN_VERSION @@ -21,5 +57,8 @@ macro(create_svn_version_header) # Generate config.h. configure_file(${CMAKE_SOURCE_DIR}/CMakeModules/config.h.cmake ${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) diff --git a/change_log.txt b/change_log.txt index 1f6d2b9b55..783fae2dc7 100644 --- a/change_log.txt +++ b/change_log.txt @@ -5,6 +5,16 @@ Started 2007-June-11 Please add newer entries at the top, list the date and your name with email address. +2008-Dec-02 UPDATE Wayne Stambaugh +================================================================================ +++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 ================================================================================ +eeschema