[CMake] execute a script before and after configuration

2012-01-20 Thread Dominik Szczerba
Hi,

I am building a big software framework on a cray system whereby during
cmake "configuration" phase I need to unload certain system modules
(so that some small test programs are allowed to run without
scheduler) and afterwards, before the actual build phase starts, I
need to load them back. Doing it manually is troublesome, because
sometimes typing "make" triggers cmake to re-run, and then re-build,
so there is no chance to load/unload the modules.

So, how would I force one script to run when cmake is started and one
other script before build starts?

Many thanks for any directions.

Dominik
--

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] execute a script before and after configuration

2012-01-20 Thread Rolf Eike Beer
> Hi,
>
> I am building a big software framework on a cray system whereby during
> cmake "configuration" phase I need to unload certain system modules
> (so that some small test programs are allowed to run without
> scheduler) and afterwards, before the actual build phase starts, I
> need to load them back. Doing it manually is troublesome, because
> sometimes typing "make" triggers cmake to re-run, and then re-build,
> so there is no chance to load/unload the modules.
>
> So, how would I force one script to run when cmake is started and one
> other script before build starts?
>
> Many thanks for any directions.

What about overriding CMAKE_COMMAND in your CMakeCache.txt with a script
that does your module fiddling, run cmake, and fiddle back?

Eike
--

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] execute a script before and after configuration

2012-01-20 Thread Dominik Szczerba
Nice idea, but this internal variable gets overwritten and resets back
to the system cmake... any ideas?

Thanks
Dominik

On Fri, Jan 20, 2012 at 2:06 PM, Rolf Eike Beer  wrote:
>> Hi,
>>
>> I am building a big software framework on a cray system whereby during
>> cmake "configuration" phase I need to unload certain system modules
>> (so that some small test programs are allowed to run without
>> scheduler) and afterwards, before the actual build phase starts, I
>> need to load them back. Doing it manually is troublesome, because
>> sometimes typing "make" triggers cmake to re-run, and then re-build,
>> so there is no chance to load/unload the modules.
>>
>> So, how would I force one script to run when cmake is started and one
>> other script before build starts?
>>
>> Many thanks for any directions.
>
> What about overriding CMAKE_COMMAND in your CMakeCache.txt with a script
> that does your module fiddling, run cmake, and fiddle back?
>
> Eike
> --
>
> 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


Re: [CMake] execute a script before and after configuration

2012-01-20 Thread Dominik Szczerba
Hmmm I managed to force it by

cmake -DCMAKE_COMMAND=/users/dsz/bin/mycmake

and it indeed appears now in the cache file, but it does not seem to
unload/reload the modules, so I guess it is not used instead of
cmake... else how can I check if it is invoked?

Thanks a lot


On Fri, Jan 20, 2012 at 2:24 PM, Dominik Szczerba  wrote:
> Nice idea, but this internal variable gets overwritten and resets back
> to the system cmake... any ideas?
>
> Thanks
> Dominik
>
> On Fri, Jan 20, 2012 at 2:06 PM, Rolf Eike Beer  wrote:
>>> Hi,
>>>
>>> I am building a big software framework on a cray system whereby during
>>> cmake "configuration" phase I need to unload certain system modules
>>> (so that some small test programs are allowed to run without
>>> scheduler) and afterwards, before the actual build phase starts, I
>>> need to load them back. Doing it manually is troublesome, because
>>> sometimes typing "make" triggers cmake to re-run, and then re-build,
>>> so there is no chance to load/unload the modules.
>>>
>>> So, how would I force one script to run when cmake is started and one
>>> other script before build starts?
>>>
>>> Many thanks for any directions.
>>
>> What about overriding CMAKE_COMMAND in your CMakeCache.txt with a script
>> that does your module fiddling, run cmake, and fiddle back?
>>
>> Eike
>> --
>>
>> 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] What am I doing wrong with FIND_PATH???

2012-01-20 Thread Dick Munroe

I'm executing the following:

  FIND_PATH(ESPLANNER_INSTALL_PATH
"C:/Program Files/ESPlanner"
"E:/Program Files/ESPlanner"
  )

Looking for the directory in which this package is installed.

Looking at the two disks, C: and E:, I can see the following directory:

E:/Program Files/ESPlanner

From my readings, ESPLANNER_INSTALL_PATH should contain E:/Program 
Files/ESPlanner (or one of the various windoze representations of that 
path) after FIND_PATH is executed.  Instead I get:


ESPLANNER_INSTALL_PATH-NOTFOUND

So I'm a little puzzled as to what I should be doing.

Best,

Dick Munroe

p.s. CMake 2.8.2

p.p.s. Having CMake keep a list of mounted disks/volumes around that 
could be used to search for various directories would be a handy feature.



--

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] What am I doing wrong with FIND_PATH???

2012-01-20 Thread Andreas Pakulat
On 20.01.12 08:31:52, Dick Munroe wrote:
> I'm executing the following:
> 
>   FIND_PATH(ESPLANNER_INSTALL_PATH
> "C:/Program Files/ESPlanner"
> "E:/Program Files/ESPlanner"
>   )
> 
> Looking for the directory in which this package is installed.
> 
> Looking at the two disks, C: and E:, I can see the following directory:
> 
> E:/Program Files/ESPlanner
> 
> From my readings, ESPLANNER_INSTALL_PATH should contain E:/Program
> Files/ESPlanner (or one of the various windoze representations of
> that path) after FIND_PATH is executed.  Instead I get:
> 
> ESPLANNER_INSTALL_PATH-NOTFOUND
> 
> So I'm a little puzzled as to what I should be doing.

Re-Read the cmake manual about the find_path function. Your invocation
is missing the file that is supposed to be searched in the path.

> p.s. CMake 2.8.2
> 
> p.p.s. Having CMake keep a list of mounted disks/volumes around that
> could be used to search for various directories would be a handy
> feature.

