From e5b66ee76eaf85ba03b0ef0151b9987c3c75e412 Mon Sep 17 00:00:00 2001 From: mbs Date: Tue, 28 May 2024 17:20:55 +0100 Subject: [PATCH] Fixed installation issue on Windows --- test/CMakeLists.txt | 10 +++++++++- test/CTestTestfileInstall.cmake | 6 +++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index d52fdcf89..19d56d237 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -64,4 +64,12 @@ FOREACH(_test ${CPP_TESTS}) SET_TESTS_PROPERTIES(${testname} PROPERTIES ENVIRONMENT "${tests_env}" LABELS "tests") ENDFOREACH() -INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${CPP_TESTS} PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ DESTINATION ${TEST_INSTALL_DIRECTORY}) +IF(WIN32) + FOREACH(_test ${CPP_TESTS}) + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/${_test}${CMAKE_EXECUTABLE_SUFFIX} PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ DESTINATION ${TEST_INSTALL_DIRECTORY}) + ENDFOREACH() +ELSE() + FOREACH(_test ${CPP_TESTS}) + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${_test} PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ DESTINATION ${TEST_INSTALL_DIRECTORY}) + ENDFOREACH() +ENDIF(WIN32) diff --git a/test/CTestTestfileInstall.cmake b/test/CTestTestfileInstall.cmake index f4f1fed9f..53d4f456b 100644 --- a/test/CTestTestfileInstall.cmake +++ b/test/CTestTestfileInstall.cmake @@ -33,11 +33,11 @@ FOREACH(tfile ${SESSION_FREE_TESTS}) SET(TEST_NAME SMESH_${BASE_NAME}) ADD_TEST(${TEST_NAME} python ${tfile}) SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME};${COMPONENT_NAME}_tests") -endforeach() +ENDFOREACH() FOREACH(tfile ${CPP_TESTS}) GET_FILENAME_COMPONENT(BASE_NAME ${tfile} NAME_WE) SET(TEST_NAME SMESH_${BASE_NAME}) - ADD_TEST(${TEST_NAME} SMESH_RegularGridTest ) + ADD_TEST(${TEST_NAME} ${BASE_NAME} ) SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME};${COMPONENT_NAME}_tests") -endforeach() +ENDFOREACH()