I am currently devoloping a Python 2.7 frontend using SWIG for a C++ project configured by CMAKE (not developed by myself, I just started CMAKE for this project). The project compiles (and runs) fine under VS2010 using FIND_PACKAGE for python and swig. However, python 2.7 (and other releases) is compiled using the VS2008 compiler, which is not binary compatible with VS2010. I have installed the Windows SDK 7 compiler, and I can compile another SWIG project (without CMAKE) using distutils. Trying to configure the actual project with CMAKE for Visual Studio 2008, fails with:
xxx> cmake . -G "Visual Studio 9 2008"
CMake Error: CMake was unable to find a build program corresponding to "Visual Studio 9 2008". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: Could not find cmake module file: xxx/CMakeFiles/2.8.12/CMakeCXXCompiler.cmake
CMake Error: Could not find cmake module file: xxx/CMakeFiles/2.8.12/CMakeCCompiler.cmake
(I replaced my actual path with xxx)
This happens both in the Windows-SDK shell, as well as in a normal shell.
Has anybody configured a CMAKE project successfully for Windows SDK 7 compiler, when another VS version is installed? If yes, how? Finally I would rather use a CMAKE configured python distutils build, than build the project using a generated .sln file. Hence, creating a VS2008 .sln / .prj is not important.
More precisely, the default path where you'll find the compiler is C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin .
Building CMake projects Select the preferred configuration and press F5, or choose the Run (green triangle) button on the toolbar. The project automatically builds first, just like a Visual Studio solution. Right-click on CMakeLists. txt in Solution Explorer and select Build from the context menu.
C++ compiler and linker options are located under the C/C++ and Linker nodes in the left pane under Configuration Properties. These options translate directly to command-line options that will be passed to the compiler. To read documentation about a specific option, select the option in the center pane and press F1.
I would just open the SDK command prompt, so the cl.exe you want (in the VS 2008 install directory) is in PATH (you can check this is the case with where cl
).
Then just run CMake and let it generate NMake makefiles:
mkdir build && cd build
cmake .. -G "NMake Makefiles"
This should ensure your compiler of choice is used.
If this doesn't work either, the SDK (or VS) should come with a tool to make a certain SDK version "current".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With