Re: CMake build system

anael wrote:

The Xcode for mac is generated.
But there is some error when compiling :

STEPFile.h "STEPFile.h:198:64: Use 'template' keyword to treat 'To' as a dependent template name"

That is weird. Can you post the verbose compile console output (gcc -I./ -L./ STEPFileReader.cpp -o STEPFileReader.o bla bla) that SCons and CMake use to compile STEPFileReader.cpp so we can compare them? It would make it easier to fix the error if I could understand what CMake do different from SCons.

anael wrote:

I don't have errors with Assimp when building with Scons, but maybe we don't use the same version, did you update the Assimp lib ?

Maybe missing the flags "ASSIMP_BUILD_BOOST_WORKAROUND ASSIMP_BUILD_NO_OWN_ZLIB" ?

The code is identical to SVN revision 220, I haven't updated anything. The flags ASSIMP_BUILD_BOOST_WORKAROUND and ASSIMP_BUILD_NO_OWN_ZLIB is being defined in 3rdparty/assimp/CMakeLists.txt.

anael wrote:

Additionally (but not related to the previous error), I didn't see the flag :
"M_PACKAGE_WRITABLE" for maratisEditor (not needed for the player)

Yup. That was an ommision by me. It is fixed now.

anael wrote:

I'm also not sure the runpath search path is defined (depending on the dylib installation path) but should be "@rpath"
or "@executable_path/../Frameworks @loader_path/../Frameworks"

I've gone through and tried to fix all rpaths. Don't know if I did them right.

anael wrote:

With the ios option it stops before generating the xcode project :

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
OPENGL_LIBRARY
    linked by target "MaratisApp" in directory /Users/anaelseghezzi/Desktop/Maratis-ios/M/Additional/iOS

Ok, that is the build system not finding OpenGLES, should probably add a separate OPENGLES_LIBRARY variable instead of reusing the OpenGL one so that the error become more obvious. I have now added better checks.

It's a bit frustrating for me not to have access to a Mac so I can catch all these stupid mistakes myself... wink

Last edited by Dahnielson (2014-02-12 16:43:18)

Re: CMake build system

Tutorial Doctor wrote:

I just went to the wiki just now, you changed that Dahnielson? If so, it looks nice!

I think all the pages need a bit of reformatting. I haven't added anything in a while, trying to get stuff to work first.

Good to have you here also.

Yes, I reorganized and styled it a bit to make it clearer. I started to add some templates so that common stuff can be styled much easier at one place and making writing good looking wiki pages much simpler.

Re: CMake build system

Hi !

I should look again to be sure, but I didn't find the flags "ASSIMP_BUILD_BOOST_WORKAROUND ASSIMP_BUILD_NO_OWN_ZLIB" anywhere in the xcode project, or I missed it or it didn't get generated ?

Re: CMake build system

Btw, I realized that I tried to include the CMake toolchain files the wrong way (when I played around with an Android build). Updated the instructions for iOS:

iOS
---

To generate an Xcode project for building Maratis for iOS, peform the following
steps to create a build directory outside of the source tree:

  mkdir Build
  cd Build
  cmake -G XCode -DCMAKE_TOOLCHAIN_FILE=../Maratis/CMake/Toolchains/iOS.cmake \
     ../Maratis

Assuming the Maratis source directory resides in the same top directory. The
build require that the Xcode generator is used or it will protest with a fatal
error and quit

Last edited by Dahnielson (2014-02-11 14:45:23)

Re: CMake build system

anael wrote:

I should look again to be sure, but I didn't find the flags "ASSIMP_BUILD_BOOST_WORKAROUND ASSIMP_BUILD_NO_OWN_ZLIB" anywhere in the xcode project, or I missed it or it didn't get generated ?

Have you tried create a new build directory to run cmake completely fresh in? Yes, I know it's a solution similar to "Have you tried to turn your computer on and off?" wink

If that doesn't work, can you try replacing

ADD_DEFINITIONS(
  -DASSIMP_BUILD_BOOST_WORKAROUND
  -DASSIMP_BUILD_NO_OWN_ZLIB
)

with

SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DASSIMP_BUILD_BOOST_WORKAROUND -DASSIMP_BUILD_NO_OWN_ZLIB")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DASSIMP_BUILD_BOOST_WORKAROUND -DASSIMP_BUILD_NO_OWN_ZLIB")

and see if the flags are picked up?

Last edited by Dahnielson (2014-02-11 12:10:43)

Re: CMake build system

Actually, I checked the xcode again and the flag is there, so it's not that.

I checked the settings and tried different fixes but I don't understand what is the problem,
it might be an issue with the Clang compiler or with c++11 standard, but if I switch to gcc there is some different errors,
or it's a dependency problem.

Assimp code is not very attractive, specially to debug.

I will check deeper, but I need to go to Paris for some work, till Saturday,
so I'll come back to you later when I'm back home.

Re: CMake build system

Hi,

I fixed some compilation errors related to CLANG and OSX Maverick : https://code.google.com/p/maratis/source/detail?r=223
for the current Maratis svn version and for your cmake version.

Now with cmake/xcode, when compiling I just have some errors with DevIL,
first I found that the header search paths where apparently missing, but sill something is wrong.

Re: CMake build system

Hi,

I managed to build your version on linux,
the file "config_types.h" was missing in libogg, but it was easy to correct manually.

But after calling make install the application is not finding libMCore.so, there is probably a problem with the rpaths.

Re: CMake build system

ok it works by adding "$ORIGIN/" to CMAKE_INSTALL_RPATH :

SET(CMAKE_INSTALL_RPATH "@loader_path/.;$ORIGIN/")"