There are various cmake and envvars you can set to include paths that
you want to be searched by find_*-commands. Again check the manual for
the exact names.

Andreas

--

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] CMake still broken post-2.8.1

2012-01-20 Thread Phil Smith
Still no answer to these questions?

-Original Message-
From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf Of 
Phil Smith
Sent: Tuesday, January 03, 2012 1:29 PM
To: Brad King
Cc: cmake@cmake.org; b...@public.kitware.com; Hoffman; Janet Graff
Subject: Re: [CMake] CMake still broken post-2.8.1

I'm back to this. I never got (or never understood!) an answer to this part of 
the thread, which is where the breakage occurred:
--
If I comment out line 29 in CMakeDetermineCompilerId.cmake, it works with my 
old toolchain file, but fails later with the new one, because it appears to 
call "the compiler" without the "flags", and regina with no arguments produces 
Help and exits.

Why are the semicolons being inserted? If I wanted semicolons between the 
parameters, why wouldn't I just specify them?

Brad, your comment in the thread says:
>Teach compiler identification to support values such as
>  export CC='gcc -g -O2'
>by separating the arguments on spaces.

Not sure what "on spaces" means, but again, it seems wrong to me that anything 
is messing with my option format.
--

So -- why are semicolons being inserted?

...phsiii
--

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


Re: [CMake] CMake still broken post-2.8.1

2012-01-20 Thread Brad King

On 1/3/2012 1:29 PM, Phil Smith wrote:

If I comment out line 29 in CMakeDetermineCompilerId.cmake, it works with my 
old toolchain file

[snip]

So -- why are semicolons being inserted?


The change was discussed here:

 http://www.cmake.org/pipermail/cmake/2010-March/035810.html
 http://www.cmake.org/pipermail/cmake/2010-March/035811.html
 http://www.cmake.org/pipermail/cmake/2010-March/035812.html
 http://www.cmake.org/pipermail/cmake/2010-March/035815.html [1]
 http://www.cmake.org/pipermail/cmake/2010-March/035816.html
 http://www.cmake.org/pipermail/cmake/2010-March/035817.html [2]
 http://www.cmake.org/pipermail/cmake/2010-March/035818.html

The patch in [1] seemed correct at the time.  It looks like in [2]
I mentioned the possibility of the failure you are seeing.  Does
reverting the change completely solve the problem for you?

-Brad
--

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] parallel make -j N

2012-01-20 Thread Andrea Galeazzi
Title: korg Firma




Andre Heider ha scritto:

  On Tue, Jan 17, 2012 at 10:32 AM, Andrea Galeazzi  wrote:
  
  
Yes but I'm using MinGW make (on Windows machine), the interpreter is

  
  
GNU make on Windows doesn't support the jobserver, so whenever you
Makefile starts another make instance what will effectively run with
-j1.

  

The issue has been solved here: http://public.kitware.com/Bug/view.php?id=12882

-- 









KORG
ITALY SPA
Via
Cagiata, 85 – 60027 Osimo (AN) - ITALY
Ph.  
+39 071 727161 -  Fax   +39 071 7231228
P.IVA
e
Cod. fiscale IT01460580424
Soggetta
al controllo della Società KORG Inc. - Giappone
Reg.
Imprese di n. 212056/1996 del 23/12/96
REA
di Ancona
al n. 133105 del 06/12/96
Capitale
sociale Euro 814.253,16  i.v.
 
 
 
Ai sensi del D.Lgs. 30
giugno 2003,
n. 196, “Codice in materia di protezione dei dati personali” si precisa
che le
informazioni contenute nel messaggio sono riservate e destinate
esclusivamente
alla persona od organizzazione sopra indicata. A chi legge il presente
avviso -
se non è l'effettivo destinatario, o un dipendente, o la persona
responsabile
della consegna del messaggio - si notifica che sono proibite copie,
distribuzione o divulgazione di quanto in esso contenuto (C.P. 616). Se
questo
messaggio Vi è pervenuto per errore, Vi preghiamo di informarci
immediatamente,
di non leggerlo e di distruggerlo. Grazie.
 
According
to Legislative Decree n. 196 of 30 June 2003 about “Personal Data
Protection
Code” we point out that the information contained in this message may
be
privileged and confidential and is intended only for the use of the
individual
entity named above. If the reader of this message is not the intended
recipient, or an employee or agent responsible for delivering this
message to
the intended recipient, you are hereby notified that any dissemination,
distribution, or copying of this message is strictly prohibited. If you
have
received this message in error, please notify us immediately and
destroy the
original message. Thank
you.
 
 




--

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] Need a configure_string() command

2012-01-20 Thread Robert Dailey
I'm trying to develop some scripts that will take a portion of the
vcproj.user file, specifically the  portion, which is
located in a separate file, and append it (N) number of times to a file,
where N equals the number of configurations we have.

Ideally I will start by using file() to read the entire contents of the
file. After that, I need to configure the string to replace this:

Name="${configuration}|Win32"

so that it looks like so (for the debug configuration):

Name="Debug|Win32"

After that, I need to append the contents of this string to another file,
which will be the final vcproj.user file.

I can't use a file to configure this because of the way I'll be appending
the contents, and I can't replace on the final file itself because there
will be multiple ${configuration} variables, but they will each need to be
assigned a different value.

The only solution I see for this is to have a configure_string() function,
which behaves exactly like configure_file() except input & output are
string variables instead of files.

Any thoughts on this? Workarounds?

-
Robert Dailey
--

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] Need a configure_string() command

2012-01-20 Thread David Cole
See the docs for:

string(CONFIGURE ...)

  http://cmake.org/cmake/help/cmake-2-8-docs.html#command:string

That should help... :-)


David


