cmake: Put test targets in folders

This commit is contained in:
Florent Castelli 2017-02-03 04:19:23 +01:00
parent 1dd229fac8
commit 9180c87197
2 changed files with 7 additions and 1 deletions

View File

@ -81,6 +81,9 @@ include(CheckAndAddFlag)
include(CheckCCompilerFlag)
include(DolphinCompileDefinitions)
# Enable folders for IDE
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Libraries to link
set(LIBS)

View File

@ -13,7 +13,10 @@ macro(add_dolphin_test target srcs)
# Host_ functions.
set(srcs2 ${srcs} ${CMAKE_SOURCE_DIR}/Source/UnitTests/TestUtils/StubHost.cpp)
add_executable(Test_${target} EXCLUDE_FROM_ALL ${srcs2})
set_target_properties(Test_${target} PROPERTIES OUTPUT_NAME Tests/${target})
set_target_properties(Test_${target} PROPERTIES
OUTPUT_NAME Tests/${target}
FOLDER Tests
)
target_link_libraries(Test_${target} ${LIBS})
add_dependencies(unittests Test_${target})
add_test(NAME ${target} COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Tests/${target})