diff --git a/src/openstudio_app/CMakeLists.txt b/src/openstudio_app/CMakeLists.txt index bdfffc1af..72ca9bcb7 100644 --- a/src/openstudio_app/CMakeLists.txt +++ b/src/openstudio_app/CMakeLists.txt @@ -218,10 +218,18 @@ elseif( UNIX ) add_custom_command(TARGET ${target_name} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${icudtl} $/ - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${qweb_resources} $/ - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${qweb_resources_100} $/ - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${qweb_resources_200} $/ ) + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/qt.conf $ + COMMAND ${CMAKE_COMMAND} -E make_directory $/resources/ + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${icudtl} $/resources/ + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${qweb_resources} $/resources/ + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${qweb_resources_100} $/resources/ + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${qweb_resources_200} $/resources/ + #COMMAND ${CMAKE_COMMAND} -E copy_directory ${QT_INSTALL_DIR}/translations $/translations/ + # Copying just one locale is enough to shut the annoying console warning... + COMMAND ${CMAKE_COMMAND} -E make_directory $/translations/ + COMMAND ${CMAKE_COMMAND} -E make_directory $/translations/qtwebengine_locales + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${QT_INSTALL_DIR}/translations/qtwebengine_locales/en-US.pak $/translations/qtwebengine_locales/ + ) # TODO: not sure if chrpath is needed add_custom_command(TARGET ${target_name} @@ -258,10 +266,18 @@ elseif( WIN32 ) add_custom_command(TARGET ${target_name} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${icudtl} $/ - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${qweb_resources} $/ - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${qweb_resources_100} $/ - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${qweb_resources_200} $/ ) + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/qt.conf $ + COMMAND ${CMAKE_COMMAND} -E make_directory $/resources/ + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${icudtl} $/resources/ + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${qweb_resources} $/resources/ + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${qweb_resources_100} $/resources/ + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${qweb_resources_200} $/resources/ + #COMMAND ${CMAKE_COMMAND} -E copy_directory ${QT_INSTALL_DIR}/translations $/translations/ + # Copying just one locale is enough to shut the annoying console warning... + COMMAND ${CMAKE_COMMAND} -E make_directory $/translations/ + COMMAND ${CMAKE_COMMAND} -E make_directory $/translations/qtwebengine_locales + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${QT_INSTALL_DIR}/translations/qtwebengine_locales/en-US.pak $/translations/qtwebengine_locales/ + ) add_custom_command(TARGET ${target_name} POST_BUILD @@ -334,10 +350,15 @@ endif() # since on apple the whole app bundle is installed (including these webkit components) we can exclude apple if( NOT APPLE ) - install(FILES ${icudtl} DESTINATION bin COMPONENT OpenStudioApp ) - install(FILES ${qweb_resources} DESTINATION bin COMPONENT OpenStudioApp ) - install(FILES ${qweb_resources_100} DESTINATION bin COMPONENT OpenStudioApp ) - install(FILES ${qweb_resources_200} DESTINATION bin COMPONENT OpenStudioApp ) + + install(FILES $/qt.conf DESTINATION bin COMPONENT OpenStudioApp) + # install(DIRECTORY ${QT_INSTALL_DIR}/translations DESTINATION bin COMPONENT OpenStudioApp) + install(DIRECTORY $/translations/ DESTINATION bin/translations/ COMPONENT OpenStudioApp) + install(DIRECTORY $/resources/ DESTINATION bin/resources/ COMPONENT OpenStudioApp) + # install(FILES ${icudtl} DESTINATION bin/resources COMPONENT OpenStudioApp )/translatio + # install(FILES ${qweb_resources} DESTINATION bin/resources COMPONENT OpenStudioApp ) + # install(FILES ${qweb_resources_100} DESTINATION bin/resources COMPONENT OpenStudioApp ) + # install(FILES ${qweb_resources_200} DESTINATION bin/resources COMPONENT OpenStudioApp ) if(WIN32) install(TARGETS OpenStudioApp DESTINATION bin COMPONENT OpenStudioApp ) diff --git a/src/openstudio_app/main.cpp b/src/openstudio_app/main.cpp index f69056cd6..2043211f3 100644 --- a/src/openstudio_app/main.cpp +++ b/src/openstudio_app/main.cpp @@ -54,6 +54,7 @@ #include #include #include +#include #ifdef _WIN32 # include @@ -223,6 +224,11 @@ int main(int argc, char* argv[]) { // Make the run path the default plugin search location QCoreApplication::addLibraryPath(QCoreApplication::applicationDirPath()); + LOG_FREE(Info, "OpenStudioApp.main", "LibraryExecutablesPath: " + << openstudio::toString(QLibraryInfo::location(QLibraryInfo::LibraryExecutablesPath))); + LOG_FREE(Info, "OpenStudioApp.main", "DataPath: " << openstudio::toString(QLibraryInfo::location(QLibraryInfo::DataPath))); + LOG_FREE(Info, "OpenStudioApp.main", "TranslationsPath: " << openstudio::toString(QLibraryInfo::location(QLibraryInfo::TranslationsPath))); + #ifdef Q_OS_DARWIN // Gross but perhaps the simplest way to find the webengine process // Improvements are welcome. diff --git a/src/openstudio_app/qt.conf b/src/openstudio_app/qt.conf new file mode 100644 index 000000000..130f01159 --- /dev/null +++ b/src/openstudio_app/qt.conf @@ -0,0 +1,4 @@ +[Paths] +Resources = resources +Translations = translations +LibraryExecutables = .