On Fri, Jan 20, 2012 at 11:09 AM, Robert Dailey  wrote:
> I'm trying to develop some scripts that will take a portion of the
> vcproj.user file, specifically the  portion, which is located
> in a separate file, and append it (N) number of times to a file, where N
> equals the number of configurations we have.
>
> Ideally I will start by using file() to read the entire contents of the
> file. After that, I need to configure the string to replace this:
>
> Name="${configuration}|Win32"
>
> so that it looks like so (for the debug configuration):
>
> Name="Debug|Win32"
>
> After that, I need to append the contents of this string to another file,
> which will be the final vcproj.user file.
>
> I can't use a file to configure this because of the way I'll be appending
> the contents, and I can't replace on the final file itself because there
> will be multiple ${configuration} variables, but they will each need to be
> assigned a different value.
>
> The only solution I see for this is to have a configure_string() function,
> which behaves exactly like configure_file() except input & output are string
> variables instead of files.
>
> Any thoughts on this? Workarounds?
>
> -
> Robert Dailey
>
> --
>
> 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


Re: [CMake] User configuration files for Visual Studio

2012-01-20 Thread Robert Dailey
Any thoughts on this guys? Here are my ideas for this:

For VS8 and VS9:

CMake will only generate the my_project.vcproj.user files. Visual Studio
will NOT use these unless you delete your *other* user file, which is in
the format of: my_project.vcproj.COMPUTER.USER.user. If the user wishes to
have the generated values, they must delete the machine-specific user file,
and reload visual studio, at which point it will use the
my_project.vcproj.user file as a source for defaults, and then it will
generate the my_project.vcproj.COMPUTER.USER.user file with those values.

For VS10 (and not sure about VS11):

Since Visual Studio does not generate a secondary .user file like it did in
VS8 and VS9, CMake should ONLY generate the user file if one does not exist
already. The first time generation happens, obviously they will not exist
so they will be generated. Everytime thereafter it will not generate them.
If the user wishes to get new values, they need to delete their
my_project.vcproj.user file.

To aid in deleting the vcproj files for each appropriate version of Visual
Studio, you could automate this in your CMake scripts. You could
recursively delete all *user files, or you could delete only a select few
based on how user file information is updated. Since the circumstances
under which the user files will be edited, deleted, updated, and so forth,
are different between users, CMake shouldn't do anything to facilitate
this, but instead allow enough flexibility in the scripts to let the users
implement these details.

How does my idea sound? It lets you generate these files without replacing
custom user-edits made through visual studio, or even by hand.

-
Robert Dailey


On Thu, Jan 12, 2012 at 11:31 AM, James Bigler wrote:

> I would be fine with that if the generation of these files would only
> happen if either they weren't present or you manually forced them to be
> created.  Folks are just used to modifying them in the VS IDE, and it would
> be too easy for users to make a change in the IDE and then have CMake
> overwrite them on a configure.  Plus the project reloading in VS is really
> slow.
>
> James
>
>
> On Thu, Jan 12, 2012 at 10:17 AM, Robert Dailey wrote:
>
>> Or you could just change the properties as normal in the VS options
>> dialog, until you find settings that work and you want to keep. Then update
>> the cache variables or whatnot in CMake, so next time you generate you will
>> have them.
>>
>> There is nothing preventing you from using the normal method of changing
>> debug parameters.
>>
>> -
>> Robert Dailey
>>
>>
>>
>> On Wed, Jan 11, 2012 at 5:53 PM, James Bigler wrote:
>>
>>> On Wed, Jan 11, 2012 at 8:41 AM, David Cole wrote:
>>>
 I'm sure there are a handful of interested parties on this topic.

 One concern I would have is that if we start to generate this, we
 might clobber stuff that users go in and edit by hand in the Visual
 Studio UI. It's a minor concern, but if I do go in and add a
 "PATH=1;2;3;4" to the environment, then I wouldn't want CMake to
 clobber it. I could get used to editing a CMake file or a
 configuration .in file for such settings though...

 It's a reasonable idea.


>>> I would be vehemently against any idea that would *require* me to edit
>>> any file to change debug parameters.  This is an integral part of how VS
>>> should be used.  The time for an iteration cycle and annoyance of this
>>> would be too high for most developers.
>>>
>>> 1. Edit paramfile
>>> 2. Configure with CMake
>>> 3. Wait for VS to recognize the file has changed or the slow slow CMake
>>> VS plugin to figure out what is going on and ask me to reload the file.
>>> 4. Run my code
>>> 5. Decide I need to change another debug parameter
>>> 6. Rinse and repeat until I decide to pull my hair out
>>>
>>> I would not be opposed for a default version of the file or the option
>>> to overwrite the existing ones, but once it has been created please leave
>>> it alone and let me configure it through the GUI.
>>>
>>> James
>>>
>>
>>
>
--

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] Need a configure_string() command

2012-01-20 Thread Robert Dailey
Thanks! I wouldn't call CMake confusing, but it sure is unpredictable in
how things are laid out :P

-
Robert Dailey


On Fri, Jan 20, 2012 at 10:14 AM, David Cole  wrote:

> See the docs for:
>
> string(CONFIGURE ...)
>
>  http://cmake.org/cmake/help/cmake-2-8-docs.html#command:string
>
> That should help... :-)
>
>
> David
>
>
> On Fri, Jan 20, 2012 at 11:09 AM, Robert Dailey 
> wrote:
> > I'm trying to develop some scripts that will take a portion of the
> > vcproj.user file, specifically the  portion, which is
> located
> > in a separate file, and append it (N) number of times to a file, where N
> > equals the number of configurations we have.
> >
> > Ideally I will start by using file() to read the entire contents of the
> > file. After that, I need to configure the string to replace this:
> >
> > Name="${configuration}|Win32"
> >
> > so that it looks like so (for the debug configuration):
> >
> > Name="Debug|Win32"
> >
> > After that, I need to append the contents of this string to another file,
> > which will be the final vcproj.user file.
> >
> > I can't use a file to configure this because of the way I'll be appending
> > the contents, and I can't replace on the final file itself because there
> > will be multiple ${configuration} variables, but they will each need to
> be
> > assigned a different value.
> >
> > The only solution I see for this is to have a configure_string()
> function,
> > which behaves exactly like configure_file() except input & output are
> string
> > variables instead of files.
> >
> > Any thoughts on this? Workarounds?
> >
> > -
> > Robert Dailey
> >
> > --
> >
> > 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

