From 276f4019c02a8bf6baadadb25e617017df448c44 Mon Sep 17 00:00:00 2001 From: "zhanyong.wan" Date: Wed, 6 Jan 2010 18:04:55 +0000 Subject: Makes the cmake script work on Windows (by Manuel Klimek). --- CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index f181af06..95b6e16a 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 ), 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() -- cgit v1.2.3