Re: [CMake] CMake

2010-11-29 Thread Nicola Brisotto
Hi,
I don't have much time to spend on this but looking at qmake source
code I've found this files:
http://qt.gitorious.org/qt/qt/blobs/4.6-stable/mkspecs/common/symbian/symbian.conf
http://qt.gitorious.org/qt/qt/trees/4.6-stable/mkspecs/symbian-abld

I'm not sure but it could be useful to understand how qmake generate a
project for the symbian platform.
mkspecs contains the platform specific definitions.


Nicola Brisotto



2010/9/30 Alexander Neundorf :
> On Thursday 30 September 2010, Nicola Brisotto wrote:
>> I use Qt creator with cmake for desktop application and it work well. It
>> has support for out of source build, it populate the project browser with
>> you source and header, etc My main issue is not a full Qt Creator
>> integration. My first need is build with cmake from console.
>>
>> Currently Qt support 2 toolchain: abdl and raptor.
>>
>>
>>
>> I
>>
>> > http://www.paraview.org/Wiki/CMake_Cross_Compiling
>>
>> After reading Wiley - "Porting to the Symbian Platform Open Mobile
>> Development in C and C++", chapter 2.5.2 and 2.5.3 and some tutorial I
>> understand that abdl uses 3 kind of file: 1) one bdl.inf
>> 2) one or more *.mpp file
>> 3) optionally a pkg file
>>
>> You process these files with a tool named 'bldmake' and will obtain a batch
>> file ('ABLD.BAT') and some makefiles that will build the application for
>> you.
>>
>> This tool exists mainly because a Symbian application is usually built for
>> many platforms: the emulator, using a Microsoft X86 compiler,
>> as well as the real device using a gcc-derived ARM compiler.
>>
>> The bldmake saves you from writing specially crafted makefiles for these
>> compilers and make utilities; also it allows for building many targets with
>> just a single command.
>>
>> From the bld.inf, type:
>>      > bldmake bldfiles
>>
>> Of course, you must have the PATH set correctly for the installation of the
> SDK you are using. This command will look for the bld.inf, process it and the
> related *.mmp, then generate a BATCH file named ABLD.BAT. Now you have all
> you need to build your applications. Simply type:
>>      > abld build
>>
>> This will build your application in all the available flavors.
>> Note that the target files are stored in a very deep directory structure,
>> and you are building both in debug and release versions for WINS (windows),
>> ARM4 (plain arm), ARMI (speed optimized arm), THUMB (size optimized ARM)!
>>
>> But you can choose to build for only one target, and since it take less
> time, you usually build ONLY for one version of one target. For example, to
> build for the emulator only in the debug version, or for the device,
> optimized for size, in release version, you type:
>>      > abld build wins udeb
>>      > abld buind thumb urel
>>
>> Building for Windows is enough to start the emulator and run the
>> application in the emulated environment. Application files are compiled and
>> placed straight where the emulator can run it: no need to copy them in the
>> right location.
>>
>> But for real devices, you have to pack everything in a .sis file for
> installation, send it to the phone and install the application. You are
> required to write a .pkg file to describe the installer, and then create it
> with:
>>      > makesis file.pkg
>>
>> this is a small example:
>> Here is a simple example of a bld.inf file:
>>
>> PRJ_PLATFORMS
>> DEFAULT
>> PRJ_EXPORTS
>> ..\inc\SoundTouch.h
>> ..\inc\FIFOSamplePipe.h
>> ..\inc\FIFOSampleBuffer.h
>> ..\inc\STTypes.h
>> PRJ_MMPFILES
>> SoundTouch.mmp
>>
>> This specifies that the project should generate makefiles for the default
>> platforms (currently WINSCW, ARMV5 and GCCE), export four header files and
>> build a single component which is specified in SoundTouch.mmp. The
>> corresponding MMP file looks like this:
>>
>> TARGET         SoundTouch.dll
>> TARGETTYPE   dll
>> UID               0x108D 0x0839739D
>> CAPABILITY     None
>> USERINCLUDE         ..\inc
>> SYSTEMINCLUDE     \epoc32\include \epoc32\include\stdapis
>> SYSTEMINCLUDE     \epoc32\include\stdapis\sys
>> SYSTEMINCLUDE     \epoc32\include\stdapis\stlport
>> SOURCEPATH         ..\src
>> SOURCE                 SoundTouch.cpp AAFilter.cpp
>> SOURCE                FIFOSampleBuffer.cpp FIRFilter.cpp
>> SOURCE                RateTransposer.cpp TDStretch.cpp
>> LIBRARY                euser.lib
>> LIBRARY             

Re: [CMake] CMake

2010-09-30 Thread Nicola Brisotto
I use Qt creator with cmake for desktop application and it work well. It has 
support for out of source build, it populate the project browser with you 
source and header, etc
My main issue is not a full Qt Creator integration. My first need is build with 
cmake from console.

