From f39ea05cace432c94f137e28dff24fae43ca45eb Mon Sep 17 00:00:00 2001 From: shun-iwasawa Date: Dec 28 2018 02:15:09 +0000 Subject: Remove Version Numbers from File Names (#2410) * remove version numbers from file names * update plist and systemvar for osx * modify appveyor script --- diff --git a/appveyor.yml b/appveyor.yml index 2b03c64..395c875 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 1.2.0.{build} +version: 1.2.1.{build} pull_requests: do_not_increment_build_number: true skip_tags: true @@ -33,7 +33,7 @@ build: verbosity: minimal after_build: - cmd: >- - C:\Qt\5.9\msvc2015_64\bin\windeployqt.exe %CONFIGURATION%\OpenToonz_1.2.exe + C:\Qt\5.9\msvc2015_64\bin\windeployqt.exe %CONFIGURATION%\OpenToonz.exe copy /Y ..\..\thirdparty\glut\3.7.6\lib\glut64.dll %CONFIGURATION% @@ -48,5 +48,5 @@ after_build: copy /Y ..\..\thirdparty\libmypaint\dist\64\libmypaint-1-4-0.dll %CONFIGURATION% artifacts: - path: toonz\$(PLATFORM)\$(CONFIGURATION) - name: OpenToonz_1.2 + name: OpenToonz diff --git a/doc/how_to_build_linux.md b/doc/how_to_build_linux.md index 5b004ea..3875b22 100644 --- a/doc/how_to_build_linux.md +++ b/doc/how_to_build_linux.md @@ -171,7 +171,7 @@ If you need to debug the application, you should be able to use `cmake -DCMAKE_B You can now run the application: ``` -$ LD_LIBRARY_PATH=./lib/opentoonz:$LD_LIBRARY_PATH ./bin/OpenToonz_1.2 +$ LD_LIBRARY_PATH=./lib/opentoonz:$LD_LIBRARY_PATH ./bin/OpenToonz ``` ### Performing a System Installation diff --git a/doc/how_to_build_macosx.md b/doc/how_to_build_macosx.md index 1f443eb..591d4c8 100644 --- a/doc/how_to_build_macosx.md +++ b/doc/how_to_build_macosx.md @@ -39,10 +39,10 @@ git lfs pull ### (Optional) Create the stuff Directory -If the directory `/Applications/OpenToonz/OpenToonz_1.2_stuff` does not exist, enter the following command: +If the directory `/Applications/OpenToonz/OpenToonz_stuff` does not exist, enter the following command: ``` -$ sudo cp -r stuff /Applications/OpenToonz/OpenToonz_1.2_stuff +$ sudo cp -r stuff /Applications/OpenToonz/OpenToonz_stuff ``` ### 3. Build tiff in thirdparty @@ -86,5 +86,5 @@ Please be patient as the install will take a while. ### After Building ``` -$ open ./toonz/OpenToonz_1.2.app +$ open ./toonz/OpenToonz.app ``` diff --git a/doc/how_to_build_macosx_ja.md b/doc/how_to_build_macosx_ja.md index f0f1ad6..3df0f22 100644 --- a/doc/how_to_build_macosx_ja.md +++ b/doc/how_to_build_macosx_ja.md @@ -29,10 +29,10 @@ $ git clone https://github.com/opentoonz/opentoonz ### stuff ディレクトリの設置 (任意) -`/Applications/OpenToonz/OpenToonz_1.2_stuff` というディレクトリが存在していない場合は以下のコマンド等でリポジトリのひな形を設置する必要があります。 +`/Applications/OpenToonz/OpenToonz_stuff` というディレクトリが存在していない場合は以下のコマンド等でリポジトリのひな形を設置する必要があります。 ``` -$ sudo cp -r opentoonz/stuff /Applications/OpenToonz/OpenToonz_1.2_stuff +$ sudo cp -r opentoonz/stuff /Applications/OpenToonz/OpenToonz_stuff ``` ### thirdparty 下の tiff をビルド @@ -67,5 +67,5 @@ $ make ### 完成 ``` -$ open ./toonz/OpenToonz_1.2.app +$ open ./toonz/OpenToonz.app ``` diff --git a/doc/how_to_build_win.md b/doc/how_to_build_win.md index fa00eb0..fd29505 100644 --- a/doc/how_to_build_win.md +++ b/doc/how_to_build_win.md @@ -74,8 +74,8 @@ Rename the following files: ### Setting Up the Program's Path 1. Copy the entire contents of `$opentoonz/toonz/build/Release` to an appropriate folder. -2. Open a Command Prompt and navigate to `QT_DIR/msvc2015_64/bin`. Run the Qt program `windeployqt.exe` with the path for `OpenToonz_1.2.exe` as an argument. - - The necessary Qt library files should be in the same folder as `OpenToonz_1.2.exe` +2. Open a Command Prompt and navigate to `QT_DIR/msvc2015_64/bin`. Run the Qt program `windeployqt.exe` with the path for `OpenToonz.exe` as an argument. + - The necessary Qt library files should be in the same folder as `OpenToonz.exe` - These include: - `Qt5Core.dll` - `Qt5Gui.dll` @@ -86,7 +86,7 @@ Rename the following files: - `Qt5Svg.dll` - `Qt5Widgets.dll` - `Qt5Multimedia.dll` - - These files should be in the corresponding folders in the same folder `OpenToonz_1.2.exe` + - These files should be in the corresponding folders in the same folder `OpenToonz.exe` - `/bearer/qgenericbearer.dll` - `/bearer/qnativewifibearer.dll` - `/iconengines/qsvgicon.dll` @@ -102,11 +102,11 @@ Rename the following files: - `/imageformats/qwebp.dll` - `/platforms/qwindows.dll` -3. Copy the following files to the same folder as `OpenToonz_1.2.exe` +3. Copy the following files to the same folder as `OpenToonz.exe` - `$opentoonz/thirdparty/glut/3.7.6/lib/glut64.dll` - `$opentoonz/thirdparty/glew/glew-1.9.0/bin/64bit/glew32.dll` -4. Copy the `srv` folder from the previous OpenToonz installation to the same folder as `OpenToonz_1.2.exe` +4. Copy the `srv` folder from the previous OpenToonz installation to the same folder as `OpenToonz.exe` - If there is no `srv` folder, OpenToonz can still be used. However, various file formats such as `mov` cannot be used. - Creating the files for `srv` is discussed later. @@ -117,13 +117,13 @@ If a previous binary of OpenToonz was already installed, this step and the follo ### Creating Registry Keys 1. Using the registry editor, create the following key and copy the path of the `$opentoonz/stuff` folder from above to it. - - HKEY_LOCAL_MACHINE\SOFTWARE\OpenToonz\OpenToonz\1.2\TOONZROOT + - HKEY_LOCAL_MACHINE\SOFTWARE\OpenToonz\OpenToonz\TOONZROOT ### Running -`OpenToonz_1.2.exe` can now be run. Congratulations! +`OpenToonz.exe` can now be run. Congratulations! ## Debugging -1. In the Solution Explorer, select the OpenToonz_1.2 project within the OpenToonz solution. +1. In the Solution Explorer, select the OpenToonz project within the OpenToonz solution. 2. In the Project menu, choose Set as StartUp Project. ## Creating the Files for the `srv` Folder diff --git a/doc/how_to_build_win_ja.md b/doc/how_to_build_win_ja.md index 0214fd4..6985438 100644 --- a/doc/how_to_build_win_ja.md +++ b/doc/how_to_build_win_ja.md @@ -64,12 +64,12 @@ Visual Studio 2015 と Qt 5.9 でビルドできることを確認していま� ## 実行 ### 実行可能ファイルなどの配置 1. `$oepntoonz/toonz/build/Release` の中身を適当なフォルダにコピーします -2. `OpenToonz_1.2.exe` のパスを引数にして Qt に付属の `windeployqt.exe` を実行します - - 必要な Qt のライブラリなどが `OpenToonz_1.2.exe` と同じフォルダに集められます -3. 下記のファイルを `OpenToonz_1.2.exe` と同じフォルダにコピーします +2. `OpenToonz.exe` のパスを引数にして Qt に付属の `windeployqt.exe` を実行します + - 必要な Qt のライブラリなどが `OpenToonz.exe` と同じフォルダに集められます +3. 下記のファイルを `OpenToonz.exe` と同じフォルダにコピーします - `$opentoonz/thirdparty/glut/3.7.6/lib/glut64.dll` - `$opentoonz/thirdparty/glew/glew-1.9.0/bin/64bit/glew32.dll` -4. バイナリ版の OpenToonz のインストール先にある `srv` フォルダを `OpenToonz_1.2.exe` と同じフォルダにコピーします +4. バイナリ版の OpenToonz のインストール先にある `srv` フォルダを `OpenToonz.exe` と同じフォルダにコピーします - `srv` が無くても OpenToonz は動作しますが、 mov 形式などに対応できません - `srv` 内のファイルの生成方法は後述します @@ -80,10 +80,10 @@ Visual Studio 2015 と Qt 5.9 でビルドできることを確認していま� ### レジストリキーの作成 1. レジストリエディタで下記のキーを作成し、 Stuff フォルダの作成でコピーした stuff フォルダのパスを記載します - - HKEY_LOCAL_MACHINE\SOFTWARE\OpenToonz\OpenToonz\1.2\TOONZROOT + - HKEY_LOCAL_MACHINE\SOFTWARE\OpenToonz\OpenToonz\TOONZROOT ### 実行 -OpenToonz_1.2.exe を実行して動作すれば成功です。おめでとうございます。 +OpenToonz.exe を実行して動作すれば成功です。おめでとうございます。 ## `srv` フォルダ内のファイルの生成 OpenToonz は QuickTime SDK を用いて mov 形式などへ対応しています。 QuickTime SDK は 32 ビット版しかないため、 `t32bitsrv.exe` という 32 ビット版の実行可能ファイルにQuickTime SDKを組み込み、64ビット版の OpenToonz は `t32bitsrv.exe` を経由して QuickTime SDK の機能を使用しています。以下の手順では `t32bitsrv.exe` などと合わせて、 32 ビット版の OpenToonz も生成されます。 diff --git a/toonz/cmake/BundleInfo.plist.in b/toonz/cmake/BundleInfo.plist.in index f4bb670..59a4388 100644 --- a/toonz/cmake/BundleInfo.plist.in +++ b/toonz/cmake/BundleInfo.plist.in @@ -5,7 +5,7 @@ CFBundleDevelopmentRegion English CFBundleExecutable - OpenToonz_1.2 + OpenToonz CFBundleGetInfoString CFBundleIconFile diff --git a/toonz/install/SystemVar.ini b/toonz/install/SystemVar.ini index f21022e..0301d50 100644 --- a/toonz/install/SystemVar.ini +++ b/toonz/install/SystemVar.ini @@ -1,11 +1,11 @@ [General] -TOONZCACHEROOT="/Applications/OpenToonz/OpenToonz_1.2_stuff/cache" -TOONZCONFIG="/Applications/OpenToonz/OpenToonz_1.2_stuff/config" -TOONZFXPRESETS="/Applications/OpenToonz/OpenToonz_1.2_stuff/fxs" -TOONZLIBRARY="/Applications/OpenToonz/OpenToonz_1.2_stuff/library" -TOONZPROFILES="/Applications/OpenToonz/OpenToonz_1.2_stuff/profiles" -OpenToonzPROFILES="/Applications/OpenToonz/OpenToonz_1.2_stuff/profiles" -TOONZPROJECTS="/Applications/OpenToonz/OpenToonz_1.2_stuff/projects" -TOONZROOT="/Applications/OpenToonz/OpenToonz_1.2_stuff" -OPENTOONZROOT="/Applications/OpenToonz/OpenToonz_1.2_stuff" -TOONZSTUDIOPALETTE="/Applications/OpenToonz/OpenToonz_1.2_stuff/studiopalette" +TOONZCACHEROOT="/Applications/OpenToonz/OpenToonz_stuff/cache" +TOONZCONFIG="/Applications/OpenToonz/OpenToonz_stuff/config" +TOONZFXPRESETS="/Applications/OpenToonz/OpenToonz_stuff/fxs" +TOONZLIBRARY="/Applications/OpenToonz/OpenToonz_stuff/library" +TOONZPROFILES="/Applications/OpenToonz/OpenToonz_stuff/profiles" +OpenToonzPROFILES="/Applications/OpenToonz/OpenToonz_stuff/profiles" +TOONZPROJECTS="/Applications/OpenToonz/OpenToonz_stuff/projects" +TOONZROOT="/Applications/OpenToonz/OpenToonz_stuff" +OPENTOONZROOT="/Applications/OpenToonz/OpenToonz_stuff" +TOONZSTUDIOPALETTE="/Applications/OpenToonz/OpenToonz_stuff/studiopalette" diff --git a/toonz/sources/CMakeLists.txt b/toonz/sources/CMakeLists.txt index e7c0f08..662afbd 100644 --- a/toonz/sources/CMakeLists.txt +++ b/toonz/sources/CMakeLists.txt @@ -599,7 +599,7 @@ if(BUILD_ENV_APPLE) $ ) # add capability for retina displays - set_target_properties(OpenToonz_1.2 PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_SOURCE_DIR}/../cmake/BundleInfo.plist.in) + set_target_properties(OpenToonz PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_SOURCE_DIR}/../cmake/BundleInfo.plist.in) endif() if(BUILD_ENV_UNIXLIKE) diff --git a/toonz/sources/common/tapptools/tenv.cpp b/toonz/sources/common/tapptools/tenv.cpp index 47bb8af..05528cb 100644 --- a/toonz/sources/common/tapptools/tenv.cpp +++ b/toonz/sources/common/tapptools/tenv.cpp @@ -1,9 +1,8 @@ - - #include "tenv.h" #include "tsystem.h" #include "tconvert.h" #include "tfilepath_io.h" +#include "tversion.h" #include #include @@ -24,6 +23,7 @@ TOfflineGL::Imp *MacOfflineGenerator1(const TDimension &dim) { #include using namespace TEnv; +using namespace TVER; //========================================================= // @@ -40,9 +40,8 @@ const std::map systemPathMap{ class EnvGlobals { // singleton - std::string m_applicationName; + ToonzVersion m_version; std::string m_applicationVersion; - std::string m_applicationVersionWithoutRevision; std::string m_applicationFullName; std::string m_moduleName; std::string m_rootVarName; @@ -57,7 +56,10 @@ class EnvGlobals { // singleton // path values specified with command line arguments std::map m_argPathValues; - EnvGlobals() : m_stuffDir(0) { setWorkingDirectory(); } + EnvGlobals() : m_stuffDir(0) { + setWorkingDirectory(); + init(); + } public: ~EnvGlobals() { delete m_stuffDir; } @@ -74,10 +76,9 @@ public: QString settingsPath; #ifdef MACOSX - settingsPath = - QString::fromStdString(getApplicationName()) + QString("_") + - QString::fromStdString(getApplicationVersionWithoutRevision()) + - QString(".app") + QString("/Contents/Resources/SystemVar.ini"); + settingsPath = QString::fromStdString(getApplicationName()) + + QString(".app") + + QString("/Contents/Resources/SystemVar.ini"); #else /* Generic Unix */ // TODO: use QStandardPaths::ConfigLocation when we drop Qt4 settingsPath = QDir::homePath(); @@ -132,6 +133,13 @@ public: #endif } + TFilePath getSystemVarPathValue(std::string varName) { + // return if the path is registered by command line argument + std::string argVar = getArgPathValue(varName); + if (argVar != "") return TFilePath(argVar); + return TFilePath(getSystemVarValue(varName)); + } + TFilePath getStuffDir() { if (m_stuffDir) return *m_stuffDir; if (m_isPortable) @@ -153,31 +161,30 @@ public: profilesDir + "env" + (TSystem::getUserName().toStdString() + ".env"); } - void setApplication(std::string applicationName, - std::string applicationVersion, std::string revision) { - m_applicationName = applicationName; - m_applicationVersionWithoutRevision = applicationVersion; - if (!revision.empty()) { - m_applicationVersion = - m_applicationVersionWithoutRevision + "." + revision; + void init() { + if (m_version.getAppRevision() != 0) { + m_applicationVersion = m_version.getAppVersionString() + "." + + m_version.getAppRevisionString(); } else { - m_applicationVersion = m_applicationVersionWithoutRevision; + m_applicationVersion = m_version.getAppVersionString(); } - m_applicationFullName = m_applicationName + " " + m_applicationVersion; - m_moduleName = m_applicationName; - m_rootVarName = toUpper(m_applicationName) + "ROOT"; + + m_applicationFullName = m_version.getAppName() + " " + m_applicationVersion; + m_moduleName = m_version.getAppName(); + m_rootVarName = toUpper(m_version.getAppName()) + "ROOT"; #ifdef _WIN32 - m_registryRoot = TFilePath("SOFTWARE\\OpenToonz\\") + m_applicationName + - applicationVersion; + // from v1.3, registry root is moved to SOFTWARE\\OpenToonz\\OpenToonz + m_registryRoot = + TFilePath("SOFTWARE\\OpenToonz\\") + m_version.getAppName(); #endif - m_systemVarPrefix = m_applicationName; + m_systemVarPrefix = m_version.getAppName(); updateEnvFile(); } - std::string getApplicationName() { return m_applicationName; } + std::string getApplicationName() { return m_version.getAppName(); } std::string getApplicationVersion() { return m_applicationVersion; } std::string getApplicationVersionWithoutRevision() { - return m_applicationVersionWithoutRevision; + return m_version.getAppVersionString(); } TFilePath getEnvFile() { return m_envFile; } @@ -469,17 +476,6 @@ void Variable::assignValue(std::string value) { //=================================================================== -void TEnv::setApplication(std::string applicationName, - std::string applicationVersion, - std::string revision) { - EnvGlobals::instance()->setApplication(applicationName, applicationVersion, - revision); - -#ifdef LEVO_MACOSX - TOfflineGL::defineImpGenerator(MacOfflineGenerator1); -#endif -} - std::string TEnv::getApplicationName() { return EnvGlobals::instance()->getApplicationName(); } @@ -521,11 +517,7 @@ std::string TEnv::getSystemVarStringValue(std::string varName) { } TFilePath TEnv::getSystemVarPathValue(std::string varName) { - EnvGlobals *eg = EnvGlobals::instance(); - // return if the path is registered by command line argument - std::string argVar = eg->getArgPathValue(varName); - if (argVar != "") return TFilePath(argVar); - return TFilePath(eg->getSystemVarValue(varName)); + return EnvGlobals::instance()->getSystemVarPathValue(varName); } TFilePathSet TEnv::getSystemVarPathSetValue(std::string varName) { @@ -583,14 +575,6 @@ void TEnv::setStuffDir(const TFilePath &stuffDir) { EnvGlobals::instance()->setStuffDir(stuffDir); } -TFilePath TEnv::getDllRelativeDir() { - return EnvGlobals::instance()->getDllRelativeDir(); -} - -void TEnv::setDllRelativeDir(const TFilePath &dllRelativeDir) { - EnvGlobals::instance()->setDllRelativeDir(dllRelativeDir); -} - void TEnv::saveAllEnvVariables() { VariableSet::instance()->save(); } bool TEnv::setArgPathValue(std::string key, std::string value) { diff --git a/toonz/sources/include/tenv.h b/toonz/sources/include/tenv.h index 155044c..dc793e1 100644 --- a/toonz/sources/include/tenv.h +++ b/toonz/sources/include/tenv.h @@ -89,8 +89,6 @@ public: // // es.: TEnv::setApplication("Toonz","5.0"); // -DVAPI void setApplication(std::string applicationName, std::string version, - std::string revision = std::string()); DVAPI std::string getApplicationName(); DVAPI std::string getApplicationVersion(); @@ -137,9 +135,6 @@ DVAPI TFilePath getConfigDir(); // bisogna chiamare TEnv::setStuffDir(stuffdir) prima di ogni altra operazione DVAPI void setStuffDir(const TFilePath &stuffDir); -DVAPI TFilePath getDllRelativeDir(); -DVAPI void setDllRelativeDir(const TFilePath &dllRelativeDir); - DVAPI void saveAllEnvVariables(); // register command line argument paths. diff --git a/toonz/sources/tcleanupper/tcleanupper.cpp b/toonz/sources/tcleanupper/tcleanupper.cpp index a8f41fa..852163e 100644 --- a/toonz/sources/tcleanupper/tcleanupper.cpp +++ b/toonz/sources/tcleanupper/tcleanupper.cpp @@ -62,11 +62,8 @@ inline ostream &operator<<(ostream &out, const TFilePath &fp) { //------------------------------------------------------------------------ namespace { -const char *applicationName = "OpenToonz"; -const char *applicationVersion = "1.2"; -const char *applicationFullName = "OpenToonz 1.2"; -const char *rootVarName = "TOONZROOT"; -const char *systemVarPrefix = "TOONZ"; +const char *rootVarName = "TOONZROOT"; +const char *systemVarPrefix = "TOONZ"; namespace { @@ -492,8 +489,6 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); // questo definisce la registry root e inizializza TEnv - TEnv::setApplication(applicationName, applicationVersion); - TEnv::setApplicationFullName(applicationFullName); TEnv::setRootVarName(rootVarName); TEnv::setSystemVarPrefix(systemVarPrefix); TSystem::hasMainLoop(false); diff --git a/toonz/sources/tcomposer/tcomposer.cpp b/toonz/sources/tcomposer/tcomposer.cpp index be64744..f7fc944 100644 --- a/toonz/sources/tcomposer/tcomposer.cpp +++ b/toonz/sources/tcomposer/tcomposer.cpp @@ -103,11 +103,8 @@ namespace { // (es PROJECTS etc.) // -const char *applicationName = "OpenToonz"; -const char *applicationVersion = "1.2"; -const char *applicationFullName = "OpenToonz 1.2"; -const char *rootVarName = "TOONZROOT"; -const char *systemVarPrefix = "TOONZ"; +const char *rootVarName = "TOONZROOT"; +const char *systemVarPrefix = "TOONZ"; // TODO: forse anche questo andrebbe in tnzbase // ci possono essere altri programmi offline oltre al tcomposer @@ -603,8 +600,6 @@ int main(int argc, char *argv[]) { TThread::init(); // questo definisce la registry root e inizializza TEnv - TEnv::setApplication(applicationName, applicationVersion); - TEnv::setApplicationFullName(applicationFullName); TEnv::setRootVarName(rootVarName); TEnv::setSystemVarPrefix(systemVarPrefix); TSystem::hasMainLoop(true); diff --git a/toonz/sources/tconverter/tconverter.cpp b/toonz/sources/tconverter/tconverter.cpp index 8a71275..ede0a42 100644 --- a/toonz/sources/tconverter/tconverter.cpp +++ b/toonz/sources/tconverter/tconverter.cpp @@ -37,10 +37,8 @@ typedef QualifierT FilePathQualifier; #define RENDER_LICENSE_NOT_FOUND 888 -const char *applicationVersion = "1.2"; -const char *applicationName = "OpenToonz"; -const char *rootVarName = "TOONZROOT"; -const char *systemVarPrefix = "TOONZ"; +const char *rootVarName = "TOONZROOT"; +const char *systemVarPrefix = "TOONZ"; namespace { @@ -357,7 +355,6 @@ void convert(const TFilePath &source, const TFilePath &dest, //------------------------------------------------------------------------ int main(int argc, char *argv[]) { - TEnv::setApplication(applicationName, applicationVersion); TEnv::setRootVarName(rootVarName); TEnv::setSystemVarPrefix(systemVarPrefix); TFilePath fp = TEnv::getStuffDir(); diff --git a/toonz/sources/toonz/CMakeLists.txt b/toonz/sources/toonz/CMakeLists.txt index 13eec76..e7fcba1 100644 --- a/toonz/sources/toonz/CMakeLists.txt +++ b/toonz/sources/toonz/CMakeLists.txt @@ -365,11 +365,11 @@ endif() qt5_wrap_cpp(SOURCES ${MOC_HEADERS}) if(BUILD_ENV_MSVC) - add_executable(OpenToonz_${VERSION} WIN32 ${HEADERS} ${SOURCES} ${OBJCSOURCES} ${RESOURCES} ${RC_FILE}) + add_executable(OpenToonz WIN32 ${HEADERS} ${SOURCES} ${OBJCSOURCES} ${RESOURCES} ${RC_FILE}) else() set(MACOSX_BUNDLE_ICON_FILE "OpenToonz.icns") set_source_files_properties(OpenToonz.icns PROPERTIES MACOSX_PACKAGE_LOCATION "Resources") - add_executable(OpenToonz_${VERSION} MACOSX_BUNDLE OpenToonz.icns ${HEADERS} ${SOURCES} ${OBJCSOURCES} ${RESOURCES}) + add_executable(OpenToonz MACOSX_BUNDLE OpenToonz.icns ${HEADERS} ${SOURCES} ${OBJCSOURCES} ${RESOURCES}) #add_definitions( # -DTNZBASE_EXPORTS # -DTPARAM_EXPORTS @@ -414,7 +414,7 @@ if(BUILD_TARGET_WIN) endif() if(BUILD_ENV_MSVC) - target_link_libraries(OpenToonz_${VERSION} + target_link_libraries(OpenToonz Qt5::WinMain Qt5::Core Qt5::Gui Qt5::Network Qt5::OpenGL Qt5::Svg Qt5::Xml Qt5::Script Qt5::Widgets Qt5::PrintSupport Qt5::Multimedia ${GL_LIB} ${GLUT_LIB} strmiids @@ -428,9 +428,9 @@ elseif(BUILD_ENV_APPLE) # 変なところにライブラリ生成するカスども set(EXTRA_LIBS ${EXTRA_LIBS} "$" "$") - add_dependencies(OpenToonz_${VERSION} tnzcore tnzbase toonzlib colorfx tnzext image sound toonzqt tnztools tnzstdfx tfarm) + add_dependencies(OpenToonz tnzcore tnzbase toonzlib colorfx tnzext image sound toonzqt tnztools tnzstdfx tfarm) - target_link_libraries(OpenToonz_${VERSION} + target_link_libraries(OpenToonz Qt5::Core Qt5::Gui Qt5::Network Qt5::OpenGL Qt5::Svg Qt5::Xml Qt5::Script Qt5::Widgets Qt5::PrintSupport Qt5::Multimedia Qt5::MultimediaWidgets ${GL_LIB} ${GLUT_LIB} @@ -450,7 +450,7 @@ elseif(BUILD_ENV_UNIXLIKE) endif() target_link_libraries( - OpenToonz_${VERSION} Qt5::Core Qt5::Gui Qt5::Network Qt5::OpenGL Qt5::Svg Qt5::Xml + OpenToonz Qt5::Core Qt5::Gui Qt5::Network Qt5::OpenGL Qt5::Svg Qt5::Xml Qt5::Script Qt5::Widgets Qt5::PrintSupport Qt5::Multimedia ${GL_LIB} ${GLUT_LIB} ${GLU_LIB} ${EXTRA_LIBS} @@ -460,7 +460,7 @@ endif() if(BUILD_ENV_APPLE) # CMAKE_RUNTIME_OUTPUT_DIRECTORY should be equivalent to usage on windows despite empty # OSX だと CMAKE_RUNTIME_OUTPUT_DIRECTORY が空だが Windows 版と同じ使い方ができるようにしておく - get_target_property(bin OpenToonz_${VERSION} LOCATION) + get_target_property(bin OpenToonz LOCATION) get_filename_component(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${bin} DIRECTORY) # show CMAKE_RUNTIME_OUTPUT_DIRECTORY message("CMAKE_RUNTIME_OUTPUT_DIRECTORY:" ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) @@ -468,44 +468,44 @@ endif() # copy utilty executables onto the directory after build if(LZODRIVER_FOUND) - add_custom_command(TARGET OpenToonz_${VERSION} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} DEPENDS lzocompress) - add_custom_command(TARGET OpenToonz_${VERSION} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} DEPENDS lzodecompress) + add_custom_command(TARGET OpenToonz POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} DEPENDS lzocompress) + add_custom_command(TARGET OpenToonz POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} DEPENDS lzodecompress) endif() if(BUILD_ENV_APPLE) - get_target_property(loc OpenToonz_${VERSION} MACOSX_BUNDLE_NAME) + get_target_property(loc OpenToonz MACOSX_BUNDLE_NAME) message(" ==> App Bundle: " ${loc}) message(" ==> Mach-o: " ${bin}) foreach(lib ${EXTRA_LIBS}) - message(" copy:" ${lib} "==>" ${CMAKE_CURRENT_BINARY_DIR}/OpenToonz_${VERSION}.app/Contents/MacOS/) - add_custom_command(TARGET OpenToonz_${VERSION} POST_BUILD COMMAND cp ${lib} ${CMAKE_CURRENT_BINARY_DIR}/OpenToonz_${VERSION}.app/Contents/MacOS/) + message(" copy:" ${lib} "==>" ${CMAKE_CURRENT_BINARY_DIR}/OpenToonz.app/Contents/MacOS/) + add_custom_command(TARGET OpenToonz POST_BUILD COMMAND cp ${lib} ${CMAKE_CURRENT_BINARY_DIR}/OpenToonz.app/Contents/MacOS/) endforeach() - add_custom_command(TARGET OpenToonz_${VERSION} + add_custom_command(TARGET OpenToonz POST_BUILD COMMAND ${CMAKE_INSTALL_NAME_TOOL} -add_rpath @executable_path/. ${bin} ) - add_custom_command(TARGET OpenToonz_${VERSION} + add_custom_command(TARGET OpenToonz POST_BUILD COMMAND ${CMAKE_INSTALL_NAME_TOOL} -add_rpath ${CMAKE_INSTALL_RPATH} ${bin} ) - add_custom_command(TARGET OpenToonz_${VERSION} POST_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/OpenToonz_${VERSION}.app/Contents/Resources) + add_custom_command(TARGET OpenToonz POST_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/OpenToonz.app/Contents/Resources) - add_custom_command(TARGET OpenToonz_${VERSION} POST_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/OpenToonz_${VERSION}.app/Contents/Resources) - add_custom_command(TARGET OpenToonz_${VERSION} POST_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/qss) - add_custom_command(TARGET OpenToonz_${VERSION} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/../install/SystemVar.ini ${CMAKE_CURRENT_BINARY_DIR}/OpenToonz_${VERSION}.app/Contents/Resources) + add_custom_command(TARGET OpenToonz POST_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/OpenToonz.app/Contents/Resources) + add_custom_command(TARGET OpenToonz POST_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/qss) + add_custom_command(TARGET OpenToonz POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/../install/SystemVar.ini ${CMAKE_CURRENT_BINARY_DIR}/OpenToonz.app/Contents/Resources) - add_custom_command(TARGET OpenToonz_${VERSION} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} DEPENDS tcomposer) - add_custom_command(TARGET OpenToonz_${VERSION} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} DEPENDS tcleanup) - add_custom_command(TARGET OpenToonz_${VERSION} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} DEPENDS tconverter) - add_custom_command(TARGET OpenToonz_${VERSION} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} DEPENDS tfarmcontroller) - add_custom_command(TARGET OpenToonz_${VERSION} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} DEPENDS tfarmserver) + add_custom_command(TARGET OpenToonz POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} DEPENDS tcomposer) + add_custom_command(TARGET OpenToonz POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} DEPENDS tcleanup) + add_custom_command(TARGET OpenToonz POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} DEPENDS tconverter) + add_custom_command(TARGET OpenToonz POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} DEPENDS tfarmcontroller) + add_custom_command(TARGET OpenToonz POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} DEPENDS tfarmserver) elseif(BUILD_ENV_UNIXLIKE AND BUILD_TARGET_WIN) # Setup files on Windows platform while cross compilation. install( TARGETS - OpenToonz_${VERSION} + OpenToonz DESTINATION bin ) @@ -559,7 +559,7 @@ elseif(BUILD_ENV_UNIXLIKE AND NOT BUILD_TARGET_WIN) # - /usr install( TARGETS - OpenToonz_${VERSION} + OpenToonz DESTINATION bin ) @@ -603,7 +603,7 @@ fi export LD_LIBRARY_PATH=\${OPENTOONZ_BASE}/lib/opentoonz:\${LD_LIBRARY_PATH} -exec \$OPENTOONZ_BASE/bin/OpenToonz_${VERSION} \"\$@\" +exec \$OPENTOONZ_BASE/bin/OpenToonz \"\$@\" ") # only needed for executing without installing execute_process(COMMAND chmod +x ${CMAKE_BINARY_DIR}/bin/opentoonz) diff --git a/toonz/sources/toonz/main.cpp b/toonz/sources/toonz/main.cpp index 35f7291..8fb85fe 100644 --- a/toonz/sources/toonz/main.cpp +++ b/toonz/sources/toonz/main.cpp @@ -92,17 +92,10 @@ TEnv::IntVar EnvSoftwareCurrentFontSize("SoftwareCurrentFontSize", 12); const char *applicationFullName = "LineTest 6.4 Beta"; const char *rootVarName = "LINETESTROOT"; const char *systemVarPrefix = "LINETEST"; -#else -const char *applicationName = "OpenToonz"; -const char *applicationVersion = "1.2"; -const char *applicationRevision = "1"; -const char *dllRelativePath = "./toonz6.app/Contents/Frameworks"; #endif TEnv::IntVar EnvSoftwareCurrentFontSize("SoftwareCurrentFontSize", 12); -const char *applicationFullName = - "OpenToonz 1.2.1"; // next will be 1.3 (not 1.3.0) const char *rootVarName = "TOONZROOT"; const char *systemVarPrefix = "TOONZ"; @@ -118,9 +111,10 @@ void qt_mac_set_menubar_merge(bool enable); static void fatalError(QString msg) { DVGui::MsgBoxInPopup( - CRITICAL, msg + "\n" + - QObject::tr("Installing %1 again could fix the problem.") - .arg(applicationFullName)); + CRITICAL, + msg + "\n" + + QObject::tr("Installing %1 again could fix the problem.") + .arg(QString::fromStdString(TEnv::getApplicationFullName()))); exit(0); } //----------------------------------------------------------------------------- @@ -157,12 +151,8 @@ DV_IMPORT_API void initColorFx(); */ static void initToonzEnv(QHash &argPathValues) { StudioPalette::enable(true); - - TEnv::setApplication(applicationName, applicationVersion, - applicationRevision); TEnv::setRootVarName(rootVarName); TEnv::setSystemVarPrefix(systemVarPrefix); - TEnv::setDllRelativeDir(TFilePath(dllRelativePath)); QHash::const_iterator i = argPathValues.constBegin(); while (i != argPathValues.constEnd()) { @@ -175,9 +165,8 @@ static void initToonzEnv(QHash &argPathValues) { QCoreApplication::setOrganizationName("OpenToonz"); QCoreApplication::setOrganizationDomain(""); - QString fullApplicationNameQStr = - QString(applicationName) + " " + applicationVersion; - QCoreApplication::setApplicationName(fullApplicationNameQStr); + QCoreApplication::setApplicationName( + QString::fromStdString(TEnv::getApplicationFullName())); /*-- TOONZROOTのPathの確認 --*/ // controllo se la xxxroot e' definita e corrisponde ad un folder esistente @@ -634,7 +623,7 @@ int main(int argc, char *argv[]) { QString currentStyle = Preferences::instance()->getCurrentStyleSheetPath(); a.setStyleSheet(currentStyle); - w.setWindowTitle(applicationFullName); + w.setWindowTitle(QString::fromStdString(TEnv::getApplicationFullName())); if (TEnv::getIsPortable()) { splash.showMessage(offsetStr + "Starting OpenToonz Portable ...", Qt::AlignCenter, Qt::white); diff --git a/toonz/sources/toonz/mainwindow.cpp b/toonz/sources/toonz/mainwindow.cpp index c20cc77..289f81a 100644 --- a/toonz/sources/toonz/mainwindow.cpp +++ b/toonz/sources/toonz/mainwindow.cpp @@ -57,8 +57,6 @@ #include #include -extern const char *applicationFullName; - TEnv::IntVar ViewCameraToggleAction("ViewCameraToggleAction", 1); TEnv::IntVar ViewTableToggleAction("ViewTableToggleAction", 1); TEnv::IntVar FieldGuideToggleAction("FieldGuideToggleAction", 0); @@ -493,7 +491,7 @@ void MainWindow::changeWindowTitle() { if (name.isEmpty()) name = tr("Untitled"); - name += " : " + QString::fromLatin1(applicationFullName); + name += " : " + QString::fromStdString(TEnv::getApplicationFullName()); setWindowTitle(name); }