Skip to content

Commit

Permalink
Automatic version update in source files
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-f committed Sep 2, 2016
1 parent 8518cc4 commit 239d666
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.6)
CMAKE_MINIMUM_REQUIRED(VERSION 3.6.0)

# Maps to a solution file (isimpa.sln). The solution will
# have all targets (exe, lib, dll) as projects (.vcproj)
project (isimpa)
project (isimpa VERSION 1.3.1)

if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "${PROJECT_BINARY_DIR}/bin" CACHE PATH "default install path" FORCE )
Expand Down
11 changes: 7 additions & 4 deletions src/isimpa/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,8 @@ ADD_CUSTOM_COMMAND(
# Before using element_pywrap.cpp build enum_def.cpp
set_property(SOURCE data_manager/python_interface/py_ui_module/element_pywrap.cpp APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/enum_def.cpp)

configure_file(data_manager/appconfig_version.cpp.in ${CMAKE_CURRENT_BINARY_DIR}/generated/appconfig_version.cpp )

# Set Properties->General->Configuration Type to Application
# Creates isimpa with the listed sources
# Adds sources to the Solution Explorer
Expand All @@ -394,7 +396,8 @@ add_executable(isimpa
${MAIN_SOURCES}
${MANAGER_SOURCES}
${ISIMPA_SOURCES}
${CMAKE_CURRENT_BINARY_DIR}/enum_def.cpp)
${CMAKE_CURRENT_BINARY_DIR}/enum_def.cpp
${CMAKE_CURRENT_BINARY_DIR}/generated/appconfig_version.cpp)

# Creates a folder "executables" and adds target
# project (isimpa.vcproj) under it
Expand Down Expand Up @@ -506,9 +509,9 @@ SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "I-SIMPA")
SET(CPACK_PACKAGE_VENDOR "Ifsttar")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/DESCRIPTION.txt")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE.md")
SET(CPACK_PACKAGE_VERSION_MAJOR "1")
SET(CPACK_PACKAGE_VERSION_MINOR "3")
SET(CPACK_PACKAGE_VERSION_PATCH "0")
SET(CPACK_PACKAGE_VERSION_MAJOR ${isimpa_VERSION_MAJOR})
SET(CPACK_PACKAGE_VERSION_MINOR ${isimpa_VERSION_MINOR})
SET(CPACK_PACKAGE_VERSION_PATCH ${isimpa_VERSION_PATCH})
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "I-SIMPA")
IF(WIN32 AND NOT UNIX)
# There is a bug in NSI that does not handle full unix paths properly. Make
Expand Down
3 changes: 0 additions & 3 deletions src/isimpa/data_manager/appconfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,6 @@ const wxString ApplicationConfiguration::CONST_CORE_PATH=wxString("core") + wxFi
const wxString ApplicationConfiguration::CONST_PREPROCESS_EXE_PATH=ApplicationConfiguration::CONST_TETROOT_PATH+"tetgen"+wxFileName::GetPathSeparator();
const wxString ApplicationConfiguration::CONST_STATIC_XML_FILE="appconst.xml";
//const unsigned long ApplicationConfiguration::CONST_WORKINGLIMIT=1325329200;
const int ApplicationConfiguration::SPPS_UI_VERSION_MAJOR=1;
const int ApplicationConfiguration::SPPS_UI_VERSION_MINOR=3;
const int ApplicationConfiguration::SPPS_UI_VERSION_REVISION=0;



Expand Down
5 changes: 5 additions & 0 deletions src/isimpa/data_manager/appconfig_version.cpp.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include "data_manager/appconfig.h"

const int ApplicationConfiguration::SPPS_UI_VERSION_MAJOR=@isimpa_VERSION_MAJOR@;
const int ApplicationConfiguration::SPPS_UI_VERSION_MINOR=@isimpa_VERSION_MINOR@;
const int ApplicationConfiguration::SPPS_UI_VERSION_REVISION=@isimpa_VERSION_PATCH@;
4 changes: 2 additions & 2 deletions src/isimpa/main/i_simpa_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -886,14 +886,14 @@ void MainUiFrame::OnShowPreferenceTree(wxCommandEvent& event)
void MainUiFrame::OnShowAboutDialog(wxCommandEvent& event)
{
wxAboutDialogInfo aboutDlg;
aboutDlg.SetVersion(wxString::Format("2014 [%i.%i.%i]",ApplicationConfiguration::SPPS_UI_VERSION_MAJOR,ApplicationConfiguration::SPPS_UI_VERSION_MINOR,ApplicationConfiguration::SPPS_UI_VERSION_REVISION));
aboutDlg.SetVersion(wxString::Format("[%i.%i.%i]",ApplicationConfiguration::SPPS_UI_VERSION_MAJOR,ApplicationConfiguration::SPPS_UI_VERSION_MINOR,ApplicationConfiguration::SPPS_UI_VERSION_REVISION));
aboutDlg.SetName(APPLICATION_NAME);
aboutDlg.SetWebSite(wxT("http://i-simpa.ifsttar.fr"));
//aboutDlg.SetLicence(GetLicenseText());
aboutDlg.SetLicence("I-Simpa is an open source software (GPL v3).");
aboutDlg.AddDeveloper("Nicolas FORTIN (Ifsttar)");
aboutDlg.AddDeveloper("Judicaël PICAUT (Ifsttar)");
aboutDlg.SetCopyright("(c) 2014 - Ifsttar <i-simpa@ifsttar.fr>");
aboutDlg.SetCopyright("(c) Ifsttar <i-simpa@ifsttar.fr>");

//wxArraySting devs;
//devs.
Expand Down

0 comments on commit 239d666

Please # to comment.