Currently Qt support 2 toolchain: abdl and raptor.



I



> http://www.paraview.org/Wiki/CMake_Cross_Compiling

After reading Wiley - "Porting to the Symbian Platform Open Mobile Development 
in C and C++", chapter 2.5.2 and 2.5.3 and some tutorial I understand that abdl 
uses 3 kind of file:
1) one bdl.inf 
2) one or more *.mpp file
3) optionally a pkg file

You process these files with a tool named 'bldmake' and will obtain a batch 
file ('ABLD.BAT') and some makefiles that will build the application for you.

This tool exists mainly because a Symbian application is usually built for many 
platforms: 
the emulator, using a Microsoft X86 compiler, 
as well as the real device using a gcc-derived ARM compiler. 

The bldmake saves you from writing specially crafted makefiles for these 
compilers and make utilities; also it allows for building many targets with 
just a single command.
From the bld.inf, type:
 > bldmake bldfiles
Of course, you must have the PATH set correctly for the installation of the SDK 
you are using. This command will look for the bld.inf, process it and the 
related *.mmp, then generate a BATCH file named ABLD.BAT. Now you have all you 
need to build your applications. Simply type:
 > abld build
This will build your application in all the available flavors.
Note that the target files are stored in a very deep directory structure, and 
you are building both in debug and release versions for WINS (windows), ARM4 
(plain arm), ARMI (speed optimized arm), THUMB (size optimized ARM)! 
But you can choose to build for only one target, and since it take less time, 
you usually build ONLY for one version of one target. For example, to build for 
the emulator only in the debug version, or for the device, optimized for size, 
in release version, you type:
 > abld build wins udeb
 > abld buind thumb urel
Building for Windows is enough to start the emulator and run the application in 
the emulated environment. Application files are compiled and placed straight 
where the emulator can run it: no need to copy them in the right location. 

But for real devices, you have to pack everything in a .sis file for 
installation, send it to the phone and install the application. You are 
required to write a .pkg file to describe the installer, and then create it 
with:
 > makesis file.pkg

this is a small example:
Here is a simple example of a bld.inf file:

PRJ_PLATFORMS
DEFAULT 
PRJ_EXPORTS 
..\inc\SoundTouch.h 
..\inc\FIFOSamplePipe.h 
..\inc\FIFOSampleBuffer.h 
..\inc\STTypes.h 
PRJ_MMPFILES 
SoundTouch.mmp

This specifies that the project should generate makefiles for the default 
platforms (currently WINSCW, ARMV5 and GCCE), export four header files and 
build a single component which is specified in SoundTouch.mmp. The 
corresponding MMP file looks like this:

TARGET SoundTouch.dll
TARGETTYPE   dll
UID   0x108D 0x0839739D
CAPABILITY None
USERINCLUDE ..\inc
SYSTEMINCLUDE \epoc32\include \epoc32\include\stdapis
SYSTEMINCLUDE \epoc32\include\stdapis\sys 
SYSTEMINCLUDE \epoc32\include\stdapis\stlport 
SOURCEPATH ..\src 
SOURCE SoundTouch.cpp AAFilter.cpp
SOURCEFIFOSampleBuffer.cpp FIRFilter.cpp
SOURCERateTransposer.cpp TDStretch.cpp
LIBRARYeuser.lib
LIBRARYlibc.lib libm.lib libstdcpp.lib

Do we need a custom generator to recreate this process with cmake?


> http://www.itk.org/Wiki/Symbian_Carbide_Generator
I'm not sure but this generator produce a project for carbide so I need carbide 
to build a project. Is it right?

Now there is alternative tool chains called Raptor that claim to be compatible 
with the bld/mmp interface. When take a look at will advice.

___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

[CMake] CMake

2010-09-30 Thread Nicola Brisotto
Hi,
I use cmake with qt projects for desktop application. Recently I've been 
started developing for symbian.
I've found a generator for carbide but I use Qt Creator.
I would like to generate Makefile like qmake does and then build the project 
with the Symbian toolchain.
Qmake has also the support for build a sis package with the "smart installer" 
embedded, for signing app, etc. 
Can I do these tasks with cmake?


Last year at Qt dev days in Munich there was rumors about a collaboration 
between kitware and Qt Software to improve the integration between cmake and qt:
http://labs.qt.nokia.com/2009/10/12/to-make-or-not-to-make-qmake-and-beyond/
http://labs.qt.nokia.com/2009/10/14/to-make-or-not-to-make-qmake-and-beyond-redux/
Any News?

Best regards,
Nicola Brisotto
vcard







___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

[CMake] Install Export and include

2010-04-22 Thread Nicola Brisotto
Hi,
I'm building a library QXmppClient that export properties with INSTALL (EXPORT 
...)
How can I also export a variable with the include path of the library?