Re: [CMake] User configuration files for Visual Studio

2012-01-20 Thread James Bigler
On Fri, Jan 20, 2012 at 9:17 AM, Robert Dailey  wrote:

> Any thoughts on this guys? Here are my ideas for this:
>
> For VS8 and VS9:
>
> CMake will only generate the my_project.vcproj.user files. Visual Studio
> will NOT use these unless you delete your *other* user file, which is in
> the format of: my_project.vcproj.COMPUTER.USER.user. If the user wishes to
> have the generated values, they must delete the machine-specific user file,
> and reload visual studio, at which point it will use the
> my_project.vcproj.user file as a source for defaults, and then it will
> generate the my_project.vcproj.COMPUTER.USER.user file with those values.
>
> For VS10 (and not sure about VS11):
>
> Since Visual Studio does not generate a secondary .user file like it did
> in VS8 and VS9, CMake should ONLY generate the user file if one does not
> exist already. The first time generation happens, obviously they will not
> exist so they will be generated. Everytime thereafter it will not generate
> them. If the user wishes to get new values, they need to delete their
> my_project.vcproj.user file.
>
> To aid in deleting the vcproj files for each appropriate version of Visual
> Studio, you could automate this in your CMake scripts. You could
> recursively delete all *user files, or you could delete only a select few
> based on how user file information is updated. Since the circumstances
> under which the user files will be edited, deleted, updated, and so forth,
> are different between users, CMake shouldn't do anything to facilitate
> this, but instead allow enough flexibility in the scripts to let the users
> implement these details.
>
> How does my idea sound? It lets you generate these files without replacing
> custom user-edits made through visual studio, or even by hand.
>
> -
> Robert Dailey
>
>
>
> On Thu, Jan 12, 2012 at 11:31 AM, James Bigler wrote:
>
>> I would be fine with that if the generation of these files would only
>> happen if either they weren't present or you manually forced them to be
>> created.  Folks are just used to modifying them in the VS IDE, and it would
>> be too easy for users to make a change in the IDE and then have CMake
>> overwrite them on a configure.  Plus the project reloading in VS is really
>> slow.
>>
>> James
>>
>>
>> On Thu, Jan 12, 2012 at 10:17 AM, Robert Dailey wrote:
>>
>>> Or you could just change the properties as normal in the VS options
>>> dialog, until you find settings that work and you want to keep. Then update
>>> the cache variables or whatnot in CMake, so next time you generate you will
>>> have them.
>>>
>>> There is nothing preventing you from using the normal method of changing
>>> debug parameters.
>>>
>>> -
>>> Robert Dailey
>>>
>>>
>>>
>>> On Wed, Jan 11, 2012 at 5:53 PM, James Bigler wrote:
>>>
 On Wed, Jan 11, 2012 at 8:41 AM, David Cole wrote:

> I'm sure there are a handful of interested parties on this topic.
>
> One concern I would have is that if we start to generate this, we
> might clobber stuff that users go in and edit by hand in the Visual
> Studio UI. It's a minor concern, but if I do go in and add a
> "PATH=1;2;3;4" to the environment, then I wouldn't want CMake to
> clobber it. I could get used to editing a CMake file or a
> configuration .in file for such settings though...
>
> It's a reasonable idea.
>
>
 I would be vehemently against any idea that would *require* me to edit
 any file to change debug parameters.  This is an integral part of how VS
 should be used.  The time for an iteration cycle and annoyance of this
 would be too high for most developers.

 1. Edit paramfile
 2. Configure with CMake
 3. Wait for VS to recognize the file has changed or the slow slow CMake
 VS plugin to figure out what is going on and ask me to reload the file.
 4. Run my code
 5. Decide I need to change another debug parameter
 6. Rinse and repeat until I decide to pull my hair out

 I would not be opposed for a default version of the file or the option
 to overwrite the existing ones, but once it has been created please leave
 it alone and let me configure it through the GUI.

 James

>>>
>>>
>>
>
I think this is a solid approach.

James
--

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] CMake still broken post-2.8.1

2012-01-20 Thread Phil Smith
Ah. Yes, it does solve the problem. This isn't path-related, however, it's 
option-related. This is on Windows.

-Original Message-
From: Brad King [mailto:brad.k...@kitware.com] 
Sent: Friday, January 20, 2012 10:03 AM
To: Phil Smith
Cc: Janet Graff; cmake@cmake.org; Bill Hoffman
Subject: Re: [CMake] CMake still broken post-2.8.1

On 1/3/2012 1:29 PM, Phil Smith wrote:
> If I comment out line 29 in CMakeDetermineCompilerId.cmake, it works with my 
> old toolchain file
[snip]
> So -- why are semicolons being inserted?

The change was discussed here:

  http://www.cmake.org/pipermail/cmake/2010-March/035810.html
  http://www.cmake.org/pipermail/cmake/2010-March/035811.html
  http://www.cmake.org/pipermail/cmake/2010-March/035812.html
  http://www.cmake.org/pipermail/cmake/2010-March/035815.html [1]
  http://www.cmake.org/pipermail/cmake/2010-March/035816.html
  http://www.cmake.org/pipermail/cmake/2010-March/035817.html [2]
  http://www.cmake.org/pipermail/cmake/2010-March/035818.html

The patch in [1] seemed correct at the time.  It looks like in [2]
I mentioned the possibility of the failure you are seeing.  Does
reverting the change completely solve the problem for you?

