CMake: tell tests where their source-dir is

- Abuse BUILD_AS_TEST to pass in the value as a string
This commit is contained in:
Adriaan de Groot 2020-03-23 14:12:18 +01:00
parent c850408555
commit 0aaf24c4a5

View file

@ -50,7 +50,7 @@ function( calamares_add_test )
Qt5::Test
)
calamares_automoc( ${TEST_NAME} )
target_compile_definitions( ${TEST_NAME} PRIVATE -DBUILD_AS_TEST ${TEST_DEFINITIONS} )
target_compile_definitions( ${TEST_NAME} PRIVATE -DBUILD_AS_TEST="${CMAKE_CURRENT_SOURCE_DIR}" ${TEST_DEFINITIONS} )
if( TEST_GUI )
target_link_libraries( ${TEST_NAME} calamaresui Qt5::Gui )
endif()