In the executable project I use find_package(QXmppClient). The target 
QXmppClient is imported so I can link with:
TARGET_LINK_LIBRARIES(myexecutable QXmppClient  )

This is a snippet from the QXmppClient CMakeLists.txt:

ADD_LIBRARY(QXmppClient ${SRC})
TARGET_LINK_LIBRARIES( QXmppClient ${LIB} )

INSTALL(TARGETS QXmppClient EXPORT QXmppClientConfig
DESTINATION lib/QXmppClient )
INSTALL(FILES
${Qt4_MOC}
DESTINATION include/QXmppClient)
#Export Target into include dir
INSTALL(EXPORT QXmppClientConfig DESTINATION lib/QXmppClient )


Nicola Brisotto







___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] How to build and link Externa Project with exported target

2010-04-16 Thread Nicola Brisotto
Hi Mike,
I'm back to this topic because the second solution create some problem with 
qt-creator parser of cmake project. If I import the project I have no source 
file loaded so the solution is not ok for me.
The first solution,  "create the IMPORTED targets myself", means that I have to 
put something like the code below in my main CMakeList.txt?

#QXmppClient.cmake:
# Generated by CMake 2.8.0

IF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.5)
   MESSAGE(FATAL_ERROR "CMake >= 2.6.0 required")
ENDIF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.5)
CMAKE_POLICY(PUSH)
CMAKE_POLICY(VERSION 2.6)
#
# Generated CMake target import file.
#

# Commands may need to know the format version.
SET(CMAKE_IMPORT_FILE_VERSION 1)

# Create imported target QXmppClient
ADD_LIBRARY(QXmppClient STATIC IMPORTED)

# Load information for each installed configuration.
GET_FILENAME_COMPONENT(_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
FILE(GLOB CONFIG_FILES "${_DIR}/QXmppClient-*.cmake")
FOREACH(f ${CONFIG_FILES})
  INCLUDE(${f})
ENDFOREACH(f)

# Commands beyond this point should not need to know the version.
SET(CMAKE_IMPORT_FILE_VERSION)
CMAKE_POLICY(POP)



#QXmppClient-release.cmake 
#
# Generated CMake target import file for configuration "Release".
#

# Commands may need to know the format version.
SET(CMAKE_IMPORT_FILE_VERSION 1)

# Compute the installation prefix relative to this file.
GET_FILENAME_COMPONENT(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
GET_FILENAME_COMPONENT(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
GET_FILENAME_COMPONENT(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)

# Import target "QXmppClient" for configuration "Release"
SET_PROPERTY(TARGET QXmppClient APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
SET_TARGET_PROPERTIES(QXmppClient PROPERTIES
  IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX"
  IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE 
"/devel/BIN/v4.6.1-git-phonon-dbg-release/lib/QtGui.framework;-framework 
Carbon;-framework 
AppKit;/devel/BIN/v4.6.1-git-phonon-dbg-release/lib/QtXml.framework;/devel/BIN/v4.6.1-git-phonon-dbg-release/lib/QtNetwork.framework;/devel/BIN/v4.6.1-git-phonon-dbg-release/lib/QtCore.framework;/usr/lib/libz.dylib;-framework
 ApplicationServices"
  IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libQXmppClient.a"
  )

# Cleanup temporary variables.
SET(_IMPORT_PREFIX)

# Commands beyond this point should not need to know the version.
SET(CMAKE_IMPORT_FILE_VERSION)


On Mar 17, 2010, at 13:41 , Michael Wild wrote:

> 
> On 17. Mar, 2010, at 13:17 , Nicola Brisotto wrote:
> 
>> Hi!
>> I'm building a project that require a 3rd party library libqxmpp. Both 
>> project uses cmake 
>> I want to build libqxmpp with ExternalProject_add, this the code I use:
>> 
>> ExternalProject_add(
>>  libqxmpp
>>  #no download, i'm using git submodule
>>  DOWNLOAD_COMMAND ""
>>  CMAKE_ARGS 
>> -DQT_QMAKE_EXECUTABLE=/devel/BIN/v4.6.1-git-phonon-dbg-release/bin/qmake 
>> -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}
>>  SOURCE_DIR ${CMAKE_SOURCE_DIR}/src/3rdparty/qxmpp-read-only-git/source
>> )
>> 
>> The problem arise when I try to import a target from libqxmpp adding this to 
>> my project CMakeLists.txt:
>> #Import libQXmppClient 
>> include(${CMAKE_BINARY_DIR}/include/QXmppClient/QXmppClient.cmake)
>> 
>> Cmake cannot find QXmppClient.cmake because it will be created when I'll 
>> build the project.
>> How can I solve this problem? Are there better solution to build and link an 
>> external project?
>> 
>> This is the libqxmpp snippet that export the target:
>> 
>> INSTALL(TARGETS QXmppClient EXPORT QXmppClient DESTINATION lib)
>> INSTALL(EXPORT QXmppClient DESTINATION include/QXmppClient )
>> 
>> Nicola Brisotto
>> vcard
> 
> There are two ways of getting around this:
> 
> 1) create the IMPORTED targets yourself.
> 
> 2) also build your main project wit a ExternalProject_Add and drive the whole 
> thing from a "master-CMakeLists.txt"
> 
> The first one is probably easier to set up, but requires you to guess the 
> installation names and paths correctly. The second option requires you to 
> restructure your whole build system and adds considerable complexity due to 
> the communication between your master-project and the external projects. For 
> this communication I'd try the fo

Re: [CMake] How to build and link Externa Project with exported target

2010-03-19 Thread Nicola Brisotto
Hi,
the solution with a master CMakeLists.txt works well but now I don't
know how to write wrapper for OPTION and SET functions, can you give
me an example?
I'm quite new to cmake so another question is:
what is the diffence between create a xxx-config and the file I create
with INSTALL(EXPORT QXmppClient DESTINATION include/QXmppClient ) ?
They seem to do the same thing but probably I'm missing something

Nicola Brisotto



On Wed, Mar 17, 2010 at 8:44 PM, Alexander Neundorf
 wrote:
> On Wednesday 17 March 2010, Michael Wild wrote:
>> On 17. Mar, 2010, at 15:43 , Luigi Calori wrote:
> ...
>> > Is this ExternalProject_Add feature really used/developed?   I find it
>> > really nice but a little scared of weather it will be really supported
>> > and improved. I have done some patching on it but not know if there is a
>> > group of user/developer eventually interested to submit mods to
>>
>> It is actively used and developed, but also relatively new. If you have
>> improvements, it's best to create a tracker item with a patch and
>> description there and post the link to the item on this list.
>
> Yes. And git support for it would be a really nice thing to have :-)
>
> Alex
> ___
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] How to build and link Externa Project with exported target