-Brad
--

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 beginner question

2012-01-20 Thread Ali Habib
I want to build VTK for IOS, how can I adjust the CMake files to do that,
any suggestions ideas will be highly appreciated

Best regards
--

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] CMake still broken post-2.8.1

2012-01-20 Thread Brad King

On October 24, 2011 6:08 PM Bill Hoffman wrote:
> So, right at the end it is doing this:
>
> C:/Program Files (x86)/CMake 
2.8/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake(96):
>  EXECUTE_PROCESS(COMMAND ${CMAKE_${lang}_COMPILER} 
${CMAKE_${lang}_COMPILER_ID_ARG1}
>   ${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST} ${testflags} ${src}
>   WORKING_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR}
>   OUTPUT_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
>   ERROR_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
>   RESULT_VARIABLE CMAKE_${lang}_COMPILER_ID_RESULT )
[snip]
> message("${CMAKE_${lang}_COMPILER} ${CMAKE_${lang}_COMPILER_ID_ARG1} 
${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST} ${testflags} ${src}"
[snip]
On 10/24/2011 6:38 PM, Phil Smith wrote:

Ah, ok. With 2.8.1:

C:/Program Files/Regina/regina.exe cc.rex dcc.exe   CMakeCCompilerId.c

With 2.8.6:
C:/Program Files/Regina/regina.exe cc.rex;dcc.exe   CMakeCCompilerId.c

Note the semicolon; where'd it come from? It's not in the toolchain file:


I did not notice previously that the reported ; is coming from a message()
command in a string and not a real command line that is invoked.  The
2.8.1 output line misrepresents the actual command that is running.
What you mean by:

> SET(CMAKE_C_COMPILER   "regina.exe" "cc.rex dcc.exe")
> SET(CMAKE_CXX_COMPILER "regina.exe" "cc.rex dcxx.exe")

is that you want the compiler to be invoked as

 "regina.exe" "cc.rex dcc.exe" "CMakeCCompilerId.c"

where the second piece puts both files in a *single* argument, right?
Much of the discussion in this thread made it appear that you wanted

 "regina.exe" "cc.rex" "dcc.exe" "CMakeCCompilerId.c"

but that is what the above-mentioned execute_process command ends up
running in 2.8.6 and causing the hang.

Correct?

-Brad
--

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] CMake + Ninja

2012-01-20 Thread Clifford Yapp
Confirmed - working now on Mac building BRL-CAD - thanks!

Cliff

On Sat, Jan 14, 2012 at 3:25 PM, Peter Collingbourne  wrote:
>
> I managed to test these changes on a Mac and it fixed all but 7
> test failures, so I rolled it into the ninja-generator-pr branch.
> In terms of applications I didn't have time to try building anything
> other than CMake itself and LLVM/Clang (both successfully), but please
> let me know if there are any other problems with BRL-CAD.
>
> Thanks,
> --
> Peter
--

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] OS X QT Gui build question

2012-01-20 Thread Steven Wilson
When building the 2.8.7 CMake sources with the following configuration:

cmake -DCMAKE_BUILD_TYPE:STRING=Release
-DCMAKE_INSTALL_PREFIX:PATH=../path/to/install -DBUILD_QtDialog:BOOL=ON
../cmake

I get the following error when doing a 'make install'

- Installing: /Users/stevew/cmake/tmp/build/../install/CMake
2.8-7.app/Contents/share/mime/packages/cmakecache.xml
-- fixup_bundle
--   app='../install/CMake 2.8-7.app/Contents/MacOS/CMake 2.8-7'
--   libs=''
--   dirs='/Library/Frameworks;/Developer/Tools/Qt'
-- warning: *NOT* handled - directory/file does not exist...
CMake Error at
/Users/stevew/cmake/tmp/cmake/Modules/BundleUtilities.cmake:668 (message):
  error: fixup_bundle: not a valid bundle
Call Stack (most recent call first):
  Source/QtDialog/cmake_install.cmake:54 (fixup_bundle)
  Source/cmake_install.cmake:86 (INCLUDE)
  cmake_install.cmake:52 (INCLUDE)


I would appreciate any advice on how to correct this problem.

Thanks,

Steve
--

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] CMake still broken post-2.8.1

2012-01-20 Thread Phil Smith
I'm confused because neither of your examples has the semicolon, but what we 
need is:
  "regina.exe" "cc.rex" "dcc.exe" "CMakeCCompilerId.c"

But it sounds like you're saying that we're not actually getting invoked as:
  cc.rex;dcc.exe   CMakeCCompilerId.c

The problem is, I can't tell what we ARE getting invoked as. The symptoms match 
regina being invoked with no operands, but I can't seem to prove that.

If I run with --trace and --debug-output, the last of the output is:

C:/Program Files (x86)/CMake 
2.8/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake(97):  
EXECUTE_PROCESS(COMMAND ${CMAKE_${lang}_COMPILER} ${CMAKE_${lang}_
COMPILER_ID_ARG1} ${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST} ${testflags} ${src} 
WORKING_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR} OUTPUT_VARIABLE 
CMAKE_${lang}_C
OMPILER_ID_OUTPUT ERROR_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT 
RESULT_VARIABLE CMAKE_${lang}_COMPILER_ID_RESULT )
   Called from: [2] C:/Program Files (x86)/CMake 
2.8/share/cmake-2.8/Modules/CMakeDetermineCCompiler.cmake
[1] C:/SVN/zFPE/CMakeLists.txt

Does that tell us anything?

-Original Message-
From: Brad King [mailto:brad.k...@kitware.com] 
Sent: Friday, January 20, 2012 3:50 PM
To: Phil Smith
Cc: Bill Hoffman; cmake@cmake.org
Subject: Re: [CMake] CMake still broken post-2.8.1

