Unknown CMake command "generate_from_xml"

Having trouble installing or compiling FreeCAD? Get help here.
jmaustpc
Posts: 9615
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Unknown CMake command "generate_from_xml"

Postby jmaustpc » Sun Aug 21, 2011 8:12 am

Hi all.

Trying to compiling FreeCAD svn 4781 on Kubuntu 32 Bit Linux 11.04

Cmake_Gui configure gives the following error: -

CMake Error at Base/CMakeLists.txt:59 (generate_from_xml):
Unknown CMake command "generate_from_xml".


Hence it would not generate the make files (i.e. the button was still gray'ed out.

Note: Error was originally line 57 but Cmake_Gui had also came up with an error asking for the minimum Cmake version to be included at the beginning of the above file (and in another similar file somewhere else) with an example of the code for a minimum Cmake 2.8. which I just copied and pasted into the begining of the two files in question and then added a blank line. Hence the error moved from line 57 in the svn version to 59 in my version.


Questions
1) is this a known problem/limitation? can someone help me fix it so I can compile it, without me being a pain?
2) I think you fellas might be mostly developing FreeCad from Windows machines? But either way, would it be useful to you guys and the development process if I download the svn code and attempt to compile it on my Kubuntu 32bit (and or 64Bit) and let you know if it works on some sort of regular basis?
3) would it be a good idea to just put a default minimum Cmake version in the appropriate files in svn so that Cmake_Gui will stop complaining about it? Of course, I could just click the tick box under "options" menu "--suppress_dev_warnings".
4) default install location. Cmake_gui has a configuration parameter CMAKE_INSTALL_PREFIX /usr/local/ My understanding is that this is the directories to perpend to the "install" directories specified by the devs of a project. Is it Cmake that defaults to this location or is it a default location set by the application (in this case freecad) source code etc., when Cmake_Gui looks at it? I ask because the "README.Linux" file says

FreeCAD's default root directory
is $HOME/FreeCAD, so you don't need root privileges therefore. To run FreeCAD go to
$PREFIX/FreeCAD/bin and type in ./FreeCAD.


By which I thought you were saying that the normal default install location for all the compiled application files would be normally be in the user's home folder /FreeCAD . With the logic that mostly an svn compiled version would be wanted to be tested briefly but probably not kept for long, so being in "usershome"/FreeCAD means that one could just delete that folder (or its contents) and be confident that the system would be cleaned of that specific version of freecad. Assuming that in a day or so one would be compiling another version, for further testing. Also one would change this from the "default perpend folder" to something else, if one wanted have two different versions simultaneously installed. But when I follow the Readme.Linux instructions it does in fact by default sent it to the above /usr/local, although that could be Cmake (or me) doing that.

Out of interest, the package manager installs various freecad files from the PPA .DEB package into /usr/bin , /usr/lib/ and /usr/share.



Jim

More CMAKE-Gui details, probably of little relevance

I ran Cmake_Gui
I entered the following in "source location": -
"my down loaded to folder location then" /trunk/src

Build location: -
"my down loaded to folder location then" I created /build

Hit configure button and got the follow output and error message: -

The C compiler identification is GNU
The CXX compiler identification is GNU
Check for working C compiler: /usr/bin/gcc
Check for working C compiler: /usr/bin/gcc -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working CXX compiler: /usr/bin/c++
Check for working CXX compiler: /usr/bin/c++ -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Boost version: 1.42.0
-- Boost found: TRUE
The Fortran compiler identification is GNU
-- Build 32bit
CMake Error at Base/CMakeLists.txt:59 (generate_from_xml):
Unknown CMake command "generate_from_xml".



Configuring incomplete, errors occurred!
User avatar
jriegel
Site Admin
Posts: 3369
Joined: Sun Feb 15, 2009 5:29 pm
Location: Ulm, Germany
Contact:

Re: Unknown CMake command "generate_from_xml"

Postby jriegel » Sun Aug 21, 2011 8:35 pm

Mhh, "generate_from_xml" is a macro defined in FreeCadMacros.cmake which should be included.
Did you maybe accidentally deleted the include?
Stop whining - start coding!
jmaustpc
Posts: 9615
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Unknown CMake command "generate_from_xml"

Postby jmaustpc » Mon Aug 22, 2011 5:25 am

Hi

I looked in "my down loaded to folder location then" /trunk/cMake/ and found FreeCadMacros.cmake

I opened it in Kate, searched for "generate_from_xml" and , as you said, there is a section about "generate_from_xml".

Am I correct in that Freecad should all compile at once or do I have to compile parts of it first, like the modules, or something?

Was I correct to to point cmake_gui to "my down loaded to folder location then" /trunk/src (i.e. where cmake_gui says "where is the source code")?

Jim
wmayer
Site Admin
Posts: 15259
Joined: Thu Feb 19, 2009 10:32 am

Re: Unknown CMake command "generate_from_xml"

Postby wmayer » Mon Aug 22, 2011 7:09 am

Hi Jim,

obviously you picked the wrong location as source directory. I guess you used FreeCAD/src but this is wrong, instead you have to go one level up. If you look into the CMakeLists.txt there you will also find the minimum version stuff.

Sure, Jürgen and I almost develop on Windows but I compile also very frequently under Linux and from time to time even develop there. Others like logari81 and Luke seem to develop mainly/only under Linux.

The default install location is set by cmake. We can override this if needed. The default location installation to $HOME/FreeCAD is that one of automake. There is a major difference between cmake builds and autotools builds. For cmake there is no "make install" needed because the right directory structure is already created with a normal "make". With autotools this is not possible and thus requires a "make install".