2010-03-17 Thread Nicola Brisotto
Hi!
I'm building a project that require a 3rd party library libqxmpp. Both project 
uses cmake 
I want to build libqxmpp with ExternalProject_add, this the code I use:

ExternalProject_add(
libqxmpp
#no download, i'm using git submodule
DOWNLOAD_COMMAND ""
CMAKE_ARGS 
-DQT_QMAKE_EXECUTABLE=/devel/BIN/v4.6.1-git-phonon-dbg-release/bin/qmake 
-DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}
SOURCE_DIR ${CMAKE_SOURCE_DIR}/src/3rdparty/qxmpp-read-only-git/source
)

The problem arise when I try to import a target from libqxmpp adding this to my 
project CMakeLists.txt:
#Import libQXmppClient 
include(${CMAKE_BINARY_DIR}/include/QXmppClient/QXmppClient.cmake)

Cmake cannot find QXmppClient.cmake because it will be created when I'll build 
the project.
How can I solve this problem? Are there better solution to build and link an 
external project?

This is the libqxmpp snippet that export the target:

INSTALL(TARGETS QXmppClient EXPORT QXmppClient DESTINATION lib)
INSTALL(EXPORT QXmppClient DESTINATION include/QXmppClient )

Nicola Brisotto
vcard







___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

[CMake] Autotools conversion: case statement

2009-12-17 Thread Nicola Brisotto
  fi
AC_DEFINE(THREAD_LOCAL_ALLOC)
AC_MSG_WARN("Explicit GC_INIT() calls may be required.");
AC_DEFINE([GC_DGUX386_THREADS], 1,
  [Define to enable support for DB/UX threads on i386.])
AC_DEFINE([DGUX_THREADS], 1,
  [Define to enable support for DB/UX threads.])
# Enable _POSIX4A_DRAFT10_SOURCE with flag -pthread
INCLUDES="-pthread $INCLUDES"
;;
 aix)
THREADS=posix
THREADDLLIBS=-lpthread
AC_DEFINE(GC_AIX_THREADS)
AC_DEFINE(_REENTRANT)
;;
 decosf1 | irix | mach | os2 | solaris | dce | vxworks)
AC_MSG_ERROR(thread package $THREADS not yet supported)
;;
 *)
AC_MSG_ERROR($THREADS is an unknown thread package)
;;
esac


Nicola Brisotto
vcard







___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

[CMake] Use a custom linker

2009-12-11 Thread Nicola Brisotto
Hi,
I want to crosscompile a project. I created a  toolchain file. But I've 
problems because the linking step use the compiler to link. My need to uses 
another tool to link.
How can I force cmake to use  a different linker?

I've posted also on stackoverflow: 
http://stackoverflow.com/questions/1867745/cmake-use-a-custom-linker

Nicola Brisotto
vcard







___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake