cmake port

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
wmayer
Founder
Posts: 20309
Joined: Thu Feb 19, 2009 10:32 am
Contact:

cmake port

Post by wmayer »

Hi Jürgen,

today I tried the cmake branch under Ubuntu. The configuration step stopped at the check for zlib. The error message is:
-- Found Xerces-C: /usr/lib/libxerces-c.so
CMake Error at CMakeLists.txt:71 (find_package):
Could not find module FindZlib.cmake or a configuration file for package
Zlib.

Adjust CMAKE_MODULE_PATH to find FindZlib.cmake or set Zlib_DIR to the
directory containing a CMake configuration file for Zlib. The file will
have one of the following names:

ZlibConfig.cmake
zlib-config.cmake



-- Configuring incomplete, errors occurred!
make: *** [cmake_check_build_system] Fehler 1


On my system there is neither a file ZLibConfig.cmake, nor zlib-config.cmake nor a FindZLib.cmake. And FindZlib.cmake is the only file that I found in the web but putting it into the cmake folder doesn't fix the problem? However, when commenting out the line find_package(Zlib REQUIRED) I don't get an error any more. Any ideas?

Second: Under Linux I need two defines for all project files: -DHAVE_STD_IOSTREAM and -DUSE_STD_IOSTREAM. For autoconf this can be done in configure.ac which creates then the file config.h where these defines are there. What is the way in cmake to do so? Can I let cmake create the config.h with the needed defines or is it possible to make global defines?


At least, after fixing one or two things I am able to build the Base and App modules.

Werner
wmayer
Founder
Posts: 20309
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: cmake port

Post by wmayer »

I have solved the problems. Package names are case-sensitive so that Zlib must be rewritten to ZLIB. For the further defines I've found a way similar to autotools where a config.h can be created providing these defines. This works quite well. So, at the moment the cmake port of FreeCAD compiles completely FreeCADBase and FreeCADApp.
tpikonen
Posts: 2
Joined: Tue Jul 07, 2009 2:32 pm

Re: cmake port

Post by tpikonen »

Hi,

What's the preferred build system for Freecad at the moment (and in the Future)? Are the CMake scripts in a usable state for building yet?
User avatar
jriegel
Founder
Posts: 3369
Joined: Sun Feb 15, 2009 5:29 pm
Location: Ulm, Germany
Contact:

Re: cmake port

Post by jriegel »

Hi,
the prefered Build system on Linux is still Autotools maintained be Werner.
But I think he also get good results with cMake allready.

On Windows the standard is still Visual Studio (Express). But I will soon switch to cMake.

Jürgen
Stop whining - start coding!
Post Reply