MESSAGE(FATAL_ERROR "We absolutely need a Salome SMESH with GUI, please set SALOME_BUILD_GUI=ON in SMESH module")
ENDIF(NOT SALOME_SMESH_BUILD_GUI)
ENDIF(SALOME_BUILD_GUI)
- IF(SALOME_BUILD_DOC)
- IF(NOT SALOME_SMESH_BUILD_DOC)
- MESSAGE(FATAL_ERROR "We absolutely need a Salome SMESH documentation to build GMSHPLUGIN documentation. "
- "So, you should either set SALOME_BUILD_DOC=OFF in GMSHPLUGIN or set SALOME_BUILD_DOC=ON in SMESH module.")
- ENDIF(NOT SALOME_SMESH_BUILD_DOC)
- ENDIF(SALOME_BUILD_DOC)
ELSE(EXISTS ${SMESH_ROOT_DIR})
MESSAGE(FATAL_ERROR "We absolutely need a Salome SMESH, please define SMESH_ROOT_DIR")
ENDIF(EXISTS ${SMESH_ROOT_DIR})
IF(SALOME_BUILD_TESTS)
ADD_SUBDIRECTORY(tests)
ENDIF(SALOME_BUILD_TESTS)
-IF(SALOME_BUILD_DOC)
- ADD_SUBDIRECTORY(doc)
-ENDIF(SALOME_BUILD_DOC)
+ADD_SUBDIRECTORY(doc)
# Header configuration
# ====================
# Install the export set for use with the install-tree
INSTALL(EXPORT ${PROJECT_NAME}TargetGroup DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}"
FILE ${PROJECT_NAME}Targets.cmake)
+
+IF(SALOME_BUILD_TESTS)
+ CONFIGURE_FILE(CTestTestfileInstall.cmake
+ ${CMAKE_CURRENT_BINARY_DIR}/CTestTestfileInstall.cmake
+ @ONLY)
+ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/CTestTestfileInstall.cmake
+ DESTINATION ${SALOME_GMSHPLUGIN_INSTALL_TESTS}
+ RENAME CTestTestfile.cmake)
+ENDIF()
--- /dev/null
+# Copyright (C) 2012-2015 ALNEOS
+# Copyright (C) 2016-2020 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.alneos.com/ or email : contact@alneos.fr
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+SET(TESTS_DIR "$ENV{GMSHPLUGIN_ROOT_DIR}/@SALOME_INSTALL_DOC@/examples/GMSHPLUGIN")
+
+INCLUDE(tests.set)
+INCLUDE(examples.set)
+
+SET(COMPONENT_NAME GMSHPLUGIN)
+SET(SALOME_TEST_DRIVER "$ENV{KERNEL_ROOT_DIR}/bin/salome/appliskel/salome_test_driver.py")
+SET(TIMEOUT 300)
+
+FOREACH(tfile ${TEST_SCRIPTS} ${EXAMPLE_SCRIPTS})
+ GET_FILENAME_COMPONENT(TEST_NAME ${tfile} NAME_WE)
+ SET(TEST_NAME "${COMPONENT_NAME}_${TEST_NAME}")
+ ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} ${TESTS_DIR}/${tfile})
+ SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}")
+ENDFOREACH()
#
ADD_SUBDIRECTORY(examples)
-ADD_SUBDIRECTORY(gui)
\ No newline at end of file
+IF(SALOME_BUILD_DOC)
+ ADD_SUBDIRECTORY(gui)
+ENDIF()
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-#FILE(GLOB files "${CMAKE_CURRENT_SOURCE_DIR}/*.py")
-#INSTALL(FILES ${files} DESTINATION ${SALOME_INSTALL_DOC}/examples/GMSHPLUGIN)
-
INCLUDE(examples.set)
-SET(COMPONENT_NAME GMSHPLUGIN)
-SET(SALOME_TEST_DRIVER "$ENV{KERNEL_ROOT_DIR}/bin/salome/appliskel/salome_test_driver.py")
-SET(TIMEOUT 300)
+# Install examples
+
+INSTALL(FILES ${EXAMPLE_SCRIPTS} DESTINATION ${SALOME_INSTALL_DOC}/examples/GMSHPLUGIN)
+
+# Tests
-SET(TEST_INSTALL_DIRECTORY ${SALOME_GMSHPLUGIN_INSTALL_TESTS})
+IF(SALOME_BUILD_TESTS)
+ # make test
-# make test
-SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
+ SET(SALOME_TEST_DRIVER "${KERNEL_ROOT_DIR}/bin/salome/appliskel/salome_test_driver.py")
+ SET(TIMEOUT 300)
+ SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
-FOREACH(tfile ${EXAMPLE_NAMES})
- SET(TEST_NAME ${COMPONENT_NAME}_${tfile})
- ADD_TEST(NAME ${TEST_NAME}
- COMMAND ${PYTHON_EXECUTABLE} -B ${SALOME_TEST_DRIVER} ${TIMEOUT} ${CMAKE_CURRENT_SOURCE_DIR}/${tfile}.py)
- SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES ENVIRONMENT "${tests_env}")
- SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}")
- INSTALL(FILES ${tfile}.py DESTINATION ${SALOME_INSTALL_DOC}/examples/GMSHPLUGIN)
-ENDFOREACH()
+ FOREACH(tfile ${EXAMPLE_SCRIPTS})
+ GET_FILENAME_COMPONENT(TEST_NAME ${tfile} NAME_WE)
+ ADD_TEST(NAME ${TEST_NAME}
+ COMMAND ${PYTHON_EXECUTABLE} -B ${SALOME_TEST_DRIVER} ${TIMEOUT} ${CMAKE_CURRENT_SOURCE_DIR}/${tfile})
+ SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES ENVIRONMENT "${tests_env}")
+ ENDFOREACH()
-# salome test
-FOREACH(tfile ${EXAMPLE_NAMES})
- INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${tfile}.py
- DESTINATION ${TEST_INSTALL_DIRECTORY})
-ENDFOREACH()
+ # salome test
-INSTALL(FILES examples.set DESTINATION ${TEST_INSTALL_DIRECTORY})
\ No newline at end of file
+ INSTALL(FILES examples.set DESTINATION ${SALOME_GMSHPLUGIN_INSTALL_TESTS})
+ENDIF()
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-SET(EXAMPLE_NAMES
- gmshdemo
+SET(EXAMPLE_SCRIPTS
+ gmshdemo.py
)
SALOME_CONFIGURE_FILE(static/header.html.in ${CMAKE_CURRENT_BINARY_DIR}/static/header.html)
SALOME_CONFIGURE_FILE(static/header_py.html.in ${CMAKE_CURRENT_BINARY_DIR}/static/header_py.html)
-SET(smesh_file "$(SMESH_ROOT_DIR)/bin/salome/collect_mesh_methods.py")
-SET(kernel_file "$ENV{KERNEL_ROOT_DIR}/bin/salome/prepare_generating_doc.py")
+SET(smesh_file "${SMESH_ROOT_DIR}/bin/salome/collect_mesh_methods.py")
+SET(kernel_file "${KERNEL_ROOT_DIR}/bin/salome/prepare_generating_doc.py")
SET(ADD_VAR)
LIST(APPEND ADD_VAR SMESH_MeshersList=GMSHPlugin)
INCLUDE(tests.set)
-SET(COMPONENT_NAME GMSHPLUGIN)
-SET(SALOME_TEST_DRIVER "$ENV{KERNEL_ROOT_DIR}/bin/salome/appliskel/salome_test_driver.py")
-SET(TIMEOUT 300)
-
-SET(TEST_INSTALL_DIRECTORY ${SALOME_GMSHPLUGIN_INSTALL_TESTS})
-
-# make test
-SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
-
-FOREACH(tfile ${TEST_NAMES})
- SET(TEST_NAME ${COMPONENT_NAME}_${tfile})
- ADD_TEST(NAME ${TEST_NAME}
- COMMAND ${PYTHON_EXECUTABLE} -B ${SALOME_TEST_DRIVER} ${TIMEOUT} ${CMAKE_CURRENT_SOURCE_DIR}/${tfile}.py)
- SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES ENVIRONMENT "${tests_env}")
- SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}")
-ENDFOREACH()
-
-# salome test
-FOREACH(tfile ${TEST_NAMES})
- INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${tfile}.py
- DESTINATION ${TEST_INSTALL_DIRECTORY})
-ENDFOREACH()
-
-INSTALL(FILES CTestTestfileInstall.cmake
- DESTINATION ${TEST_INSTALL_DIRECTORY}
- RENAME CTestTestfile.cmake)
-
-INSTALL(FILES tests.set DESTINATION ${TEST_INSTALL_DIRECTORY})
\ No newline at end of file
+# Install tests
+
+INSTALL(FILES ${TEST_SCRIPTS} DESTINATION ${SALOME_INSTALL_DOC}/examples/GMSHPLUGIN)
+
+# Tests
+
+IF(SALOME_BUILD_TESTS)
+ # make test
+
+ SET(SALOME_TEST_DRIVER "${KERNEL_ROOT_DIR}/bin/salome/appliskel/salome_test_driver.py")
+ SET(TIMEOUT 300)
+ SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
+
+ FOREACH(tfile ${TEST_SCRIPTS})
+ GET_FILENAME_COMPONENT(TEST_NAME ${tfile} NAME_WE)
+ ADD_TEST(NAME ${TEST_NAME}
+ COMMAND ${PYTHON_EXECUTABLE} -B ${SALOME_TEST_DRIVER} ${TIMEOUT} ${CMAKE_CURRENT_SOURCE_DIR}/${tfile})
+ SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES ENVIRONMENT "${tests_env}")
+ ENDFOREACH()
+
+ # salome test
+
+ INSTALL(FILES tests.set DESTINATION ${SALOME_GMSHPLUGIN_INSTALL_TESTS})
+ENDIF()
+++ /dev/null
-# Copyright (C) 2012-2015 ALNEOS
-# Copyright (C) 2016-2020 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.alneos.com/ or email : contact@alneos.fr
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-INCLUDE(tests.set)
-INCLUDE(examples.set)
-
-SET(COMPONENT_NAME GMSHPLUGIN)
-SET(SALOME_TEST_DRIVER "$ENV{KERNEL_ROOT_DIR}/bin/salome/appliskel/salome_test_driver.py")
-SET(TIMEOUT 300)
-
-
-FOREACH(tfile ${TEST_NAMES} ${EXAMPLE_NAMES})
- SET(TEST_NAME ${COMPONENT_NAME}_${tfile})
- ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} ${tfile}.py)
- SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}")
-ENDFOREACH()
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-SET(TEST_NAMES
- basicGroup
+SET(TEST_SCRIPTS
+ basicGroup.py
)