Salome HOME
Copyright update 2022
[modules/gui.git] / src / SUIT / CMakeLists.txt
index da0dd0a9b6a5c9874cb242902860a9c98f2c5011..f0acf6843084dda8b9ab880fdf7bd9279ecf2c79 100644 (file)
@@ -1,9 +1,9 @@
-# Copyright (C) 2012-2013  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2022  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # 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.
+# 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
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-INCLUDE(UseQt4Ext)
+INCLUDE(UseQtExt)
 
+# --- options ---
+
+# additional include directories
 INCLUDE_DIRECTORIES(
   ${QT_INCLUDES}
-  ${CMAKE_CURRENT_SOURCE_DIR}
-  ${CMAKE_CURRENT_SOURCE_DIR}/../Qtx
-  ${CMAKE_CURRENT_SOURCE_DIR}/../ObjBrowser
+  ${PROJECT_SOURCE_DIR}/src/Qtx
+  ${PROJECT_SOURCE_DIR}/src/ObjBrowser
 )
 
-SET(COMMON_LIBS
-  qtx
-  ObjBrowser
-  ${QT_LIBRARIES}
-  ${PLATFORM_LIBS}
-)
-IF(ENABLE_TESTRECORDER)
-  ADD_DEFINITIONS("-DENABLE_TESTRECORDER ${TESTRECORDER_DEFINITIONS}")
-  SET(COMMON_LIBS ${COMMON_LIBS} ${TESTRECORDER_LIBS})
-ENDIF(ENABLE_TESTRECORDER)
+# additional preprocessor / compiler flags
+ADD_DEFINITIONS(${QT_DEFINITIONS})
+
+# libraries to link to
+SET(_link_LIBRARIES ${PLATFORM_LIBS} ${QT_LIBRARIES} qtx ObjBrowser)
 
-SET(GUI_HEADERS 
+# --- headers ---
+
+# header files / to be processed by moc
+SET(_moc_HEADERS   
   SUIT_Accel.h  
   SUIT_ActionOperation.h 
   SUIT_Application.h 
   SUIT_DataBrowser.h 
   SUIT_DataObject.h 
   SUIT_Desktop.h 
-  SUIT_LicenseDlg.h
   SUIT_FileDlg.h 
+  SUIT_LicenseDlg.h
+  SUIT_MessageBox.h
   SUIT_Operation.h 
   SUIT_PopupClient.h 
   SUIT_PreferenceMgr.h 
   SUIT_SelectionMgr.h 
-  SUIT_Selector.h 
   SUIT_Session.h 
+  SUIT_ShortcutMgr.h
   SUIT_Study.h
   SUIT_TreeModel.h 
   SUIT_ViewManager.h 
   SUIT_ViewModel.h 
   SUIT_ViewWindow.h 
-  SUIT_ShortcutMgr.h
+)
+
+# header files / no moc processing
+SET(_other_HEADERS
+  SUIT.h
   SUIT_CameraProperties.h
+  SUIT_DataObjectIterator.h
+  SUIT_DataObjectKey.h
+  SUIT_DataOwner.h
+  SUIT_ExceptionHandler.h
+  SUIT_FileValidator.h
+  SUIT_OverrideCursor.h
+  SUIT_ResourceMgr.h
+  SUIT_SelectionFilter.h
+  SUIT_Selector.h
+  SUIT_SmartPtr.h
+  SUIT_Tools.h
+  SUIT_TreeSync.h
+)
+
+# header files / to install
+SET(suit_HEADERS ${_moc_HEADERS} ${_other_HEADERS})
+
+# --- resources ---
+
+# resource files / to be processed by lrelease
+SET(_ts_RESOURCES
+  resources/SUIT_msg_en.ts
+  resources/SUIT_msg_fr.ts
+  resources/SUIT_msg_ja.ts
+  resources/SUIT_images.ts
 )
-QT4_WRAP_CPP(GUI_HEADERS_MOC ${GUI_HEADERS})
 
-SET(suit_SOURCES
+# resource files / static
+SET(_other_RESOURCES
+  resources/icon_visibility_on.png
+  resources/icon_visibility_off.png
+  resources/view_sync.png
+)
+
+# --- sources ---
+
+# sources / moc wrappings
+QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS})
+
+# sources / static
+SET(_other_SOURCES
   SUIT_Accel.cxx
   SUIT_ActionOperation.cxx
   SUIT_Application.cxx
+  SUIT_CameraProperties.cxx
   SUIT_DataBrowser.cxx
   SUIT_DataObject.cxx
   SUIT_DataObjectIterator.cxx
@@ -74,8 +117,8 @@ SET(suit_SOURCES
   SUIT_Desktop.cxx
   SUIT_ExceptionHandler.cxx
   SUIT_FileDlg.cxx
-  SUIT_LicenseDlg.cxx
   SUIT_FileValidator.cxx
+  SUIT_LicenseDlg.cxx
   SUIT_MessageBox.cxx
   SUIT_Operation.cxx
   SUIT_OverrideCursor.cxx
@@ -86,29 +129,26 @@ SET(suit_SOURCES
   SUIT_SelectionMgr.cxx
   SUIT_Selector.cxx
   SUIT_Session.cxx
+  SUIT_ShortcutMgr.cxx
   SUIT_Study.cxx
   SUIT_Tools.cxx
   SUIT_TreeModel.cxx
   SUIT_ViewManager.cxx
   SUIT_ViewModel.cxx
   SUIT_ViewWindow.cxx
-  SUIT_ShortcutMgr.cxx
-  SUIT_CameraProperties.cxx
-)
-SET(GUITS_SOURCES
-  resources/SUIT_msg_en.ts
-  resources/SUIT_msg_fr.ts
-  resources/SUIT_images.ts
 )
 
-ADD_LIBRARY(suit ${suit_SOURCES} ${GUI_HEADERS_MOC})
-TARGET_LINK_LIBRARIES(suit ${COMMON_LIBS})
+# sources / to compile
+SET(suit_SOURCES ${_other_SOURCES} ${_moc_SOURCES})
+
+# --- rules ---
+
+ADD_LIBRARY(suit ${suit_SOURCES})
+TARGET_LINK_LIBRARIES(suit ${_link_LIBRARIES})
 INSTALL(TARGETS suit EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 
-FILE(GLOB COMMON_HEADERS_H "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
-INSTALL(FILES ${COMMON_HEADERS_H} DESTINATION ${SALOME_INSTALL_HEADERS})
-QT4_INSTALL_TS_RESOURCES("${GUITS_SOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
+INSTALL(FILES ${suit_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
+QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
 
-FILE(GLOB GUIPNG_DATA "${CMAKE_CURRENT_SOURCE_DIR}/resources/*.png")
-INSTALL(FILES ${GUIPNG_DATA} DESTINATION ${SALOME_GUI_INSTALL_RES_DATA})
+INSTALL(FILES ${_other_RESOURCES} DESTINATION ${SALOME_GUI_INSTALL_RES_DATA})