The reason why we use the home directory as default installation directory is you don't need root privileges and you don't pollute your system with files because if you decide later to uninstall FreeCAD it may fail to remove all files later. Sure, a "make uninstall" should work but what if the build directory has been removed or files have been renamed, ...? Installing everything under HOME is much nicer because you have to delete one directory.
Out of interest, the package manager installs various freecad files from the PPA .DEB package into /usr/bin , /usr/lib/ and /usr/share.
This is done by setting certain configure switches. And un-installing is much safer because it's the package manager that removes the files, not the build system.

Werner
jmaustpc
Posts: 9615
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Unknown CMake command "generate_from_xml"

Postby jmaustpc » Mon Aug 22, 2011 12:52 pm

Thanks for your time replying guys. :)

You are both correct, hardly surprising, what was happening was that I was pointing Cmake to the wrong source directory, BUT ... the reason why is that there was no CMakeLists.txt in the correct directory.... and from there I let myself get confused!!! :)

Thanks, Warner, for your explanation about the directories, and cmake etc.. I understand now.

I used KDESVN to down load the svn version. I will try a few things and get back to you if I find any problems.

Can I ask one more thing?

I found the icons folder and contents in the source code. But what happens to these picture files when freecad is installed in my system?

I search my file system from /, assuming that I would find a directory/ies somewhere with icon files, but it didn't, except the ones associated with some of the modules that have their own icon files, like Arch.

I read freecad's web site's instructions related to creating icons. I will have a go at making some, but unless I missed it somewhere, I can't see any instructions for how to load these into freecad to try them out, i.e. see what they look like in situ/to scale etc..

I worked out how to add an existing icon from the selection offered by Freecad, to my macro and add it to my new custom tool bar. But not an icon which I may have created myself/or found elsewhere.

What I was thinking I would initially do is make an icon and then just associate it with my macro in my custom tool bar, and then I can see what it looks like in situ/to scale etc.. Unless there is a better way?


Jim
wmayer
Site Admin
Posts: 15259
Joined: Thu Feb 19, 2009 10:32 am

Re: Unknown CMake command "generate_from_xml"

Postby wmayer » Mon Aug 22, 2011 2:08 pm

Our GUI toolkit library Qt offers a nice resource framework which allows to built-in any icons or other resources. There are several .qrc files which mainly contains icons and translation files. Then the utility "rcc" creates a C++ file out of it which can be integrated into the build process.
Later Qt finds these resources by prepending a colon to the path name. This way you don't have to care about installing icons because they are inside the binaries already.
What I was thinking I would initially do is make an icon and then just associate it with my macro in my custom tool bar, and then I can see what it looks like in situ/to scale etc.. Unless there is a better way?
Since the icon files are not in the file system it's good to do it the way you do.
jmaustpc
Posts: 9615
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Unknown CMake command "generate_from_xml"

Postby jmaustpc » Tue Aug 23, 2011 2:29 am

It worked!! I got it to compile successfully!!!!! :D

After having done so probably 5 million times before, you guys probably don't find this quite as exciting as I do. :D

I have not yet worked out why KDESVN didn't seem to download all the files. For now, I just viewed the repository with the web front end and downloaded the trunk tar.gz file and went from there.

Thanks for your help.

Jim
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Unknown CMake command "generate_from_xml"

Postby NormandC » Tue Aug 23, 2011 4:12 am

Hi Jim,

It is not that hard to use the console to do a svn checkout, in this case a GUI is not really useful. All you need to paste in the terminal is this:

Code: Select all

svn co https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk freecad
This will download all the content of trunk into a freecad folder, wherever your current directory is (by default the terminal opens in $HOME).

And the terminal keeps a history of previously entered commands. Hit the UP arrow key repeatedly to cycle through them, so you don't need to type or copy-paste this everytime.

After compiling a lot of times, I am now quite content to get my updates through the PPA, even though I sometimes have to wait 24-48 hours for the latest cool commit. I don't want to spend my time compiling, bur rather using FreeCAD. :)
wmayer
Site Admin
Posts: 15259
Joined: Thu Feb 19, 2009 10:32 am

Re: Unknown CMake command "generate_from_xml"

Postby wmayer » Tue Aug 23, 2011 7:48 am

The lengthy line Normand posted is only needed the very first time. After that you can simply do a:

Code: Select all

svn up
jmaustpc
Posts: 9615
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Unknown CMake command "generate_from_xml"

Postby jmaustpc » Tue Aug 23, 2011 1:06 pm

Hi Fellas

thanks again.

I had originally tried svn etc. from the command line, but it didn't work, .... because it wasn't installed .. so I installed a couple of graphical apps. Seems like I should have stuck to the command line. :D

I decided to start learning to write software today. So for somewhere to start I decided to write a python macro to allow one to enter a URL and have that web page open in Freecad, when using the web workbench, rather than just the Freecad home page.

I managed to get it to work! Its not elegant, complete or anything, but I am feeling pretty happy because it actually works.

I now have an icon on a tool bar which I can click, a window pops up for one to type the web address, my macro adds the text "http://" opens a "window thingy" in Freecad and goes to the web page. Thus I could use Freecad to search Google for instructions on how to do something else in Python or whatever.

I then started getting the macro to look at what I had typed and only add the text "http://" if I had not already done so. But I ran out of time before I had that working.

Anyway I will keep learning how to write in Python and I will let you know if I get anywhere with anything worth while for Freecad.

good night

Jim