[CMake] Problems Building Google Test with CMake 2.6

Bogdan Cristea cristeab at gmail.com
Wed Apr 3 12:03:51 EDT 2013


On Wednesday 03 April 2013 19:54:25 Dan page wrote:
> Hello,
> 
> I am trying to use CMake 2.6 to build Google Test. As mentioned in the
> README of Google Test, I have issued following commands:
> 
>   mkdir mybuild       # Create a directory to hold the build output.
>   cd mybuild
>   cmake D:\gtest-1.6.0 #
> 
> But I get following errors:
> 
> CMake Error: CMake was unable to find a build program corresponding to
> "Visual Studio 6".  CMAKE_MAKE_PROGRAM is not set.  You probably need to
> select a different build tool.
> 
> CMake Error: Could not find cmake module
> file:/D://CMakeFiles/CmakeCXXCompiler.cmake
> 
> CMake Error: Could not find cmake module
> file:/D://CMakeFiles/CmakeCCompiler.cmake
> 
> 
> Can anyone please help? What is wrong and how to resolve this problem?
> Thanks.
> 
> D.
> --
> 
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake

The approach I usually use is to compile my unit tests together with google 
framework sources. In my cmake file I have the following line:

add_executable ( target ${SRCS} ${GTEST_DIR}/src/gtest-all.cc 
${GTEST_DIR}/src/gtest_main.cc )

GTEST_DIR is specified as command line parameter with the location of gtest 
sources.

-- 
Bogdan



More information about the CMake mailing list