Discussion:
New Generator for Keil uVision
(too old to reply)
Marco
2014-11-12 09:30:55 UTC
Permalink
Hello

In our development environment, we have to support multiple platforms like
Make-based, Visual Studio, Eclipse CDT and Keil uVision. CMake seems
perfect to support this. But obviously there is no generator for uVision.
Here comes the fun part: I am going to implement a generator for it :-)

Looking at the code of cmake, I identified cmGlobalGenerator and
cmLocalGenerator as a base "hock" to start off. But actually I am looking
for higer-level starting-point. Could you help me to identify one based on
the information for uVision:

uVision:

- uVision does not use makefiles.

- Multiproject Workspace: Kind of like a VisualStudio-solution. It is a
xml-file basically just naming the projects contained in to workspace.

Here's how it looks like:

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<ProjectWorkspace xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="project_mpw.xsd">

<SchemaVersion>1.0</SchemaVersion>

<Header>### uVision Project, (C) Keil Software</Header>

<WorkspaceName>WorkSpace</WorkspaceName>

<project>
<PathAndName>.\Project1\Project1.uvproj</PathAndName>
</project>

<project>
<PathAndName>.\Project2\Project2.uvproj</PathAndName>
<NodeIsActive>1</NodeIsActive>
</project>

</ProjectWorkspace>

- Then there is a project-file, also xml. One sub-section of it names the
files contained within the project.

This part looks like this:

<Groups>
<Group>
<GroupName>SOURCE_FILES</GroupName>
<Files>
<File>
<FileName>Main.cpp</FileName>
<FileType>8</FileType>
<FilePath>.\src\Main.cpp</FilePath>
</File>
<File>
<FileName>startup_stm32f10x_md_vl.s</FileName>
<FileType>2</FileType>
<FilePath>.\src\startup_stm32f10x_md_vl.s</FilePath>
</File>
</Files>
</Group>
</Groups>

- Then there is an option-file. In there, there is also some reference to
the source-files. But I guess once I am able to create the project-file
entries, generating the option-files is trivial.

If anyone could guide me to a good starting point, that would be awesome!

Thanks a lot in advance!

--
Cheers!
Marco
Brad King
2014-11-12 16:43:39 UTC
Permalink
But obviously there is no generator for uVision. Here comes the
fun part: I am going to implement a generator for it :-)
Great!
I am looking for higer-level starting-point.
[snip]
- Multiproject Workspace: Kind of like a VisualStudio-solution.
The example layout you gave looks just like the VS IDE project
file layout, assuming that there is one .uvproj file for each
exe/lib/custom target. You should model the generator based off
the VS >= 10 generator works:

cmGlobalVisualStudio10Generator
One for the whole tree, generates the .sln file

cmLocalVisualStudio10Generator
One per directory (CMakeLists.txt)

cmVisualStudio10TargetGenerator
One per logical target (exe, lib, etc.), generates .vcxproj file

-Brad
--
Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers
Marco
2014-11-13 12:41:11 UTC
Permalink
Post by Brad King
[snip]
Post by Brad King
Post by Marco
- Multiproject Workspace: Kind of like a VisualStudio-solution.
The example layout you gave looks just like the VS IDE project
file layout, assuming that there is one .uvproj file for each
exe/lib/custom target. You should model the generator based off
cmGlobalVisualStudio10Generator
One for the whole tree, generates the .sln file
cmLocalVisualStudio10Generator
One per directory (CMakeLists.txt)
cmVisualStudio10TargetGenerator
One per logical target (exe, lib, etc.), generates .vcxproj file
Thanks for your tips! I was a bit afraid that VisualStudio would be
recommended as starting-point. There is lots of inherited code there which
is rather hard to understand as a cmake-newbie-developer...

I had a look at XCode-generators and the look quit tidy. How about this as
starting-point?

--
Marco
Brad King
2014-11-13 13:32:02 UTC
Permalink
Post by Marco
Thanks for your tips! I was a bit afraid that VisualStudio
would be recommended as starting-point. There is lots of
inherited code there which is rather hard to understand as
a cmake-newbie-developer...
It's the global/local/target generator breakdown that should
be followed for a new generator. The VS generators have all
kinds of inheritance to support multiple versions. Yours
shouldn't need that level of complexity.
Post by Marco
I had a look at XCode-generators and the look quit tidy.
It uses fragile logic like a "CurrentLocalGenerator" that
is not a good example of how to organize the generation
steps. One day it may be refactored.

-Brad
--
Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers
Loading...