Skip to content
Snippets Groups Projects
Commit f97781c7 authored by Pascal Palenda's avatar Pascal Palenda
Browse files

Add output option for the test executable target

parent 0886a2e9
No related branches found
No related tags found
No related merge requests found
......@@ -73,7 +73,7 @@ include_guard ()
If not specified, the install expects the same include folder structure as in the
libraries include folder.
.. variable:: OUT_VAR
.. variable:: OUT_LIB
Variable name into which the library target name will be set.
......@@ -99,6 +99,12 @@ include_guard ()
Default is `${CMAKE_CURRENT_SOURCE_DIR}/src`.
This should be given if TEST_INTERNALS is given and one wants to test the internals.
.. variable:: OUT_TEST
Variable name into which the test target name will be set.
This can be useful when further settings must be applied to the test target.
.. variable:: OBJECT_LIB_POSTFIX
Optionally specify a postfix for the object library if TEST_INTERNALS is specified.
......@@ -117,7 +123,8 @@ macro (ihta_add_library)
INSTALL_INCLUDE_DIR
IDE_FOLDER
OBJECT_LIB_POSTFIX
OUT_VAR
OUT_LIB
OUT_TEST
)
set (multiValueArgs SOURCES TEST_SOURCES)
cmake_parse_arguments (IHTA_ADD_LIB "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
......@@ -219,8 +226,8 @@ macro (ihta_add_library)
GroupSourcesByFolder (${IHTA_ADD_LIB_TARGET})
if (IHTA_ADD_LIB_TEST_SOURCES)
set (IHTA_ADD_LIB_TEST_TARGET ${IHTA_ADD_LIB_NAME}UnitTest)
if (IHTA_ADD_LIB_TEST_INTERNALS)
set (IHTA_ADD_LIB_TEST_TARGET ${IHTA_ADD_LIB_NAME}UnitTest)
ihta_add_test (
NAME ${IHTA_ADD_LIB_TEST_TARGET}
IDE_FOLDER ${IHTA_ADD_LIB_IDE_FOLDER}
......@@ -235,14 +242,19 @@ macro (ihta_add_library)
)
else ()
ihta_add_test (
NAME ${IHTA_ADD_LIB_TEST_TARGET}
TEST_TARGET ${IHTA_ADD_LIB_TARGET}
IDE_FOLDER ${IHTA_ADD_LIB_IDE_FOLDER}
SOURCES ${IHTA_ADD_LIB_TEST_SOURCES}
)
endif ()
if (IHTA_ADD_LIB_OUT_TEST)
set (${IHTA_ADD_LIB_OUT_TEST} ${IHTA_ADD_LIB_TEST_TARGET})
endif ()
endif ()
if (IHTA_ADD_LIB_OUT_VAR)
set (${IHTA_ADD_LIB_OUT_VAR} ${IHTA_ADD_LIB_TARGET})
if (IHTA_ADD_LIB_OUT_LIB)
set (${IHTA_ADD_LIB_OUT_LIB} ${IHTA_ADD_LIB_TARGET})
endif ()
endmacro ()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment