[CMake] re: Compile only, no link

jean-daniel.michaud at uk.bnpparibas.com jean-daniel.michaud at uk.bnpparibas.com
Mon Mar 3 06:15:07 EST 2008


>On Wednesday 27 February 2008, jean-daniel.michaud at uk.bnpparibas.com
wrote:
>> Hello,
>>
>>   I'd like to know if it's possible to create a project, add source
files
>> to it, make those sources compile to objects, but do not create any
>> executable or library.
>>   Something like:
>>
>> PROJECT(someproject)
>> ADD_SOURCE_FILE(this.cpp that.cpp)
>> # define some c flags here
>> COMPILE_SOURCE
>>
>>   And after the make, I would end up with this.o and that.o, but no
>> executable.
>>   I can't use custom command, because, I'd like the CMakeFiles to
produce
>> some proper IDE project files, with the source files in it.
>>   Can't find anything in the mailing list or doc to do this trivial
thing.
>
>You could build a static library, which is basically just a container for
>object files. Would that help ?
>
>Alex

Hi Alex, thx for your answer.

Well, It's not what I'am thinking of.

We have a project tree like this:

project A: generate A.exe (link with sub project lib)
  project A1: generate somelib.a (link with sub project objects)
    project A1'  : generate toto.o titi.o
    project A1'' : generate tata.o tutu.o
  project A2: generate someotherlib.a
  etc...

Ok, this is silly, but this is legacy and we can't/don't want to change
that. We are using some crappy IDE now that uses project files that I'am
parsing and create a CMakeFile equivalent. The idea is then to have Eclipse
project files that emulates the exact project tree we have today.

That's why I have projects that produce .o only. So the idea is to separate
the definition of what a project is (a group of source files) and what it
produces (executable, library or nothing). The problem I have with
CMakeFile now is that I don't see how I can define a project without
defining what it produces.

Thanks.

JD



This message and any attachments (the "message") is
intended solely for the addressees and is confidential. 
If you receive this message in error, please delete it and 
immediately notify the sender. Any use not in accord with 
its purpose, any dissemination or disclosure, either whole 
or partial, is prohibited except formal approval. The internet
can not guarantee the integrity of this message. 
BNP PARIBAS (and its subsidiaries) shall (will) not 
therefore be liable for the message if modified. 
Do not print this message unless it is necessary,
consider the environment.

                ---------------------------------------------

Ce message et toutes les pieces jointes (ci-apres le 
"message") sont etablis a l'intention exclusive de ses 
destinataires et sont confidentiels. Si vous recevez ce 
message par erreur, merci de le detruire et d'en avertir 
immediatement l'expediteur. Toute utilisation de ce 
message non conforme a sa destination, toute diffusion 
ou toute publication, totale ou partielle, est interdite, sauf 
autorisation expresse. L'internet ne permettant pas 
d'assurer l'integrite de ce message, BNP PARIBAS (et ses
filiales) decline(nt) toute responsabilite au titre de ce 
message, dans l'hypothese ou il aurait ete modifie.
N'imprimez ce message que si necessaire,
pensez a l'environnement.


This communication is confidential, may be privileged and is meant only for the intended recipient.  If you are 
not the intended recipient, please notify the sender by reply and delete this message from your system.  Any 
unauthorised dissemination, distribution or copying hereof is prohibited.

BNP Paribas Fund Services UK Limited, BNP Paribas Trust Corporation UK Limited, BNP Paribas UK Limited, 
BNP Paribas Commodity Futures Ltd and Investment Fund Services Limited are authorised and regulated by 
the Financial Services Authority.

BNP Paribas, BNP Paribas Securities Services and BNP Paribas Private Bank are authorised by the CECEI 
and AMF.  BNP Paribas London Branch, BNP Paribas Securities Services London Branch and BNP Paribas 
Private Bank London Branch are regulated by the Financial Services Authority for the conduct of their UK 
business.  BNP Paribas Securities Services London Branch is also a member of the London Stock Exchange.




More information about the CMake mailing list