Skip to content

Commit

Permalink
cmake: Fix check target on single-configuration builds.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrfonseca committed Aug 27, 2015
1 parent ddb2571 commit d497b8d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,11 @@ target_link_libraries (gtest ${CMAKE_THREAD_LIBS_INIT})
enable_testing ()
if (CMAKE_CROSSCOMPILING)
add_custom_target (check)
elseif (DEFINED CMAKE_BUILD_TYPE)
# Single configuration
add_custom_target (check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure)
else ()
# Multiple configuration
add_custom_target (check COMMAND ${CMAKE_CTEST_COMMAND} -C "$<CONFIG>" --output-on-failure)
endif ()

Expand Down

0 comments on commit d497b8d

Please sign in to comment.