Salome HOME
Make exportToXAO work even if a group or a field is not valid.
[modules/shaper.git] / src / ExchangePlugin / CMakeLists.txt
index d170f309ffa498e408fd64898f12f20bac541037..237759c998cde841699a1761f6e12a2048329880 100644 (file)
@@ -1,4 +1,22 @@
-## Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+## 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>
+##
 
 INCLUDE(Common)
 INCLUDE(UnitTest)
@@ -6,8 +24,10 @@ INCLUDE(UnitTest)
 INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/Events
                     ${PROJECT_SOURCE_DIR}/src/Config
                     ${PROJECT_SOURCE_DIR}/src/ModelAPI
+                    ${PROJECT_SOURCE_DIR}/src/ModelHighAPI
                     ${PROJECT_SOURCE_DIR}/src/GeomAPI
                     ${PROJECT_SOURCE_DIR}/src/GeomAlgoAPI
+                    ${PROJECT_SOURCE_DIR}/src/XAO
 )
 
 SET(PROJECT_HEADERS
@@ -17,6 +37,7 @@ SET(PROJECT_HEADERS
     ExchangePlugin_ExportFeature.h
     ExchangePlugin_Validators.h
     ExchangePlugin_Tools.h
+    ExchangePlugin_Dump.h
 )
 
 SET(PROJECT_SOURCES
@@ -25,39 +46,60 @@ SET(PROJECT_SOURCES
     ExchangePlugin_ExportFeature.cpp
     ExchangePlugin_Validators.cpp
     ExchangePlugin_Tools.cpp
+    ExchangePlugin_Dump.cpp
 )
 
 SET(XML_RESOURCES
+    export_widget.xml
     plugin-Exchange.xml
 )
 
+SET(TEXT_RESOURCES
+    ExchangePlugin_msg_en.ts
+)
+
 SET(PROJECT_LIBRARIES
     Events
     Config
     ModelAPI
+    ModelHighAPI
     GeomAPI
     GeomAlgoAPI
+    XAOShaper
 )
-
-SET(ICON_RESOURCES
-  icons/export.png
-  icons/import.png
-)
+SOURCE_GROUP ("Resource Files" FILES ${TEXT_RESOURCES})
 
 ADD_DEFINITIONS(-DEXCHANGEPLUGIN_EXPORTS)
-ADD_LIBRARY(ExchangePlugin MODULE ${PROJECT_SOURCES} ${PROJECT_HEADERS} ${XML_RESOURCES})
+ADD_LIBRARY(ExchangePlugin MODULE ${PROJECT_SOURCES} ${PROJECT_HEADERS} ${XML_RESOURCES} ${TEXT_RESOURCES})
 
 TARGET_LINK_LIBRARIES(ExchangePlugin ${PROJECT_LIBRARIES})
 
 INSTALL(TARGETS ExchangePlugin DESTINATION ${SHAPER_INSTALL_PLUGIN_FILES})
 INSTALL(FILES ${XML_RESOURCES} DESTINATION ${SHAPER_INSTALL_XML_RESOURCES})
-INSTALL(FILES ${ICON_RESOURCES} DESTINATION ${SHAPER_INSTALL_XML_RESOURCES}/icons/Exchange)
+INSTALL(DIRECTORY icons/ DESTINATION ${SHAPER_INSTALL_XML_RESOURCES}/icons/Exchange)
+INSTALL(FILES ${TEXT_RESOURCES} DESTINATION ${SHAPER_INSTALL_XML_RESOURCES})
+
+ADD_UNIT_TESTS(TestImport.py
+               TestExport.py
+               Test2290.py
+               TestExportToXAOWithGroupNotUpdated.py)
+
+SET(DATA_FILES
+  solid.brep
+  solid.brp
+  screw.step
+  screw.stp
+  bearing.iges
+  bearing.igs
+  Box_1.brep
+  test.xao
+  export_ref.xao
+)
 
-ADD_UNIT_TESTS(TestImport.py TestExport.py)
+FOREACH(file ${DATA_FILES})
+  CONFIGURE_FILE(
+    ${CMAKE_CURRENT_SOURCE_DIR}/Test/Data/${file}
+    ${CMAKE_CURRENT_BINARY_DIR}/Data/${file}
+    COPYONLY)
+ENDFOREACH(file ${DATA_FIELS})
 
-CONFIGURE_FILE(Test/Data/solid.brep Data/solid.brep COPYONLY)
-CONFIGURE_FILE(Test/Data/solid.brp Data/solid.brp COPYONLY)
-CONFIGURE_FILE(Test/Data/screw.step Data/screw.step COPYONLY)
-CONFIGURE_FILE(Test/Data/screw.stp Data/screw.stp COPYONLY)
-CONFIGURE_FILE(Test/Data/bearing.iges Data/bearing.iges COPYONLY)
-CONFIGURE_FILE(Test/Data/bearing.igs Data/bearing.igs COPYONLY)