CMake Generator Specific Information: Difference between revisions

From KitwarePublic
Jump to navigationJump to search
(Replace content with link to new CMake community wiki)
 
(62 intermediate revisions by 17 users not shown)
Line 1: Line 1:
==KDevelop3 Generator==
{{CMake/Template/Moved}}


[[Image:CMakeKDevelop3GeneratorScreendump.png|thumb|right|350px|KDevelop opens CMake project file]]
This page has moved [https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/Generator-Specific-Information here].
 
<b>KDevelop3 is in alpha state, so use it carefully.</b>
Available in CVS as of October 12th 2004. Currently only reported to work in KDevelop 3.0.4.
 
Beside creating all the same files as UNIX Makefile generator, it creates in the toplevel binary directory files:
 
Project.kdevelop
Project.kdevelop.filelist
 
The first one is XML describing the project, while the second one is a list of relative paths to the source files. The source files are grouped based on globbing expression in the XML file.
 
===Some random thoughts===
 
Alex Neundorf wrote a patch for CMake ( http://www.cmake.org ) that adds KDevelop generator for CMake. What this means is that CMake can generate project files for KDevelop.
 
That said, we ran into a bit of trouble. The problem is that so far we could not figure out a way for sources to be in one directory and all build files being in another. That includes all KDevelop files.
 
Why is this good? Well, several reasons. First one, to remove all the build files (generating tar, doing CVS etc, start all over), all you do is to remove build tree. Also, sometimes sources are located in a readonly partition (such as CD-ROM, /usr/share/doc/... etc). Another problem is when you use the same source tree for different build trees. In that case, the source has to provide all KDevelop files, which may not be acceptable.
 
So, I played with the Alexes patch and managed to get it working by doing the following:
 
# Create two files: Project.kdevelop and Project.kdevelop.filelist
# In Project.kdevelop put all necessary XML stuff including the projectdirectory tag that points to the build tree
# In the Project.kdevelop.filelist I had relative paths to actual source files
 
So, it worked fine with couple of problems.
 
# I can build fine
# I can use File Groups to browse through the list of source files
# CVS, Subversion etc do not work since they try to update build tree
# File tree shows build tree and I cannot see the source files.
 
The possible solutions:
 
1. Write Project.kdevelop.filelist to source tree and point projectdirectory to the source tree
+ simple to implement
+ everything works
- need writable source tree
- you cannot use same source tree for different builds except if exactly the same files are used in all of them (no conditional compiling)
 
2. Add support for specifying directory for CVS, Subversion, and File tree
+ More clean integration
+ No pollution of source tree
- Require individual settings for all possible modules (CVS, Subversion...)
- Require modification of KDevelop
 
3. Have actual sourceDirectory and buildDirectory distinction.
+ The cleanest integration
+ No pollution of source tree
- Require modification of KDevelop
 
==NMake Makefiles using Visual Studio 8 free version (aka VC Express)==
 
===Rationale===
For the free version, 'Microsoft VC Express' and 'Microsoft Platform SDK' have to be installed separately
The batch file for the 'Visual Studio 2005 Command Prompt' must be update to include the path, the include directory, and the libraries to find Microsoft Platform SDK.
 
===Instructions===
Download VC Express *and* Platform SDK from htpp://www.microsoft.com.
Install them in C:\Program Files.
The license expires one year after your start using it.
 
Create a batch file called 'VS8_Command_Prompt.bat' in your home directory (for example in C:\cygwin\home\my_username\Bin). Edit this file and type:
 
@echo off
 
@set PATH=C:\Program Files\Microsoft Platform SDK\Bin;%PATH%
@set INCLUDE=C:\Program Files\Microsoft Platform SDK\Include;%INCLUDE%
@set LIB=C:\Program Files\Microsoft Platform SDK\Lib;%LIB%
 
if not exist "C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat" goto missing
echo call "C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat"
call "C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat"
goto :eof
 
:missing
echo Missing file
echo "C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat"
goto :eof
 
Create a Windows shortcut called "VS8_Command_Prompt" in your Desktop.
Right click and go to Properties.
Edit the shortcut tab (replace x86 by your processor type):
Target: %comspec% /k ""C:\cygwin\home\Sylvain\Bin\VS8_Command_Prompt.bat"" x86
Start in: C:\cygwin\home\my_username\Bin
 
Double-click on your VS8_Command_Prompt shortcut.
Go to your build directory.
cd my_build_directory
 
Use CMakeSetup.exe (replace 2.2 by your CMake version)
\Program Files\CMake 2.2\bin\CMakeSetup.exe <my_source_directory>
 
Click 'Configure' in the CMake Window
Select 'Build for: NMake Makefiles'
Set the CMake variables, click 'Configure', and then 'Ok'.
 
Check you have a Makefile in your build directory.
In the VS8_Command_Prompt, cd to your build directory, and type:
nmake
 
{{CMake/Template/Footer}}

Latest revision as of 15:41, 30 April 2018


The CMake community Wiki has moved to the Kitware GitLab Instance.

This page has moved here.