cmake/ctest: output test binaries to debug/release folders on windows.
authorRay Molenkamp <github@lazydodo.com>
Fri, 17 Aug 2018 16:04:55 +0000 (10:04 -0600)
committerRay Molenkamp <github@lazydodo.com>
Fri, 17 Aug 2018 16:04:55 +0000 (10:04 -0600)
debug/release builds were writing the binaries to the same folder

CMakeLists.txt

index f6435316fec1f64767f063fa8e03ba0cce4982b6..7c07d5e94ece93a5131c06bd03aee92865263e13 100644 (file)
@@ -115,7 +115,11 @@ enable_testing()
 
 set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin CACHE INTERNAL "" FORCE)
 set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib CACHE INTERNAL "" FORCE)
-set(TESTS_OUTPUT_DIR ${EXECUTABLE_OUTPUT_PATH}/tests CACHE INTERNAL "" FORCE)
+if(MSVC)
+       set(TESTS_OUTPUT_DIR ${EXECUTABLE_OUTPUT_PATH}/tests/$<CONFIG>/ CACHE INTERNAL "" FORCE)
+else
+       set(TESTS_OUTPUT_DIR ${EXECUTABLE_OUTPUT_PATH}/tests/ CACHE INTERNAL "" FORCE)
+endif()
 
 #-----------------------------------------------------------------------------
 # Set default config options