[Kst] Compiling latest sources on Windows MSVC
syntheticpp at gmx.net
Tue May 8 19:00:06 UTC 2012
On 08.05.2012 18:49, David McMinn wrote:
> First up, apologies for the long rambling email :)
> I'm interested in contributing to KST (or at least seeing whether it would
> be feasible for me to do so) so I checked out the latest repository sources.
> I have the QtSDK 1.2 installed, CMake 2.8.8 and MSVC2008 Express. Following
> the instructions on the KST website I open the cmake/CMakeLists.txt file
> within QtCreator. I select the nmake MSVC 2008 x86 option and run CMake. It
> finds Qt4, creates the necessary files and completes without error.
> However, when I try to build Kst I get an error from the compiler:
> C:\David\Dev\KST\source\src\libkst\builtindatasources.cpp : fatal error
> C1083: Cannot open precompiled header file:
> 'C:/David/Dev/KST/build/qtcreator-build/src/libkst/kstcore_pch.h.pch': No
> such file or directory
> I've never used CMake before so if I'm making a mistake somewhere please let
> me know. When I track through the makefiles it looks as if I get to a point
> in src/libkst/CMakeFiles/kst2core.dir/build.make where it performs the real
> compilation of builtindatasources.cpp. I can see the command line includes
> the /Yu and /Fp compiler flags for the precompiled header. What I don't see
> is a dependency on
> "src\libkst\CMakeFiles\kst2core.dir\kstcore_pch.h.cpp.obj" which seems to be
> the target used to build the precompiled header file, and there isn't one in
> the src/libkst/CMakeFiles/kst2core.dir/depend.make file either.
> The other thing is that I am sure MSVC complains if the first thing it finds
> in the source files is not the #include "precompiled header filename.h".
> Since none of the Kst source files have that is it even worth me continuing
> trying to get MSVC to compile this with precompiled headers or should I just
> turn them off?
> If I should turn them off, what's the best way? I tried modifying the top
> level CMakeLists.txt to set
> kst_option(pch "Use precompiled headers" OFF all)
> but the kst_pch option was always reported as being ON and the build.make
> file I found earlier still had the /Yu and /Fp commands for precompiled
from QtCreator/Project you could rerun cmake and there you could pass the argument
There you could also see all the other options.
But when you wanna compile with MSVC you could use Visual Studio for developing.
I never use nmake for building Kst: developing with Studio, deploying with mingw.
Open a Visual Studio shell, add the path to qmake (set PATH=C:\Qt\...\bin;%PATH%),
create a build folder on the same level as the Kst checkout
and call within the build folder
cmake ..\kst\cmake -G"Visual Studio 10"
Open the solution file kst.sln from command line.
I'm sure this will work.
To start over the best way is to completely clean the build folder.
More information about the Kst