On October 24, 2011 6:08 PM Bill Hoffman wrote:
 > So, right at the end it is doing this:
 >
 > C:/Program Files (x86)/CMake 
 > 2.8/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake(96):
 >  EXECUTE_PROCESS(COMMAND ${CMAKE_${lang}_COMPILER} 
 > ${CMAKE_${lang}_COMPILER_ID_ARG1}
 >   ${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST} ${testflags} ${src}
 >   WORKING_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR}
 >   OUTPUT_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
 >   ERROR_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
 >   RESULT_VARIABLE CMAKE_${lang}_COMPILER_ID_RESULT )
[snip]
 > message("${CMAKE_${lang}_COMPILER} ${CMAKE_${lang}_COMPILER_ID_ARG1} 
 > ${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST} ${testflags} ${src}"
[snip]
On 10/24/2011 6:38 PM, Phil Smith wrote:
> Ah, ok. With 2.8.1:
>
> C:/Program Files/Regina/regina.exe cc.rex dcc.exe   CMakeCCompilerId.c
>
> With 2.8.6:
> C:/Program Files/Regina/regina.exe cc.rex;dcc.exe   CMakeCCompilerId.c
>
> Note the semicolon; where'd it come from? It's not in the toolchain file:

I did not notice previously that the reported ; is coming from a message()
command in a string and not a real command line that is invoked.  The
2.8.1 output line misrepresents the actual command that is running.
What you mean by:

 > SET(CMAKE_C_COMPILER   "regina.exe" "cc.rex dcc.exe")
 > SET(CMAKE_CXX_COMPILER "regina.exe" "cc.rex dcxx.exe")

is that you want the compiler to be invoked as

  "regina.exe" "cc.rex dcc.exe" "CMakeCCompilerId.c"

where the second piece puts both files in a *single* argument, right?
Much of the discussion in this thread made it appear that you wanted

  "regina.exe" "cc.rex" "dcc.exe" "CMakeCCompilerId.c"

but that is what the above-mentioned execute_process command ends up
running in 2.8.6 and causing the hang.

Correct?

-Brad
--

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] Compile multiple-sources at a time?

2012-01-20 Thread Eric Noulard
2012/1/20 Oliver kfsone Smith :
> Eric Noulard said the following on 1/20/2012 1:26 AM:
>
>> 2012/1/19 Oliver kfsone Smith:
>>>
>>> I realize not every build environment supports the option, but is there a
>>> way to get CMake to generate Makefiles which aggregate source files, e.g.
>>>
>>> $ g++ -pipe -o library.a lib1.cpp lib2.cpp lib3.cpp
>>> $ g++ -pipe -o exeutable file1.cpp file2.cpp file3.cpp library.a
>>
>> I don't think so.
>> Why do you want to do that?
>> Are you seeking for performance? Thus the "-pipe" option?
>
> "-combine" :)

I see.
>From this
http://stackoverflow.com/questions/6347041/cmake-and-gcc-combine
I think combine disappeared from gcc 4.6
and -flto authorizes separate compilation
http://lwn.net/Articles/387122/
http://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html

>> CMake generates makefiles that handle the -j option of make quite nicely?
>
> As long as you turn off colorizing - otherwise it's a bit messy :)

Or you look elsewhere until it's over :-]
Beautifulness and speed not always go together.

PS: Try not to drop the ML address.
-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
--

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] CMake still broken post-2.8.1

2012-01-20 Thread Brad King

On 1/20/2012 4:37 PM, Phil Smith wrote:

I'm confused because neither of your examples has the semicolon,


I was asking which one you need, so neither option has semicolons.

> but what we need is:

   "regina.exe" "cc.rex" "dcc.exe" "CMakeCCompilerId.c"


Okay.


But it sounds like you're saying that we're not actually getting invoked as:
   cc.rex;dcc.exe   CMakeCCompilerId.c


Correct.  The execute_process should not be using the ";".  The semicolon
is CMake's list separator.  The execute process command line you see:


If I run with --trace and --debug-output, the last of the output is:

C:/Program Files (x86)/CMake 
2.8/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake(97):  
EXECUTE_PROCESS(COMMAND ${CMAKE_${lang}_COMPILER} ${CMAKE_${lang}_
COMPILER_ID_ARG1} ${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST} ${testflags} ${src} 
WORKING_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR} OUTPUT_VARIABLE 
CMAKE_${lang}_C
OMPILER_ID_OUTPUT ERROR_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT 
RESULT_VARIABLE CMAKE_${lang}_COMPILER_ID_RESULT )


is here:

  
http://cmake.org/gitweb?p=cmake.git;a=blob;f=Modules/CMakeDetermineCompilerId.cmake;hb=v2.8.6#l96

EXECUTE_PROCESS(
  COMMAND ${CMAKE_${lang}_COMPILER}
  ${CMAKE_${lang}_COMPILER_ID_ARG1}
  ${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
  ${testflags}
  "${src}"
  WORKING_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR}
  OUTPUT_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
  ERROR_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
  RESULT_VARIABLE CMAKE_${lang}_COMPILER_ID_RESULT
  )

CMake will evaluate ${CMAKE_${lang}_COMPILER_ID_ARG1} and split it on
the semicolons.  The execute_process will see the result as two arguments,
"cc.rex" and "dcc.exe", which is what you said is needed.  In fact if it
were not for the ";-change" you would be getting a single "cc.rex dcc.exe"
argument.  That is why I asked if that's what you want, since it appears
to work.

To see this, add this code right above that EXECUTE_PROCESS call:

FOREACH(arg
  COMMAND ${CMAKE_${lang}_COMPILER}
  ${CMAKE_${lang}_COMPILER_ID_ARG1}
  ${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
  ${testflags}
  "${src}"
  WORKING_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR}
  OUTPUT_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
  ERROR_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
  RESULT_VARIABLE CMAKE_${lang}_COMPILER_ID_RESULT
  )
  MESSAGE(STATUS "arg=[${arg}]")
