Avoid an indentation level in TestTarget.cmake

This commit is contained in:
Martchus 2020-01-20 17:57:03 +01:00
parent d5930c8d60
commit 522d2e8cc8
1 changed files with 41 additions and 43 deletions

View File

@ -104,10 +104,9 @@ if (META_PROJECT_IS_LIBRARY)
message(STATUS "Linking test target against ${META_TARGET_NAME}")
endif ()
# handle testing an application
if (META_PROJECT_IS_APPLICATION)
# using functions directly from the tests might be required -> also create a 'testlib' and link tests against it
if (LINK_TESTS_AGAINST_APP_TARGET)
# create a 'testlib' and link tests against it when testing an application an the tests need to call internal
# functions of the application
if (META_PROJECT_IS_APPLICATION AND LINK_TESTS_AGAINST_APP_TARGET)
# create target for the 'testlib'
set(TESTLIB_FILES ${HEADER_FILES} ${SRC_FILES} ${WIDGETS_FILES} ${QML_FILES} ${RES_FILES} ${QM_FILES})
list(REMOVE_ITEM TESTLIB_FILES main.h main.cpp)
@ -147,7 +146,6 @@ if (META_PROJECT_IS_APPLICATION)
list(APPEND TEST_LIBRARIES ${META_TARGET_NAME}_testlib)
# ensure all symbols are visible (man gcc: "Despite the nomenclature, default always means public")
set_target_properties(${META_TARGET_NAME}_testlib PROPERTIES CXX_VISIBILITY_PRESET default)
endif ()
endif ()
# configure test target