From: Anthony Geay Date: Thu, 29 Aug 2024 15:13:06 +0000 (+0200) Subject: [EDF30834] : Couple correctly ActiveExtensions and tests are correctly linked now. X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=da44da049b293cca1ebc127bcc8c89237b5e5371;p=tools%2Fmedcoupling.git [EDF30834] : Couple correctly ActiveExtensions and tests are correctly linked now. --- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3911381c8..357cd0e1d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -31,9 +31,9 @@ ENDIF(MEDCOUPLING_BUILD_TESTS) ADD_SUBDIRECTORY(MEDCoupling) ADD_SUBDIRECTORY(ICoCo) +# Shape recognition IF(MEDCOUPLING_ENABLE_SHAPERECOGN) ADD_SUBDIRECTORY(ShapeRecogn) - LIST(APPEND SWIG_MODULE_medcoupling_EXTRA_FLAGS -DWITH_SHAPE_RECOGN) ENDIF(MEDCOUPLING_ENABLE_SHAPERECOGN) IF(MEDCOUPLING_ENABLE_PYTHON) diff --git a/src/CTestTestfileInstall.cmake.in b/src/CTestTestfileInstall.cmake.in index 6ef143d8f..62a36f4b5 100644 --- a/src/CTestTestfileInstall.cmake.in +++ b/src/CTestTestfileInstall.cmake.in @@ -21,6 +21,7 @@ SET(COMPONENT_NAME MEDCOUPLING) SET(TIMEOUT 120) SET(MEDCOUPLING_BUILD_PY_TESTS $) SET(MEDCOUPLING_USE_MPI_BOOL $) +SET(MEDCOUPLING_ENABLE_SHAPERECOGN $) SUBDIRS(INTERP_KERNELTest) SUBDIRS(MEDCoupling) @@ -35,6 +36,10 @@ if(MEDCOUPLING_USE_MPI_BOOL) SUBDIRS(ParaMEDMEM_Swig) endif() +if(MEDCOUPLING_ENABLE_SHAPERECOGN) + SUBDIRS(ShapeRecogn) +endif() + SUBDIRS(MEDPartitioner_Swig) SUBDIRS(RENUMBER_Swig) SUBDIRS(PyWrapping) diff --git a/src/PyWrapping/CMakeLists.txt b/src/PyWrapping/CMakeLists.txt index 136cdd289..c37d6780d 100644 --- a/src/PyWrapping/CMakeLists.txt +++ b/src/PyWrapping/CMakeLists.txt @@ -37,6 +37,10 @@ IF(MEDCOUPLING_USE_64BIT_IDS) STRING(APPEND SWIG_MODULE_medcoupling_EXTRA_FLAGS ";-DMEDCOUPLING_USE_64BIT_IDS") ENDIF(MEDCOUPLING_USE_64BIT_IDS) +IF(MEDCOUPLING_ENABLE_SHAPERECOGN) + LIST(APPEND SWIG_MODULE_medcoupling_EXTRA_FLAGS -DWITH_SHAPE_RECOGN) +ENDIF(MEDCOUPLING_ENABLE_SHAPERECOGN) + SET(medcoupling_SWIG_DPYS_FILES medcoupling.i) INCLUDE_DIRECTORIES( diff --git a/src/ShapeRecogn/Test/CMakeLists.txt b/src/ShapeRecogn/Test/CMakeLists.txt index 4206fa0c0..57247a660 100644 --- a/src/ShapeRecogn/Test/CMakeLists.txt +++ b/src/ShapeRecogn/Test/CMakeLists.txt @@ -43,24 +43,28 @@ SET(TestShapeRecogn_SOURCES SALOME_ACCUMULATE_ENVIRONMENT(MEDCOUPLING_RESOURCE_DIR "${CMAKE_BINARY_DIR}/resources") SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env) -ADD_EXECUTABLE(TestShapeRecogn ${TestShapeRecogn_SOURCES}) -TARGET_LINK_LIBRARIES(TestShapeRecogn shaperecogn InterpKernelTestUtils medloader ${MEDFILE_C_LIBRARIES} ${HDF5_LIBRARIES} ${CPPUNIT_LIBRARIES} ${PLATFORM_LIBS}) -INSTALL(TARGETS TestShapeRecogn DESTINATION ${MEDCOUPLING_INSTALL_BINS}) +IF(NOT MEDCOUPLING_MICROMED) + SET(TESTSHAPE_RECOGN0 TestShapeRecogn) + ADD_EXECUTABLE(${TESTSHAPE_RECOGN0} ${TestShapeRecogn_SOURCES}) + TARGET_LINK_LIBRARIES(${TESTSHAPE_RECOGN0} shaperecogn InterpKernelTestUtils medloader ${MEDFILE_C_LIBRARIES} ${HDF5_LIBRARIES} ${CPPUNIT_LIBRARIES} ${PLATFORM_LIBS}) -SET(BASE_TESTS TestShapeRecogn) + INSTALL(TARGETS ${TESTSHAPE_RECOGN0} DESTINATION ${MEDCOUPLING_INSTALL_BINS}) -FOREACH(test ${BASE_TESTS}) - ADD_TEST(NAME ${test} - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MCTestLauncher.py ${CMAKE_CURRENT_BINARY_DIR}/${test}) - SET_TESTS_PROPERTIES(${test} PROPERTIES ENVIRONMENT "${tests_env}") -ENDFOREACH() + SET(BASE_TESTS ${TESTSHAPE_RECOGN0}) -# Application tests + FOREACH(test ${BASE_TESTS}) + ADD_TEST(NAME ${test} + COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${test}) + SET_TESTS_PROPERTIES(${test} PROPERTIES ENVIRONMENT "${tests_env}") + ENDFOREACH() -SET(TEST_INSTALL_DIRECTORY ${MEDCOUPLING_INSTALL_TESTS}/ShapeRecogn) -INSTALL(TARGETS TestShapeRecogn DESTINATION ${TEST_INSTALL_DIRECTORY}) + # Application tests -INSTALL(FILES CTestTestfileInstall.cmake - DESTINATION ${TEST_INSTALL_DIRECTORY} - RENAME CTestTestfile.cmake) + SET(TEST_INSTALL_DIRECTORY ${MEDCOUPLING_INSTALL_TESTS}/ShapeRecogn) + INSTALL(TARGETS ${TESTSHAPE_RECOGN0} DESTINATION ${TEST_INSTALL_DIRECTORY}) + + INSTALL(FILES CTestTestfileInstall.cmake + DESTINATION ${TEST_INSTALL_DIRECTORY} + RENAME CTestTestfile.cmake) +ENDIF(NOT MEDCOUPLING_MICROMED) diff --git a/src/ShapeRecogn/Test/CTestTestfileInstall.cmake b/src/ShapeRecogn/Test/CTestTestfileInstall.cmake index 330926239..b636c20a0 100644 --- a/src/ShapeRecogn/Test/CTestTestfileInstall.cmake +++ b/src/ShapeRecogn/Test/CTestTestfileInstall.cmake @@ -23,7 +23,7 @@ SET(TEST_NAMES FOREACH(tfile ${TEST_NAMES}) SET(TEST_NAME ${COMPONENT_NAME}_${tfile}) - ADD_TEST(${TEST_NAME} python3 MCTestLauncher.py ${tfile}) + ADD_TEST(${TEST_NAME} ${tfile}) SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}" TIMEOUT ${TIMEOUT}