ENDFOREACH()

The configure output should show you the exact set of arguments.

-Brad
--

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] execute a script before and after configuration

2012-01-20 Thread Michael Hertling
On 01/20/2012 01:57 PM, Dominik Szczerba wrote:
> Hi,
> 
> I am building a big software framework on a cray system whereby during
> cmake "configuration" phase I need to unload certain system modules
> (so that some small test programs are allowed to run without
> scheduler) and afterwards, before the actual build phase starts, I
> need to load them back. Doing it manually is troublesome, because
> sometimes typing "make" triggers cmake to re-run, and then re-build,
> so there is no chance to load/unload the modules.
> 
> So, how would I force one script to run when cmake is started and one
> other script before build starts?
> 
> Many thanks for any directions.
> 
> Dominik

You might use an EXECUTE_PROCESS() command at the beginning of your
CMakeLists.txt to unload the modules, and another EXECUTE_PROCESS()
at the end to reload them.

Regards,

Michael
--

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] Compile multiple-sources at a time?

2012-01-20 Thread Michael Hertling
On 01/19/2012 11:09 PM, Oliver kfsone Smith wrote:
> I realize not every build environment supports the option, but is there 
> a way to get CMake to generate Makefiles which aggregate source files, e.g.
> 
> $ g++ -pipe -o library.a lib1.cpp lib2.cpp lib3.cpp
> $ g++ -pipe -o exeutable file1.cpp file2.cpp file3.cpp library.a
> 
> 
> - Oliver

Aggregating source files in this way fundamentally collides with the
concept of source file properties, a well-established CMake feature.
Thus, it would require a check if the aggregated source files are to
be compiled with exactly the same flags/definitions/etc. If not, one
would need to trade off aggregation against source file properties,
perhaps by use of a variable/property/policy or whatever solution
might suit. Not that trivial, IMO.

Regards,

Michael
--

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] Fwd: building libs and specifying addition folders

2012-01-20 Thread Michael Hertling
On 01/19/2012 08:15 AM, Dev Guy wrote:
> On Thu, Jan 19, 2012 at 1:01 AM, John Drescher  wrote:
>> -- Forwarded message --
>> From: John Drescher 
>> Date: Thu, Jan 19, 2012 at 1:00 AM
>> Subject: Re: [CMake] building libs and specifying addition folders
>> To: Dev Guy 
>>
>>
>> On Wed, Jan 18, 2012 at 10:57 PM, Dev Guy  wrote:
>>> Hi,
>>>
>>> I am relatively new to CMake and I've read the tutorial. However I
>>> have a few questions.
>>>
>>> 1. How can I declare a CMakeLists file to create a project to build a
>>> DLL or static lib ? I assume if I build a DLL on windows, it will
>>> build as a shared lib on Linux
>>
>> put SHARED in the add_library statement
>>
>> For more info than that type the following from a command prompt or shell:
>>
>> cmake --help-command add_library
>>
>>>
>>> 2. If my main source folder has 2 sub-folders, one that only includes
>>> header files call is Include and another folder that contains source
>>> files call it Utils. How do I add declare them to my CMakeLists files
>>> so that both the header and addition source files are found and and
>>> compiled in the main source folder to build the final binary.
>>>
>>
>> add_subdirectory
>>
>> Again for help:
>> cmake --help-command add_subdirectory
>>
>>
>> John
>>
>>
>> --
>> John M. Drescher
>> --
> 
> John thanks,
> 
> I was able to get a DLL built, now I have a program that want to link
> against the lib and use the DLL.
> 
> What I've done is create a Lib folder under the source folder wanting
> to use the lib, I copied over the lib find and header file. I added
> the following to CMakeLists.txt
> 
> add_subdirectory(Lib)
> 
> 
> target_link_libraries (SimpleTester UnitTest)
> 
> However I am seeing 2 errors:
> 
> Error 1, when I run CMake I see:
> 
> CMake Warning (dev) at CMakeLists.txt:6 (add_subdirectory):
>   The source directory
> 
> C:/dev/Project/UnitTestSample/Lib
> 
>   does not contain a CMakeLists.txt file.
> 
>   CMake does not support this case but it used to work accidentally and is
>   being allowed for compatibility.
> 
>   Policy CMP0014 is not set: Input directories must have CMakeLists.txt.  Run
>   "cmake --help-policy CMP0014" for policy details.  Use the cmake_policy
>   command to set the policy and suppress this warning.
> This warning is for project developers.  Use -Wno-dev to suppress it.
> 
> -- Configuring done
> -- Generating done
> -- Build files have been written to: C:/dev/Project/UnitTestSample/build
> 
> ==
> 
> Error 2
> 
> When I build I get a link error, which I fix by copying over the lib
> file into the build folder. How can I tell the linker from CMake where
> to find the lib?
> 
> LINK : fatal error LNK1104: cannot open file 'UnitTest.lib'
> LINK Pass 1 failed. with 2
> NMAKE : fatal error U1077: '"C:\Program Files\CMake
> 2.8\bin\cmake.exe"' : return code '0x'
> Stop.
> NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio
> 10.0\VC\BIN\nmake.exe"' : retu
> rn code '0x2'
> Stop.
> NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio
> 10.0\VC\BIN\nmake.exe"' : retu
> rn code '0x2'
> Stop.

Could you provide a small but self-sufficient exemplary project which
demonstrates what you're doing and allows for further investigation?

Regards,

Michael
--

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] Two C Compilers

2012-01-20 Thread John David Duncan

Hi,

I'm looking at building a large project on Windows.  I am currently  
able to build the whole project using CMake and Visual Studio.


Now I'd like to add a "subproject" (or just a directory), but in this  
particular subdirectory the C language files need to be compiled with  
mingw (because of extensive use of C99).  I understand that, in  
theory, I should be able to compile these with mingw into DLLs and  
then link with the rest of the project.


