summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2010-01-06 18:04:55 +0000
committerzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2010-01-06 18:04:55 +0000
commitdfd39e29ee3a37a886c49a17a861e59e802567c8 (patch)
treedc9c7dd78030290bf198d4c674f335e27d04d449 /CMakeLists.txt
parent65f2a9cdf36ec41249e8d1145fc8fcc69fa314e5 (diff)
downloadgoogletest-dfd39e29ee3a37a886c49a17a861e59e802567c8.tar.gz
Makes the cmake script work on Windows (by Manuel Klimek).
git-svn-id: http://googletest.googlecode.com/svn/trunk@363 861a406c-534a-0410-8894-cb66d6ee9925
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt8
1 files changed, 6 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f181af0..95b6e16 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -33,7 +33,7 @@ link_directories(
# Defines the compiler/linker flags used to build gtest. You can
# tweak these definitions to suit your need.
if (MSVC)
- set(cxx_base "${CMAKE_CXX_FLAGS} -GS -W4 -WX -wd4275 -RTCs -RTCu -nologo -J
+ set(cxx_base "${CMAKE_CXX_FLAGS} -GS -W4 -WX -wd4275 -nologo -J
-Zi -D_UNICODE -DUNICODE -DWIN32 -D_WIN32 -DSTRICT
-DWIN32_LEAN_AND_MEAN")
set(cxx_default "${cxx_base} -EHsc -D_HAS_EXCEPTIONS=1")
@@ -218,9 +218,13 @@ endif()
# test/name.py. It does nothing if Python is not installed.
function(py_test name)
if (PYTHONINTERP_FOUND)
+ # ${gtest_BINARY_DIR} is known at configuration time, so we can
+ # directly bind it from cmake. ${CTEST_CONFIGURATION_TYPE} is known
+ # only at ctest runtime (by calling ctest -c <Configuration>), so
+ # we have to escape $ to delay variable substitution here.
add_test(${name}
${PYTHON_EXECUTABLE} ${gtest_SOURCE_DIR}/test/${name}.py
- --gtest_build_dir=${EXECUTABLE_OUTPUT_PATH})
+ --gtest_build_dir=${gtest_BINARY_DIR}/\${CTEST_CONFIGURATION_TYPE})
endif()
endfunction()