Made it easier to run tests on windows
authorAlexey Sheplyakov <asheplyakov@altlinux.org>
Wed, 25 Dec 2019 16:41:17 +0000 (20:41 +0400)
committerAlexey Sheplyakov <asheplyakov@altlinux.org>
Fri, 28 Aug 2020 15:15:31 +0000 (19:15 +0400)
Put executables and DLLs into the `bin` subdirectory so the system
can locate GiNaC (and CLN) DLLs without extra configuration.

CMakeLists.txt
check/CMakeLists.txt

index 7989df14386a53183b1ee88055ef0496f6046fd2..9aec32790e6306593a13f4f3faa1f3047e6e9731 100644 (file)
@@ -20,6 +20,11 @@ set(ginaclib_version ${ginaclib_soversion}.${ginac_lt_age}.${ginac_lt_revision})
 # make check
 enable_testing()
 add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND})
+if (WIN32)
+       if (NOT DEFINED CMAKE_RUNTIME_OUTPUT_DIRECTORY)
+               set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
+       endif()
+endif()
 # make info
 add_custom_target(info ALL)
 add_custom_target(html)
index 82e78e184c551ce8f149fb510d382fa113363504..9c38932c4a06f73a1f94ede3f60571551c9dbda9 100644 (file)
@@ -72,7 +72,7 @@ macro(add_ginac_test thename)
        add_executable(${thename} EXCLUDE_FROM_ALL ${${thename}_sources})
        target_link_libraries(${thename} ginac ${LIBDL_LIBRARIES})
        add_dependencies(check ${thename})
-       add_test(NAME ${thename} COMMAND ${thename}${CMAKE_EXECUTABLE_SUFFIX})
+       add_test(NAME ${thename} COMMAND $<TARGET_FILE:${thename}>)
 endmacro()
 
 macro(add_ginac_timing thename)