I'd still like to control the whole build with CMake, but I see at  
least two potential problems.  One is that I can't override  
CMAKE_C_COMPILER, and another is that in the subproject I may need  
CMake to use a Makefile generator rather than a Visual Studio project  
generator.


Does anyone know if there's a way to do this with CMake?

Thanks,

JD



--

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] Issue with ExternalProject_add at make_directory build

2012-01-20 Thread Chris Sigman
Hi all,

I'm trying to build boost with ExternalProject_add using cmake 2.8.7, and
there seems to be an error in the makefile it's generating.  Specifically,
in the step where it created the directories, the makefile ends up with
this line:

 /apps/cmake/cmake-2.8.7/bin/cmake -E make_directory /workspace/boost/build
CONFIGURE_CMD "bootstrap.sh --libdir=/workspace/boost/install
--includedir=/workspace/boost/install --with-libraries=serialization"
BUILD_CMD "bjam install"

It seems to me that that is supposed to be two or more separate calls.
 This obviously ends up calling cmake in error.  Below is my call to
ExternalProject_add, in-case that is what is in erorr, but I've fooled
around with it a fair amount and get the same results every time, so I
don't think that's where the issue is

ExternalProject_Add   ( boost
  PREFIX${CMAKE_SOURCE_DIR}/boost/tmp
  DOWNLOAD_COMMAND  ""
  SOURCE_DIR${CMAKE_SOURCE_DIR}/boost/1_48_0
  INSTALL_DIR   ${CMAKE_SOURCE_DIR}/boost/install
  BINARY_DIR${CMAKE_SOURCE_DIR}/boost/build
  CONFIGURE_CMD "bootstrap.sh --libdir=
--includedir= --with-libraries=serialization"
  BUILD_CMD "bjam install"
)

Thanks for the help!
--

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] execute a script before and after configuration

2012-01-20 Thread David Cole
On Friday, January 20, 2012, Michael Hertling  wrote:
> On 01/20/2012 01:57 PM, Dominik Szczerba wrote:
>> Hi,
>>
>> I am building a big software framework on a cray system whereby during
>> cmake "configuration" phase I need to unload certain system modules
>> (so that some small test programs are allowed to run without
>> scheduler) and afterwards, before the actual build phase starts, I
>> need to load them back. Doing it manually is troublesome, because
>> sometimes typing "make" triggers cmake to re-run, and then re-build,
>> so there is no chance to load/unload the modules.
>>
>> So, how would I force one script to run when cmake is started and one
>> other script before build starts?
>>
>> Many thanks for any directions.
>>
>> Dominik
>
> You might use an EXECUTE_PROCESS() command at the beginning of your
> CMakeLists.txt to unload the modules, and another EXECUTE_PROCESS()
> at the end to reload them.
>
> Regards,
>
> Michael
> --
>
> 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
>

Doesn't the module switching involve setting environment variables? You're
going to have to do that before invoking CMake aren't you?
--

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] Two C Compilers

2012-01-20 Thread David Cole
On Friday, January 20, 2012, John David Duncan 
wrote:
> Hi,
>
> I'm looking at building a large project on Windows.  I am currently able
to build the whole project using CMake and Visual Studio.
>
> Now I'd like to add a "subproject" (or just a directory), but in this
particular subdirectory the C language files need to be compiled with mingw
(because of extensive use of C99).  I understand that, in theory, I should
be able to compile these with mingw into DLLs and then link with the rest
of the project.
>
> I'd still like to control the whole build with CMake, but I see at least
two potential problems.  One is that I can't override CMAKE_C_COMPILER, and
another is that in the subproject I may need CMake to use a Makefile
generator rather than a Visual Studio project generator.
>
> Does anyone know if there's a way to do this with CMake?
>
> Thanks,
>
> JD
>
>
>
> --
>
> 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
>

You could try building the C99 stuff using an ExternalProject_Add call.
Search around for examples of using that.

HTH,
David
--

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] Issue with ExternalProject_add at make_directory build

2012-01-20 Thread David Cole
On Friday, January 20, 2012, Chris Sigman  wrote:
> Hi all,
> I'm trying to build boost with ExternalProject_add using cmake 2.8.7, and
there seems to be an error in the makefile it's generating.  Specifically,
in the step where it created the directories, the makefile ends up with
this line:
>  /apps/cmake/cmake-2.8.7/bin/cmake -E make_directory
/workspace/boost/build CONFIGURE_CMD "bootstrap.sh
--libdir=/workspace/boost/install --includedir=/workspace/boost/install
--with-libraries=serialization" BUILD_CMD "bjam install"
>
> It seems to me that that is supposed to be two or more separate calls.
 This obviously ends up calling cmake in error.  Below is my call to
ExternalProject_add, in-case that is what is in erorr, but I've fooled
around with it a fair amount and get the same results every time, so I
don't think that's where the issue is
> ExternalProject_Add   ( boost
>   PREFIX${CMAKE_SOURCE_DIR}/boost/tmp
>   DOWNLOAD_COMMAND  ""
>   SOURCE_DIR${CMAKE_SOURCE_DIR}/boost/1_48_0
>   INSTALL_DIR   ${CMAKE_SOURCE_DIR}/boost/install
>   BINARY_DIR${CMAKE_SOURCE_DIR}/boost/build
>   CONFIGURE_CMD "bootstrap.sh --libdir=
--includedir= --with-libraries=serialization"
>   BUILD_CMD "bjam install"
> )
> Thanks for the help!
>

Check your args... Should be CONFIGURE_COMMAND and BUILD_COMMAND.


HTH,
David
--

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] Bug fix requests for the *next* release of CMake...

2012-01-20 Thread A A
http://public.kitware.com/Bug/view.php?id=10094
http://public.kitware.com/Bug/view.php?id=9905 (Might be fixed already)
--

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