Compare commits

3 Commits

Author SHA1 Message Date
be51728570 Merge remote-tracking branch 'origin/master' into concurrent 2020-08-03 17:48:36 +03:00
9cd108cf20 tests binary dir fix 2020-08-03 11:10:27 +03:00
22208fbf51 tests binary dir fix 2020-08-03 11:10:05 +03:00
2 changed files with 3 additions and 0 deletions

View File

@@ -224,6 +224,7 @@ if (DEFINED LIBPROJECT)
endif()
if (TESTS)
set(PIP_ROOT_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}")
add_subdirectory(tests)
endif()

View File

@@ -4,10 +4,12 @@ macro(pip_test NAME LIBS)
file(GLOB _CPPS "${NAME}/*.cpp")
file(GLOB _HDRS "${NAME}/*.h")
set(_target pip_${NAME}_test)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PIP_ROOT_BINARY_DIR}")
add_executable(${_target} ${_CPPS} ${_HDRS})
target_link_libraries(${_target} pip ${LIBS} gtest_main gmock_main)
add_test(NAME ${_target} COMMAND tests)
add_custom_target(${_target}_perform ALL COMMAND ${_target})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY)
list(APPEND PIP_TESTS_LIST "${NAME}")
set(PIP_TESTS_LIST ${PIP_TESTS_LIST} PARENT_SCOPE)
endmacro()