buildsystem: update tests to include more libraries

In order to test plannerShared (backend-shared) more
libraries are needed.

Signed-off-by: Jan Iversen <jan@casacondor.com>
This commit is contained in:
jan Iversen 2019-12-25 16:00:54 +01:00 committed by Dirk Hohndel
parent 1fc54e907f
commit 9d34ab4bc4

View file

@ -39,12 +39,23 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
endif() endif()
endif() endif()
# define libraries to use, due to the fact that some library names are different between mobile and desktop
# extra settings are needed
# even though the targets are test executable the overall target is the same
if (SUBSURFACE_TARGET_EXECUTABLE MATCHES "DesktopExecutable")
set(TEST_SPECIFIC_LIBRARIES subsurface_models_desktop)
else()
set(TEST_SPECIFIC_LIBRARIES subsurface_models_mobile )
endif()
# Helper function TEST used to created rules to build, link, install and run tests # Helper function TEST used to created rules to build, link, install and run tests
function(TEST NAME FILE) function(TEST NAME FILE)
get_filename_component(HDR "${FILE}" NAME_WE) get_filename_component(HDR "${FILE}" NAME_WE)
add_executable(${NAME} ${FILE} ${HDR}.h) add_executable(${NAME} ${FILE} ${HDR}.h)
target_link_libraries( target_link_libraries(
${NAME} ${NAME}
subsurface_backend_shared
${TEST_SPECIFIC_LIBRARIES}
subsurface_corelib subsurface_corelib
RESOURCE_LIBRARY RESOURCE_LIBRARY
${QT_TEST_LIBRARIES} ${QT_TEST_LIBRARIES}