Attempt to fix cmake "test" reserved word error

This commit is contained in:
Jonathan Thomas
2019-04-05 17:40:38 -05:00
parent b1f1df7dcd
commit dbc6e8ec61

View File

@@ -224,8 +224,16 @@ IF (NOT DISABLE_TESTS)
# Link libraries to the new executable
target_link_libraries(openshot-test openshot ${UNITTEST++_LIBRARY})
# Add cmake policy
cmake_policy(PUSH)
if(POLICY CMP0037)
cmake_policy(SET CMP0037 OLD)
endif()
#################### MAKE TEST ######################
# Hook up the 'make test' target to the 'openshot-test' executable
ADD_TEST(NAME openshot-test
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/openshot-test)
ADD_CUSTOM_TARGET(test ${CMAKE_CURRENT_BINARY_DIR}/openshot-test)
# Remove cmake policy
cmake_policy(POP)
ENDIF (NOT DISABLE_TESTS)