Salome HOME
Copyright update 2020
[modules/shaper.git] / src / SHAPERGUI / CMakeLists.txt
index 1f7aa9f66e820e523e2b1beb0bf946255ec567f7..a3f1c93ee8a78b13fc4f960872ea3461570bdd6d 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library; if not, write to the Free Software
-## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-##
-## See http:##www.salome-platform.org/ or
-## email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2020  CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
 
 INCLUDE(UseQtExt)
 
@@ -26,6 +25,8 @@ INCLUDE_DIRECTORIES(${QT_INCLUDES})
 # additional preprocessor / compiler flags
 ADD_DEFINITIONS(${QT_DEFINITIONS})
 
+SET(UPDATE_TRANSLATION OFF)
+
 SET(PROJECT_HEADERS
     SHAPER_SHAPERGUI.h
     SHAPERGUI.h
@@ -33,7 +34,7 @@ SET(PROJECT_HEADERS
     SHAPERGUI_OCCSelector.h
     SHAPERGUI_SalomeViewer.h
     SHAPERGUI_NestedButton.h
-       SHAPERGUI_ToolbarsMgr.h
+    SHAPERGUI_ToolbarsMgr.h
 )
 
 SET(PROJECT_MOC_HEADERS
@@ -41,7 +42,7 @@ SET(PROJECT_MOC_HEADERS
     SHAPERGUI_DataModel.h
     SHAPERGUI_NestedButton.h
     SHAPERGUI_SalomeViewer.h
-       SHAPERGUI_ToolbarsMgr.h
+    SHAPERGUI_ToolbarsMgr.h
 )
 
 # sources / moc wrappings
@@ -53,15 +54,33 @@ SET(PROJECT_SOURCES
     SHAPERGUI_OCCSelector.cpp
     SHAPERGUI_SalomeViewer.cpp
     SHAPERGUI_NestedButton.cpp
-       SHAPERGUI_ToolbarsMgr.cpp
+    SHAPERGUI_ToolbarsMgr.cpp
 )
 
 SET(PROJECT_RESOURCES
     ${CMAKE_CURRENT_BINARY_DIR}/LightApp.xml
-    ${CMAKE_CURRENT_BINARY_DIR}/SalomeApp.xml
+    resources/SalomeApp.xml
     resources/shaper.png
 )
 
+SET(TEXT_RESOURCES
+    SHAPERGUI_msg_fr.ts
+)
+
+IF (${UPDATE_TRANSLATION})
+    SET(PROJECT_FILES ${PROJECT_SOURCES} ${PROJECT_HEADERS} )
+    QT5_CREATE_TRANSLATION(QM_RESOURCES
+                           ${PROJECT_FILES}
+                           ${TEXT_RESOURCES}
+                           OPTIONS -extensions cpp -no-recursive -locations none
+                          )
+ELSE(${UPDATE_TRANSLATION})
+    IF(${MAKE_TRANSLATION})
+        QT5_ADD_TRANSLATION(QM_RESOURCES ${TEXT_RESOURCES})
+    ENDIF(${MAKE_TRANSLATION})
+ENDIF(${UPDATE_TRANSLATION})
+
+
 SET(PROJECT_LIBRARIES
     Events
     Config
@@ -99,6 +118,7 @@ ADD_LIBRARY(SHAPER SHARED
     ${PROJECT_SOURCES}
     ${PROJECT_HEADERS}
     ${PROJECT_AUTOMOC}
+    ${QM_RESOURCES}
 )
 
 ADD_DEPENDENCIES(SHAPER XGUI)
@@ -111,10 +131,7 @@ CONFIGURE_FILE(
   "${CMAKE_CURRENT_SOURCE_DIR}/resources/LightApp.xml.in"
   "${CMAKE_CURRENT_BINARY_DIR}/LightApp.xml"
   )
-CONFIGURE_FILE(
-  "${CMAKE_CURRENT_SOURCE_DIR}/resources/SalomeApp.xml.in"
-  "${CMAKE_CURRENT_BINARY_DIR}/SalomeApp.xml"
-  )
 
 INSTALL(TARGETS SHAPER DESTINATION ${SHAPER_INSTALL_BIN})
 INSTALL(FILES ${PROJECT_RESOURCES} DESTINATION ${SHAPER_INSTALL_RESOURCES})
+INSTALL(FILES ${QM_RESOURCES} DESTINATION ${SHAPER_INSTALL_QM_RESOURCES})