cmake: test: Allow building tests as standalone project

This commit is contained in:
Sebastian Krzyszkowiak 2023-11-02 07:39:27 +01:00
parent f98eb9eb70
commit 1d0f4586e7
No known key found for this signature in database
GPG key ID: E8F235CF3BDBC3FF

View file

@ -3,7 +3,8 @@ find_package(CMocka)
if (CMOCKA_FOUND) if (CMOCKA_FOUND)
set(CMAKE_INSTALL_RPATH "\$ORIGIN/../src") set(CMAKE_INSTALL_RPATH "\$ORIGIN/../src")
add_executable(engine-tests tests.c timeline.c character.c) add_executable(engine-tests tests.c timeline.c character.c)
include_directories("../src")
target_link_libraries(engine-tests cmocka libsuperderpy) target_link_libraries(engine-tests cmocka libsuperderpy)
else(CMOCKA_FOUND) else(CMOCKA_FOUND)
message("CMocka not found; tests disabled.") message(WARNING "CMocka not found; tests disabled.")
endif(CMOCKA_FOUND) endif(CMOCKA_FOUND)