]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
cmake: drop generation and usage of radiant version files
authorThomas Debesse <dev@illwieckz.net>
Sat, 3 Nov 2018 23:16:02 +0000 (00:16 +0100)
committerThomas Debesse <dev@illwieckz.net>
Sat, 18 May 2019 20:47:42 +0000 (22:47 +0200)
RADIANT_MAJOR etc.

CMakeLists.txt
radiant/main.cpp

index e920fd6216c4e3522bedc5814d6d51c012e91015..aada8ecd39cdcaca33526a4d2cb5c14172a16512 100644 (file)
@@ -20,10 +20,6 @@ set(NetRadiant_VERSION_MINOR 5)
 set(NetRadiant_VERSION_PATCH 0)
 set(NetRadiant_VERSION "${NetRadiant_VERSION_MAJOR}.${NetRadiant_VERSION_MINOR}.${NetRadiant_VERSION_PATCH}")
 
-file(WRITE "${PROJECT_BINARY_DIR}/RADIANT_MAJOR" ${NetRadiant_VERSION_MAJOR})
-file(WRITE "${PROJECT_BINARY_DIR}/RADIANT_MINOR" ${NetRadiant_VERSION_MINOR})
-file(WRITE "${PROJECT_BINARY_DIR}/RADIANT_PATCH" ${NetRadiant_VERSION_PATCH})
-
 set(RADIANT_ABOUTMSG "Custom build" CACHE STRING "About message")
 
 find_package(Git REQUIRED)
@@ -267,14 +263,6 @@ endif()
 # Install
 #-----------------------------------------------------------------------
 
-install(
-        FILES
-        "${PROJECT_BINARY_DIR}/RADIANT_MAJOR"
-        "${PROJECT_BINARY_DIR}/RADIANT_MINOR"
-        "${PROJECT_BINARY_DIR}/RADIANT_PATCH"
-        DESTINATION .
-)
-
 install(
         DIRECTORY
         setup/data/tools/
index cd328b3734b1666c405f2c1f13c6ea645402ad77..a9cde39cc2bd69fd1b9345beec185182a679b9e6 100644 (file)
@@ -362,39 +362,6 @@ bool check_version_file( const char* filename, const char* version ){
        return false;
 }
 
-bool check_version(){
-       // a safe check to avoid people running broken installations
-       // (otherwise, they run it, crash it, and blame us for not forcing them hard enough to pay attention while installing)
-       // make something idiot proof and someone will make better idiots, this may be overkill
-       // let's leave it disabled in debug mode in any case
-       // http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=431
-    if (GDEF_DEBUG) {
-        return true;
-    }
-    // locate and open RADIANT_MAJOR and RADIANT_MINOR
-    bool bVerIsGood = true;
-    {
-        StringOutputStream ver_file_name(256);
-        ver_file_name << AppPath_get() << "RADIANT_MAJOR";
-        bVerIsGood = check_version_file(ver_file_name.c_str(), RADIANT_MAJOR_VERSION);
-    }
-    {
-        StringOutputStream ver_file_name(256);
-        ver_file_name << AppPath_get() << "RADIANT_MINOR";
-        bVerIsGood = check_version_file(ver_file_name.c_str(), RADIANT_MINOR_VERSION);
-    }
-
-    if (!bVerIsGood) {
-        StringOutputStream msg(256);
-        msg
-                << "This editor binary (" RADIANT_VERSION ") doesn't match what the latest setup has configured in this directory\n"
-                        "Make sure you run the right/latest editor binary you installed\n"
-                << AppPath_get();
-        ui::alert(ui::root, msg.c_str(), "Radiant", ui::alert_type::OK, ui::alert_icon::Default);
-    }
-    return bVerIsGood;
-}
-
 void create_global_pid(){
        /*!
           the global prefs loading / game selection dialog might fail for any reason we don't know about
@@ -597,10 +564,6 @@ int main( int argc, char* argv[] ){
 
        paths_init();
 
-       if ( !check_version() ) {
-               return EXIT_FAILURE;
-       }
-
        show_splash();
 
        create_global_pid();