Re: [CMake] [boost][b2] Differenciate 32bit and 64 bit binaries when using CMake.

2013-04-16 Thread Andreas Haferburg
On 11.10.2012 12:16, Klaim - Joël Lamotte wrote: 2. find a way for CMake FindBoost to automatically 
find the 64 bit binaries instead of the 32 bit

 binaris.
 I don't see a clear solution to achieve this, because it depends a lot on how boost have been 
compiled.


Use a naming convention, e.g. set BOOST_ROOT to Boost-version-compiler, where compiler is 
either vs10 or vs10x64. Assuming that Boost is not your only dependency, a naming convention is way 
easier to implement than fixing all the Find*.cmake scripts.


 I can't guarantee where the boost libraries are installed, that's why I use 
FindBoost.
Just make the CMake error message clear, e.g. Boost 1.50 expected to be found in dir. Most 
people know how to rename a directory.


Regards
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] Using different installs/versions of the OpenCV library

2013-02-14 Thread Andreas Haferburg

Have you tried specifying the version?

FIND_PACKAGE(OpenCV 2.2.0 EXACT REQUIRED)

FIND_PACKAGE(OpenCV 2.4.0 EXACT REQUIRED)

Not sure if the FindOpenCV script can handle the version argument.

Andreas

On 14.02.2013 11:42, Bart Vandewoestyne wrote:

Hello list,

To compile and link my code with the OpenCV library, I use

find_package( OpenCV REQUIRED )
...
add_executable(framecountertest framecountertest.cpp)
target_link_libraries(framecountertest ${OpenCV_LIBS})

and this works just fine: the OpenCV library that got installed using my 
package management system
on Ubuntu 12.10 is being used.

However, under the directory /tmp/opencv_install I have another manual 
installation of a more recent
OpenCV library, and I would like to use that one instead of the default on my 
system, or easily
switch between the two versions.  How should I specify that in my 
CMakeLists.txt file?  I have tried

set(OpenCV_FOUND 1)
set(OpenCV_INCLUDE_DIR /home/bart/Git/Research/fat/inc/TraficonOpenCv/opencv)
set(OpenCV_LIBS
opencv_gpu;opencv_contrib;opencv_legacy;opencv_objdetect;opencv_calib3d;opencv_features2d;opencv_video;opencv_highgui;opencv_ml;opencv_imgproc;opencv_flann;opencv_core)

include_directories(${OpenCV_INCLUDE_DIR})
...
add_executable(framecountertest framecountertest.cpp)
target_link_libraries(framecountertest ${OpenCV_LIBS})

but even with these commands, still the default libs on my system are being 
used...

What is the correct way to specify that I want to build with the install under 
/tmp/opencv_install
?  And how can I easily switch between versions without needing to remove one 
or the other version?

Thanks!
Bart
--

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] Using different installs/versions of the OpenCV library

2013-02-14 Thread Andreas Haferburg
Does CMake find 2.4.3 if you remove 2.3.1? CMake probably doesn't even look in /tmp/. You could try 
moving it to /usr/share/OpenCV-2.4.3/.


If the version arg doesn't work, I think your best bet is to use a naming convention for the library 
directories (or create symlinks), e.g. lib-version-arch, then use that directory in the find 
script.


Andreas



On 14.02.2013 12:09, Bart Vandewoestyne wrote:

On 02/14/2013 11:47 AM, Andreas Haferburg wrote:

Have you tried specifying the version?

FIND_PACKAGE(OpenCV 2.2.0 EXACT REQUIRED)

FIND_PACKAGE(OpenCV 2.4.0 EXACT REQUIRED)

Not sure if the FindOpenCV script can handle the version argument.

Andreas


Doesn't seem to work.  I have 2.4.3 installed under /tmp/opencv_install and I 
now used

   find_package( OpenCV 2.4.3 EXACT REQUIRED )

in my CMakeLists.txt, but I get:


CMake Error at CMakeLists.txt:7 (find_package):
   Could not find a configuration file for package OpenCV that exactly
   matches requested version 2.4.3.

   The following configuration files were considered but not accepted:

 /usr/share/OpenCV/OpenCVConfig.cmake, version: 2.3.1



-- Configuring incomplete, errors occurred!


Any other suggestions?  It would really be nice for me to be able to easily 
switch between different
OpenCV installs...

Regards,
Bart
--

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] Dependency for launching an application

2013-02-11 Thread Andreas Haferburg

My initial explanation was bad.

Both parent and child depend on a common library. If something in this lib changes, I need both of 
them to get rebuilt before executing parent.exe, since it will run child.exe.


Sorry for the confusion.

Andreas


On 08.02.2013 19:04, Nick Overdijk wrote:
 I'm probably missing something, but why

 add_dependencies(parent child)

 ? That doesn't make sense. Parent is not using anything from child. You can just leave that line 
away and everything will be fine right?


 On 2013-08-02, at 16:24:21 , Andreas Haferburg wrote:

 Yes, that's pretty much the setup we have: The common (static) library contains almost all 
obj's, and the two exe projects only have a small main.obj and link against the library. I'd like to 
eliminate the build(=link) time of child.exe by having the linker link both exes at the same time.


 Regards,
 Andreas


 On 08.02.2013 15:41, Patrick Johnmeyer wrote:
 On Fri, Feb 8, 2013 at 8:16 AM, Andreas Haferburg ahaferb...@scopis.com
 mailto:ahaferb...@scopis.com wrote:

 What happens is that common is built, then child, then parent, then 
parent is executed.
 What I'd like to happen is that common is built, then child+parent are being built 
concurrently,

 and as soon as both are done, parent is executed.


 Unfortunately that's just not how dependencies work. If parent is dependent 
on child, then child
 will build before parent in serial. And since they are both dependent on 
common, you essentially
 have a linear dependency in your example.

 You could break this up by creating a new target that is dependent on child 
and parent, and
 eliminate parent's direct dependency on child. This will allow child and 
parent to be built
 simultaneously. You would then need to do something with this new target 
so that it will cause
 parent to be run.

 You may be able to improve build times (assuming that is the driver) by 
invoking the compiler flag
 for parallel compilation. Another option may be to convert the majority of 
child and parent to
 another library, with small simple executable projects that invoke those 
libraries. This moves the
 dependencies around in a way that you *may* get better build performance ... but everything I 
say is

 speculative without knowing the nitty gritty of your project -- build times 
per project, full
 dependency graph, etc.
 --

 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] Dependency for launching an application

2013-02-08 Thread Andreas Haferburg
In our build, we have two executables, parent.exe launches child.exe as a child process. ATM the 
build is set up with add_dependencies(parent child). So when using F5 in Visual Studio, child.exe is 
built first, then parent.exe, then parent.exe is launched. Is it possible to set this up such that 
child.exe and parent.exe are built in parallel before launching parent?


Regards
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] Dependency for launching an application

2013-02-08 Thread Andreas Haferburg
Right, sorry. I should have mentioned that they both depend on some library common.lib. When that 
library has to be rebuilt, both exes need to be rebuilt, too.


Andreas


On 08.02.2013 12:21, Nick Overdijk wrote:

Can't you only launch parent.exe in VS and remove the dependency?

On 2013-08-02, at 12:19:56 , Andreas Haferburg wrote:


In our build, we have two executables, parent.exe launches child.exe as a child 
process. ATM the build is set up with add_dependencies(parent child). So when 
using F5 in Visual Studio, child.exe is built first, then parent.exe, then 
parent.exe is launched. Is it possible to set this up such that child.exe and 
parent.exe are built in parallel before launching parent?

Regards
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





--
Scopis GmbH
Blücherstr. 22
10961 Berlin
Germany

E-Mail: ahaferb...@scopis.com
Tel.: +49 (30) 201 69 38 0
Fax.: +49 (30) 201 69 38 20
Internet: www.scopis.com

HRB 128315 Berlin Charlottenburg
USt-IdNr.: DE272721463
Steuernummer: 29/014/02034
Geschäftsführer:  Bartosz Kosmecki

Diese E-mail, einschließlich der Anhänge, ist ausschließlich für den oben genannten Adressaten 
bestimmt und beinhaltet vertrauliche und/oder gesetzlich geschützte Informationen. Jedem anderen 
Empfänger ist die Vervielfältigung, Weitergabe oder Veröffentlichung untersagt. Falls Sie diese 
Mitteilung irrtümlicherweise erhalten haben, bitten wir um sofortige Information an den Absender und 
Vernichtung der E-mail.


This e-mail, including the attachments, is for the exclusive use of the above-named addresses and 
contains confidential information and/or information protected by law. Any other recipient is 
prohibited from duplicating, passing on to third parties, or publishing this information. If by 
error you are the recipient of this communication please inform the sender immediately and 
permanently delete this e-mail.

--

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] Dependency for launching an application

2013-02-08 Thread Andreas Haferburg

Sure. Example:

add_library(common MyFancyString.cpp)

add_executable(parent parent_main.cpp)
target_link_libraries(parent common.lib)

add_executable(child child_main.cpp)
target_link_libraries(child common.lib)
add_dependencies(parent child)

Now I make a change to MyFancyString.cpp, select the parent project, and hit F5. Both executables 
use MyFancyString, so both need to be re-built.


What happens is that common is built, then child, then parent, then parent is 
executed.
What I'd like to happen is that common is built, then child+parent are being built concurrently, and 
as soon as both are done, parent is executed.


I hope it's clearer now.

Regards,
Andreas



On 08.02.2013 12:51, Nick Overdijk wrote:

Well cmake will take care of that if you target_link_library(common), right?

On 2013-08-02, at 12:50:13 , Andreas Haferburg wrote:


Right, sorry. I should have mentioned that they both depend on some library 
common.lib. When that library has to be rebuilt, both exes need to be rebuilt, 
too.

Andreas


On 08.02.2013 12:21, Nick Overdijk wrote:

Can't you only launch parent.exe in VS and remove the dependency?

On 2013-08-02, at 12:19:56 , Andreas Haferburg wrote:


In our build, we have two executables, parent.exe launches child.exe as a child 
process. ATM the build is set up with add_dependencies(parent child). So when 
using F5 in Visual Studio, child.exe is built first, then parent.exe, then 
parent.exe is launched. Is it possible to set this up such that child.exe and 
parent.exe are built in parallel before launching parent?

Regards
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





--
Scopis GmbH
Blücherstr. 22
10961 Berlin
Germany

E-Mail: ahaferb...@scopis.com
Tel.: +49 (30) 201 69 38 0
Fax.: +49 (30) 201 69 38 20
Internet: www.scopis.com

HRB 128315 Berlin Charlottenburg
USt-IdNr.: DE272721463
Steuernummer: 29/014/02034
Geschäftsführer:  Bartosz Kosmecki

Diese E-mail, einschließlich der Anhänge, ist ausschließlich für den oben 
genannten Adressaten bestimmt und beinhaltet vertrauliche und/oder gesetzlich 
geschützte Informationen. Jedem anderen Empfänger ist die Vervielfältigung, 
Weitergabe oder Veröffentlichung untersagt. Falls Sie diese Mitteilung 
irrtümlicherweise erhalten haben, bitten wir um sofortige Information an den 
Absender und Vernichtung der E-mail.

This e-mail, including the attachments, is for the exclusive use of the 
above-named addresses and contains confidential information and/or information 
protected by law. Any other recipient is prohibited from duplicating, passing 
on to third parties, or publishing this information. If by error you are the 
recipient of this communication please inform the sender immediately and 
permanently delete this e-mail.





--
Scopis GmbH
Blücherstr. 22
10961 Berlin
Germany

E-Mail: ahaferb...@scopis.com
Tel.: +49 (30) 201 69 38 0
Fax.: +49 (30) 201 69 38 20
Internet: www.scopis.com

HRB 128315 Berlin Charlottenburg
USt-IdNr.: DE272721463
Steuernummer: 29/014/02034
Geschäftsführer:  Bartosz Kosmecki

Diese E-mail, einschließlich der Anhänge, ist ausschließlich für den oben genannten Adressaten 
bestimmt und beinhaltet vertrauliche und/oder gesetzlich geschützte Informationen. Jedem anderen 
Empfänger ist die Vervielfältigung, Weitergabe oder Veröffentlichung untersagt. Falls Sie diese 
Mitteilung irrtümlicherweise erhalten haben, bitten wir um sofortige Information an den Absender und 
Vernichtung der E-mail.


This e-mail, including the attachments, is for the exclusive use of the above-named addresses and 
contains confidential information and/or information protected by law. Any other recipient is 
prohibited from duplicating, passing on to third parties, or publishing this information. If by 
error you are the recipient of this communication please inform the sender immediately and 
permanently delete this e-mail.

--

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] Dependency for launching an application

2013-02-08 Thread Andreas Haferburg
Yay, that is almost what I want. Except that I'd like the launch target to behave exactly like the 
parent target: When I select the project in Visual Studio, I'd like to press F7 to build it and F5 
to run it (with the debugger attached). When using add_custom_target(), the exe is started at build 
time. I've tried add_executable(.. IMPORTED), but it doesn't create a VS project.


Regards,
Andreas


On 08.02.2013 15:37, eduard_h...@mcafee.com wrote:

You need an intermediary layer that depends on parent and child and
wraps execution of parent.

Something like this (untested):

add_library(common MyFancyString.cpp)

add_executable(parent parent_main.cpp)
target_link_libraries(parent common.lib)

add_executable(child child_main.cpp)
target_link_libraries(child common.lib)

add_custom_target(launch ${CMAKE_CURRENT_BINARY_DIR}/parent.exe)
add_dependencies(launch parent child)

Cya, Ed

On 02/08/2013 03:16 PM, Andreas Haferburg wrote:

Sure. Example:

add_library(common MyFancyString.cpp)

add_executable(parent parent_main.cpp)
target_link_libraries(parent common.lib)

add_executable(child child_main.cpp)
target_link_libraries(child common.lib)
add_dependencies(parent child)

Now I make a change to MyFancyString.cpp, select the parent project, and
hit F5. Both executables use MyFancyString, so both need to be re-built.

What happens is that common is built, then child, then parent, then
parent is executed.
What I'd like to happen is that common is built, then child+parent are
being built concurrently, and as soon as both are done, parent is executed.

I hope it's clearer now.

Regards,
Andreas



On 08.02.2013 12:51, Nick Overdijk wrote:

Well cmake will take care of that if you target_link_library(common),
right?

On 2013-08-02, at 12:50:13 , Andreas Haferburg wrote:


Right, sorry. I should have mentioned that they both depend on some
library common.lib. When that library has to be rebuilt, both exes
need to be rebuilt, too.

Andreas


On 08.02.2013 12:21, Nick Overdijk wrote:

Can't you only launch parent.exe in VS and remove the dependency?

On 2013-08-02, at 12:19:56 , Andreas Haferburg wrote:


In our build, we have two executables, parent.exe launches
child.exe as a child process. ATM the build is set up with
add_dependencies(parent child). So when using F5 in Visual Studio,
child.exe is built first, then parent.exe, then parent.exe is
launched. Is it possible to set this up such that child.exe and
parent.exe are built in parallel before launching parent?

Regards
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





--

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] Dependency for launching an application

2013-02-08 Thread Andreas Haferburg
Yes, that's pretty much the setup we have: The common (static) library contains almost all obj's, 
and the two exe projects only have a small main.obj and link against the library. I'd like to 
eliminate the build(=link) time of child.exe by having the linker link both exes at the same time.


Regards,
Andreas


On 08.02.2013 15:41, Patrick Johnmeyer wrote:

On Fri, Feb 8, 2013 at 8:16 AM, Andreas Haferburg ahaferb...@scopis.com
mailto:ahaferb...@scopis.com wrote:

What happens is that common is built, then child, then parent, then parent 
is executed.
What I'd like to happen is that common is built, then child+parent are 
being built concurrently,
and as soon as both are done, parent is executed.


Unfortunately that's just not how dependencies work. If parent is dependent on 
child, then child
will build before parent in serial. And since they are both dependent on 
common, you essentially
have a linear dependency in your example.

You could break this up by creating a new target that is dependent on child and 
parent, and
eliminate parent's direct dependency on child. This will allow child and parent 
to be built
simultaneously. You would then need to do something with this new target so 
that it will cause
parent to be run.

You may be able to improve build times (assuming that is the driver) by 
invoking the compiler flag
for parallel compilation. Another option may be to convert the majority of 
child and parent to
another library, with small simple executable projects that invoke those 
libraries. This moves the
dependencies around in a way that you *may* get better build performance ... 
but everything I say is
speculative without knowing the nitty gritty of your project -- build times per 
project, full
dependency graph, etc.

--

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] unable to view file properties using CMAKE 2.8.7 in VS2010

2013-02-04 Thread Andreas Haferburg
The workaround I use is to set the build directory to another drive. I added a batch file to my 
Startup folder which contains only this line:


subst b: G:\dev\build

Regards,
Andreas


On 31.01.2013 21:00, Bryn Aspestrand wrote:

Ah, this seems to be an issue with the generated files clashing with a bug in 
VS2010

https://connect.microsoft.com/VisualStudio/feedback/details/635294/using-absolute-path-in-clcompile-item-prevents-property-pages-from-showing

Is there a workaround for this in 2.8.7? I’m stuck using that version due to 
issues I’m experiencing
with newer CMAKE versions

Thanks!

BA

*From:*cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] *On Behalf Of 
*Bryn Aspestrand
*Sent:* Thursday, January 31, 2013 11:55 AM
*To:* cmake@cmake.org
*Subject:* [CMake] unable to view file properties using CMAKE 2.8.7 in VS2010

Hey there. I created a bare minimum cmake project

ADD_LIBRARY (foo foo.c)

When I open that solution in VS2010 and right click on foo.c and select 
properties, the properties
dialog comes up but when I try to view each property (C/C++  General, 
Optimization, Preprocessor,
etc…), nothing displays. The view is literally blank. No fields, just white. If 
I make the same
project using the visual studio 2010 wizard instead of cmake, I am able to see 
properties.

Is there something I need to enable in CMAKE to see these properties or is this 
a bug?

Thanks in advance!

BA



--

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




--
Scopis GmbH
Blücherstr. 22
10961 Berlin
Germany

E-Mail: ahaferb...@scopis.com
Tel.: +49 (30) 201 69 38 0
Fax.: +49 (30) 201 69 38 20
Internet: www.scopis.com

HRB 128315 Berlin Charlottenburg
USt-IdNr.: DE272721463
Steuernummer: 29/014/02034
Geschäftsführer:  Bartosz Kosmecki

Diese E-mail, einschließlich der Anhänge, ist ausschließlich für den oben genannten Adressaten 
bestimmt und beinhaltet vertrauliche und/oder gesetzlich geschützte Informationen. Jedem anderen 
Empfänger ist die Vervielfältigung, Weitergabe oder Veröffentlichung untersagt. Falls Sie diese 
Mitteilung irrtümlicherweise erhalten haben, bitten wir um sofortige Information an den Absender und 
Vernichtung der E-mail.


This e-mail, including the attachments, is for the exclusive use of the above-named addresses and 
contains confidential information and/or information protected by law. Any other recipient is 
prohibited from duplicating, passing on to third parties, or publishing this information. If by 
error you are the recipient of this communication please inform the sender immediately and 
permanently delete this e-mail.

--

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] External dependencies and Windows

2013-02-04 Thread Andreas Haferburg
DLL Hell becomes an issue when executing a program. The EXE needs to use the DLLs that correspond to 
the LIB files it was linked against.


I think you're only concerned with building a library or an executable here. The way CMake is 
designed is that you simply call find_package(), and the FindX.cmake script is supposed to figure 
out the rest.


When it comes to building a Windows installer for your EXE, only then will you have to be concerned 
with DLL hell (i.e. add all DLLs to the installer).


Regards,
Andreas



On 04.02.2013 14:05, Ansis Māliņš wrote:

Exactly! So, going back to my original question, how do I use CMake in face of 
DLL Hell?


On Mon, Feb 4, 2013 at 2:58 PM, Michael Wild them...@gmail.com 
mailto:them...@gmail.com wrote:

That has nothing to do whether the libraries are shared (i.e. dynamically 
linked) or not. It has
to do with the way that packaging works (or rather, doesn't work) on 
Windows. In the pre-.NET
era it was simply impossible to use library versioning on Windows. If 
package A installed
python.dll version X.Y into C:\Windows\System32 and later package B 
installed version Z.F into
the same place, package A stopped working. Further, packagers where 
essentially forced to
include all dependencies in their packages because there's no 
dependency-resolution mechanism.
That's why people started providing a copy of all the dependencies in the 
installation directory
of their package. Of course, this leads to a lot of duplication, especially 
for rather popular
things such as Python or Qt. The whole situation is referred to as DLL 
hell:
http://en.wikipedia.org/wiki/DLL_Hell

Michael


On Mon, Feb 4, 2013 at 1:43 PM, Ansis Māliņš ansis.mal...@gmail.com
mailto:ansis.mal...@gmail.com wrote:

If shared libraries on Windows are truly shared, then why so many 
applications carry their
own copies of that same Qt and Python? Examples from my own Program 
Files: Anki, Blender,
Mixxx, Mumble, TortoiseHg.


On Mon, Feb 4, 2013 at 2:15 PM, Michael Wild them...@gmail.com 
mailto:them...@gmail.com
wrote:

Hi


On Mon, Feb 4, 2013 at 12:43 PM, Ansis Māliņš 
ansis.mal...@gmail.com
mailto:ansis.mal...@gmail.com wrote:

I'm just learning CMake and posting questions in this mailing 
list, but the answers
I get only confuse me. It seems I must take a step back and ask 
more general questions.

In Linux there is a package for everything, so you just 
find_package whatever you need.

But on Windows most libraries exist only as zip files that 
you're supposed to unpack
right in your build environment and ship them together with the 
executable.
(Basically, in practice, there is no such thing as shared 
libraries in Windows -
nothing for find_package to find.)


What then are DLL's? They are the shared libraries of the Windows 
world. True, the
semantics are a bit different, but they are dynamically linked. 
It's also not true that
on Windows everything is a zip files that you're supposed to 
unpack right in your build
environment. If you don't believe me, try to take a look at Qt or 
Python.


So how am I supposed to write portable CMake scripts in face of 
this?



  Often the Windows packages are installed into a few well known 
locations, or even
better, create a registry key containing installation information 
which you then can use
to find the software in your CMake code. Also, for SDL I would 
recommend to use the
FindSDL.cmake module (not sure whether that works with SDL2, 
though), and only if that
fails, to resort to ExternalProject. It is good practice to offer 
the user the choice
which way should be used through a cached variable.

HTH

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




--
Scopis GmbH
Blücherstr. 22
10961 Berlin
Germany

E-Mail: ahaferb...@scopis.com
Tel.: +49 (30) 201 69 38 0
Fax.: +49 (30) 201 69 38 20
Internet: www.scopis.com

HRB 128315 Berlin Charlottenburg
USt-IdNr.: DE272721463
Steuernummer: 29/014/02034
Geschäftsführer:  Bartosz Kosmecki

Diese E-mail, einschließlich der Anhänge, ist ausschließlich für den oben genannten Adressaten 
bestimmt und beinhaltet vertrauliche und/oder gesetzlich geschützte Informationen. Jedem anderen 
Empfänger ist die Vervielfältigung, Weitergabe oder Veröffentlichung untersagt. Falls Sie diese 
Mitteilung irrtümlicherweise erhalten haben, bitten wir um sofortige 

Re: [CMake] retreiving the libraries the maven way?

2013-01-15 Thread Andreas Haferburg
CMake doesn't support this out of the box. For most library dependencies, it's not even possible to 
retrieve their version, because either the FindXYZ scripts aren't written properly, or because the 
library doesn't provide it in the first place. Every library and every Find script does things 
differently. E.g. some find scripts use find_package(Lib) and define Lib_FOUND, others LIB_FOUND. My 
favorite: find_package(Qt4) defines QT4_FOUND, but ALL OTHER variables are prefixed with QT_.


I ended up setting up a library directory on our server which follows a simple naming convention, 
lib-version-compiler. On the local developer machines, a similar directory exists for the 
libraries. If a particular library directory doesn't exist locally, it is fetched from the server. 
Simple, stupid, but since there is no meta information available as part of c++ libraries, that's 
the best I could come up with. If you need more help I can post some scripts.


Best regards
Andreas


On 14.01.2013 09:17, Nicolas Herbaut wrote:

Hello,

I started working on a new c++ project comming back after 4+ years of java 
coding.

For java, I use nexus, which is a binary repository server, that provides an 
nice REST API that
allows clients to download dependencies by providing the library name and a 
target version.

I'm wondering if it would be feasible and difficult to port this logic into a 
cmake plugin, and
allowing the find_library to seamlessly retreive the library from the system OR 
from a nexus server.

currently all our dependencies are stored in the svn, which slows down our 
builds and is not very
flexible.

Let me be more specific by describing my usecase.

1- On a Windows PC, I need the zlib dll and the standard C dll to build my 
project
2- I issue a find_library command specifying both custom library paths and a 
nexus server URL
3 - for the standard C library, cmake findsout that it's already located into 
the system
4 - for zlib, cmake performs a request to the server which acknowledge the 
availability of the dll
5 - cmake downloads the library in a cache folder and tells the generator to 
link to the library it
downloaded
6 - if the library cannot be found on the system and on the binary server, 
cmake fails
7 - the same thing happen on a mac system, but this time both the C lib and 
zlib are on the path,
hence binary server is not even queried for a lib.

Could you guys give me your insights for this project?


--

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



--
Scopis GmbH
Blücherstr. 22
10961 Berlin
Germany

E-Mail: ahaferb...@scopis.com
Tel.: +49 (30) 201 69 38 0
Fax.: +49 (30) 201 69 38 20
Internet: www.scopis.com

HRB 128315 Berlin Charlottenburg
USt-IdNr.: DE272721463
Steuernummer: 29/014/02034
Geschäftsführer:  Bartosz Kosmecki

Diese E-mail, einschließlich der Anhänge, ist ausschließlich für den oben genannten Adressaten 
bestimmt und beinhaltet vertrauliche und/oder gesetzlich geschützte Informationen. Jedem anderen 
Empfänger ist die Vervielfältigung, Weitergabe oder Veröffentlichung untersagt. Falls Sie diese 
Mitteilung irrtümlicherweise erhalten haben, bitten wir um sofortige Information an den Absender und 
Vernichtung der E-mail.


This e-mail, including the attachments, is for the exclusive use of the above-named addresses and 
contains confidential information and/or information protected by law. Any other recipient is 
prohibited from duplicating, passing on to third parties, or publishing this information. If by 
error you are the recipient of this communication please inform the sender immediately and 
permanently delete this e-mail.

--

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_MAKE_PROGRAM is not set - Win7 and Visual Studio 10

2012-12-12 Thread Andreas Haferburg

On 05.12.2012 14:21, Benoît Thiébault wrote:

   $ENV{ProgramFiles} (x86)/Microsoft Visual Studio 10.0/Common7/IDE
   $ENV{ProgramFiles} (x86)/Microsoft Visual Studio10.0/Common7/IDE
   $ENV{ProgramFiles} (x86)/Microsoft Visual Studio 10/Common7/IDE
   $ENV{ProgramFiles} (x86)/Microsoft Visual Studio10/Common7/IDE


The environment variable is called ProgramFiles(x86)

$ENV{ProgramFiles(x86)}/Microsoft Visual Studio 10.0/Common7/IDE
$ENV{ProgramFiles(x86)}/Microsoft Visual Studio10.0/Common7/IDE
$ENV{ProgramFiles(x86)}/Microsoft Visual Studio 10/Common7/IDE
$ENV{ProgramFiles(x86)}/Microsoft Visual Studio10/Common7/IDE

Looks like a CMake bug to me.

Best regards
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


[CMake] Using pkg_check_modules on Windows

2012-11-30 Thread Andreas Haferburg

I'm trying to use pkg_check_modules in my FindCMinPack script. How can I make 
it find the .pc file?

find_package(PkgConfig)
pkg_check_modules(PC_CMINPACK cminpack=${CMinPack_FIND_VERSION})


--
Found PkgConfig: C:/dev/bin/pkg-config.exe (found version 0.26)
checking for module 'cminpack=1.1.3'
  package 'cminpack=1.1.3' not found


Thanks,
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] 'NMake Makefiles' generate does not support parallel builds (/MP)?

2012-09-21 Thread Andreas Haferburg
My bad, we're not using nmake but msbuild in Jenkins (command line only). Judging from the 
compilation speed, I'm pretty sure it respects the /MP flag.


Best regards
Andreas



On 20.09.2012 18:24, Bill Hoffman wrote:

nmake does not do parallel builds.  Try using jom.

http://blog.qt.digia.com/2009/03/27/speeding-up-visual-c-qt-builds/
http://qt-project.org/wiki/jom


/MP only works from the VS IDE.


On 9/20/2012 11:34 AM, Andreas Haferburg wrote:

Hi Yuchen,

we're using the same way to enable /MP, and it works for us. You didn't
say exactly what doesn't work, so I'm left to guessing.

Have you checked in Visual Studio if the flag is set (Project
properties-C/C++-Command Line)? Maybe there's a conflicting option
enabled? Or maybe you're changing the CMAKE_CXX_FLAGS variable too late,
e.g. after calling add_executable()?

Have you checked the value in Tools-Options-Projects and
Solutions-VC++ Project Settings-Maximum ...

Best regards,
Andreas


On 20.09.2012 10:45, Loaden wrote:

Hi, there!
I am using Windows SDK 7.1 + nmake + CMake for building Windows
applications.
Follow these:
http://www.cmake.org/pipermail/cmake/2009-April/028668.html
http://msdn.microsoft.com/en-us/library/bb385193.aspx
I can't make /MP option works after this change in CMake's main
CMakeLists.txt

if (MSVC)
   SET(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} /MP)
   SET(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} /MP)
   message(STATUS CMAKE_CXX_FLAGS = ${CMAKE_CXX_FLAGS})
   message(STATUS CMAKE_C_FLAGS = ${CMAKE_C_FLAGS})
endif()


I know Jom which is a good choice for speed up compilation, but some
times, it will broken my builds.
See: http://qt-project.org/wiki/jom

Am I lost some option? does there exist an valid way?
or, It's just a bug from CMake self?
Thanks a lot!

--
Best Regards
Yuchen



--

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










--
Scopis GmbH
Blücherstr. 22
10961 Berlin
Germany

E-Mail: ahaferb...@scopis.com
Tel.: +49 (30) 39 82 05 98
Fax.: +49 (30) 39 82 05 99
Internet: www.scopis.com

HRB 128315 Berlin Charlottenburg
USt-IdNr.: DE272721463
Steuernummer: 29/014/02034
Geschäftsführer:  Bartosz Kosmecki

Diese E-mail, einschließlich der Anhänge, ist ausschließlich für den oben genannten Adressaten 
bestimmt und beinhaltet vertrauliche und/oder gesetzlich geschützte Informationen. Jedem anderen 
Empfänger ist die Vervielfältigung, Weitergabe oder Veröffentlichung untersagt. Falls Sie diese 
Mitteilung irrtümlicherweise erhalten haben, bitten wir um sofortige Information an den Absender und 
Vernichtung der E-mail.


This e-mail, including the attachments, is for the exclusive use of the above-named addresses and 
contains confidential information and/or information protected by law. Any other recipient is 
prohibited from duplicating, passing on to third parties, or publishing this information. If by 
error you are the recipient of this communication please inform the sender immediately and 
permanently delete this e-mail.

--

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] 'NMake Makefiles' generate does not support parallel builds (/MP)?

2012-09-20 Thread Andreas Haferburg

Hi Yuchen,

we're using the same way to enable /MP, and it works for us. You didn't say exactly what doesn't 
work, so I'm left to guessing.


Have you checked in Visual Studio if the flag is set (Project properties-C/C++-Command Line)? 
Maybe there's a conflicting option enabled? Or maybe you're changing the CMAKE_CXX_FLAGS variable 
too late, e.g. after calling add_executable()?


Have you checked the value in Tools-Options-Projects and Solutions-VC++ Project Settings-Maximum 
...


Best regards,
Andreas


On 20.09.2012 10:45, Loaden wrote:

Hi, there!
I am using Windows SDK 7.1 + nmake + CMake for building Windows applications.
Follow these:
http://www.cmake.org/pipermail/cmake/2009-April/028668.html
http://msdn.microsoft.com/en-us/library/bb385193.aspx
I can't make /MP option works after this change in CMake's main CMakeLists.txt

if (MSVC)
   SET(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} /MP)
   SET(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} /MP)
   message(STATUS CMAKE_CXX_FLAGS = ${CMAKE_CXX_FLAGS})
   message(STATUS CMAKE_C_FLAGS = ${CMAKE_C_FLAGS})
endif()


I know Jom which is a good choice for speed up compilation, but some times, it 
will broken my builds.
See: http://qt-project.org/wiki/jom

Am I lost some option? does there exist an valid way?
or, It's just a bug from CMake self?
Thanks a lot!

--
Best Regards
Yuchen



--

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




--
Scopis GmbH
Blücherstr. 22
10961 Berlin
Germany

E-Mail: ahaferb...@scopis.com
Tel.: +49 (30) 39 82 05 98
Fax.: +49 (30) 39 82 05 99
Internet: www.scopis.com

HRB 128315 Berlin Charlottenburg
USt-IdNr.: DE272721463
Steuernummer: 29/014/02034
Geschäftsführer:  Bartosz Kosmecki

Diese E-mail, einschließlich der Anhänge, ist ausschließlich für den oben genannten Adressaten 
bestimmt und beinhaltet vertrauliche und/oder gesetzlich geschützte Informationen. Jedem anderen 
Empfänger ist die Vervielfältigung, Weitergabe oder Veröffentlichung untersagt. Falls Sie diese 
Mitteilung irrtümlicherweise erhalten haben, bitten wir um sofortige Information an den Absender und 
Vernichtung der E-mail.


This e-mail, including the attachments, is for the exclusive use of the above-named addresses and 
contains confidential information and/or information protected by law. Any other recipient is 
prohibited from duplicating, passing on to third parties, or publishing this information. If by 
error you are the recipient of this communication please inform the sender immediately and 
permanently delete this e-mail.

--

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 with IDL file generation

2012-09-12 Thread Andreas Haferburg

Here's what we're using (found somewhere on the internet, slightly modified):



# MACRO_ADD_INTERFACES(idl_files...)
#
# Syntax: MACRO_ADD_INTERFACES(output list idl1 [idl2 [...]])
# Notes: idl1 should be absolute paths so the MIDL compiler can find them.
# For every idl file xyz.idl, two files xyz_h.h and xyz.c are generated, which
# are added to the output list

# Copyright (c) 2007, Guilherme Balena Versiani, [EMAIL PROTECTED]
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
MACRO (MACRO_ADD_INTERFACES _output_list)
 FOREACH(_in_FILE ${ARGN})
   GET_FILENAME_COMPONENT(_out_FILE ${_in_FILE} NAME_WE)
   GET_FILENAME_COMPONENT(_in_PATH ${_in_FILE} PATH)

   SET(_out_header_name ${_out_FILE}_h.h)
   SET(_out_header ${CMAKE_CURRENT_BINARY_DIR}/${_out_header_name})
   SET(_out_iid_name ${_out_FILE}.c)
   SET(_out_iid ${CMAKE_CURRENT_BINARY_DIR}/${_out_iid_name})
   #message(_out_header_name=${_out_header_name}, _out_header=${_out_header}, 
_out_iid=${_out_iid})
   ADD_CUSTOM_COMMAND(
 OUTPUT ${_out_header} ${_out_iid}
 DEPENDS ${_in_FILE}
 COMMAND midl /header ${_out_header_name} /iid ${_out_iid_name} ${_in_FILE}
 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
   )

   MACRO_ADD_FILE_DEPENDENCIES(
 ${_out_header}
 ${_in_FILE}
   )

   SET_SOURCE_FILES_PROPERTIES(
 ${_out_header}
 ${_out_iid}
 PROPERTIES
 GENERATED TRUE
   )
   SET_SOURCE_FILES_PROPERTIES(${_in_FILE} PROPERTIES HEADER_FILE_ONLY TRUE)

   SET(${_output_list} ${${_output_list}}
 ${_out_header}
 ${_out_iid}
   )

 ENDFOREACH(_in_FILE ${ARGN})

ENDMACRO (MACRO_ADD_INTERFACES)


then in the main script:

# MIDL compiler
MACRO_ADD_INTERFACES(GENERATED_FILES_IDL ${PROJECT_IDL_FILES})

SOURCE_GROUP(IDL FILES ${GENERATED_FILES_IDL} ${PROJECT_IDL_FILES})

ADD_EXECUTABLE( ${CURRENT_PROJECT}
  ...
  ${PROJECT_IDL_FILES}
  ${GENERATED_FILES_IDL}
)

Hope that helps.

Cheers
Andreas


On 11.09.2012 01:38, Robert Dailey wrote:

I'm creating a shared library target that needs to compile and include
source generated by an IDL. I want CMake to create a custom target
that will invoke MIDL.EXE (comes with Windows SDK) against the IDL
file to generate the header / source files needed. These header/source
files will then be built by the shared library target. I saw a similar
post on this here:

http://www.cmake.org/pipermail/cmake/2011-July/045617.html

This seems complicated and I'm not sure it even works, since from my
tests, if source files don't exist by the time add_library,
add_executable, etc is called, generation will fail. I also don't want
CMake to invoke MIDL for me since that would require us to run CMake
again every time the IDL file changes (this shouldn't be the case, we
should just have to rebuild the target again using Visual Studio or
NMake).

Any ideas on a simple solution to this?

Thanks in advance.
--

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




--
Scopis GmbH
Blücherstr. 22
10961 Berlin
Germany

E-Mail: ahaferb...@scopis.com
Tel.: +49 (30) 39 82 05 98
Fax.: +49 (30) 39 82 05 99
Internet: www.scopis.com

HRB 128315 Berlin Charlottenburg
USt-IdNr.: DE272721463
Steuernummer: 29/014/02034
Geschäftsführer:  Bartosz Kosmecki

Diese E-mail, einschließlich der Anhänge, ist ausschließlich für den oben genannten Adressaten 
bestimmt und beinhaltet vertrauliche und/oder gesetzlich geschützte Informationen. Jedem anderen 
Empfänger ist die Vervielfältigung, Weitergabe oder Veröffentlichung untersagt. Falls Sie diese 
Mitteilung irrtümlicherweise erhalten haben, bitten wir um sofortige Information an den Absender und 
Vernichtung der E-mail.


This e-mail, including the attachments, is for the exclusive use of the above-named addresses and 
contains confidential information and/or information protected by law. Any other recipient is 
prohibited from duplicating, passing on to third parties, or publishing this information. If by 
error you are the recipient of this communication please inform the sender immediately and 
permanently delete this e-mail.

--

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] Defer compiler to different file in Visual Studio

2012-03-12 Thread Andreas Haferburg

Hello,

I'm currently evaluating Lazy C++ [1], which generates both header and 
source files. I'm using add_custom_command() to invoke the generator on 
*.lzz file, and for each .lzz file it generates one .hpp file and one 
.cpp file. What I'm missing is the ability to compile the file I'm 
currently editing from within Visual Studio.


With .cpp files it's possible to compile just one file, e.g. by 
right-clicking it in the Solution Explorer, then selecting Compile. Or 
even better, bind it to a hotkey.


So what I'd like to do is for each lzz file, set the compile command to 
compile the corresponding cpp file. I can't imagine it being that hard, 
since one would merely have to change the file extension in the command 
line from cpp to lzz. Any ideas?


I'm not sure though, this might be more of a Visual Studio-specific 
question than a CMake-specific one.


Thanks,
Andreas

[1] http://www.lazycplusplus.com/index.html
--

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] Defer compiler to different file in Visual Studio

2012-03-12 Thread Andreas Haferburg

On 12-Mar-12 9:36 PM, Bill Hoffman wrote:

On 3/12/2012 3:28 PM, Andreas Haferburg wrote:

Hello,

I'm currently evaluating Lazy C++ [1], which generates both header and
source files. I'm using add_custom_command() to invoke the generator on
*.lzz file, and for each .lzz file it generates one .hpp file and one
.cpp file. What I'm missing is the ability to compile the file I'm
currently editing from within Visual Studio.

With .cpp files it's possible to compile just one file, e.g. by
right-clicking it in the Solution Explorer, then selecting Compile. Or
even better, bind it to a hotkey.

So what I'd like to do is for each lzz file, set the compile command to
compile the corresponding cpp file. I can't imagine it being that hard,
since one would merely have to change the file extension in the command
line from cpp to lzz. Any ideas?

I'm not sure though, this might be more of a Visual Studio-specific
question than a CMake-specific one.



Lzz is not a compiler, but rather a code generator. I would set things
up so that you do something like this:

create_lzz_source_list(MY_CPP_HH_SOURCES foo.lzz bar.lzz car.zzz)
add_library(mylib ${MY_CPP_HH_SOURCES})

# create_lzz_sources would be a function that creates a bunch of custom
commands that run lzz on each lzz input file and create a .cpp and .hh
file. So, there should be a custom command for each .cpp and .hh file.
You should be able to click on one of those can select compile, and it
will run that file.

This is the exact type of thing that is done for the VTK code wrapper code.


Yea, that's pretty much what I've got so far. And yes, I realize that's 
the way it's *supposed* to be set up. ;) I've posted my CMakeLists.txt 
here if you want to have a look:

http://stackoverflow.com/a/9669388/872616

The only time I would really like to have anything to do with generated 
files is if something goes wrong with the generation, but not during 
normal development. I'd like to set up the tool chain such that I only 
have to touch the .lzz files, and the .hpp/.cpp would be completely 
hidden away in the build dir. Just as normally you wouldn't want to have 
anything to do with .obj files, you know?


Cheers
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] Defer compiler to different file in Visual Studio

2012-03-12 Thread Andreas Haferburg

Bill, thank you for your replies.

I'll be writing a macro for Visual Studio then which finds the 
corresponding cpp file and compiles it.


Cheers
Andreas


On 12-Mar-12 10:26 PM, Bill Hoffman wrote:

On 3/12/2012 5:00 PM, Andreas Haferburg wrote:

Yea, that's pretty much what I've got so far. And yes, I realize that's
the way it's *supposed* to be set up. ;) I've posted my CMakeLists.txt
here if you want to have a look:
http://stackoverflow.com/a/9669388/872616

The only time I would really like to have anything to do with generated
files is if something goes wrong with the generation, but not during
normal development. I'd like to set up the tool chain such that I only
have to touch the .lzz files, and the .hpp/.cpp would be completely
hidden away in the build dir. Just as normally you wouldn't want to have
anything to do with .obj files, you know?

I don't think you can do that. However, you can make it a little nicer
with this change:

MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/${filename}



From
Note that MAIN_DEPENDENCY is completely optional and is used as a
suggestion to visual studio about where to hang the custom command. In
makefile terms this creates a new target in the following form:

cmake --help-command add_custom_command

OUTPUT: MAIN_DEPENDENCY DEPENDS
COMMAND

However, when you right click on A.lzz and it will run lzz, and not the
full compiler cycle. You will have to right click on the generated .cpp
file to run the actual compiler. There is no way to collapse that into
one step.

-Bill

--

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




--
Scopis GmbH
Blücherstr. 22 / Aufg. 3
10961 Berlin
Germany

E-Mail: ahaferb...@scopis.com
Tel.: +49 (30) 39 82 05 98
Fax.: +49 (30) 39 82 05 99
Internet: www.scopis.com

HRB 128315 Berlin Charlottenburg
USt-IdNr.: DE272721463
Steuernummer: 29/014/02034
Geschäftsführer:  Bartosz Kosmecki

Diese E-mail, einschließlich der Anhänge, ist ausschließlich für den 
oben genannten Adressaten bestimmt und beinhaltet vertrauliche und/oder 
gesetzlich geschützte Informationen. Jedem anderen Empfänger ist die 
Vervielfältigung, Weitergabe oder Veröffentlichung untersagt. Falls Sie 
diese Mitteilung irrtümlicherweise erhalten haben, bitten wir um 
sofortige Information an den Absender und Vernichtung der E-mail.


This e-mail, including the attachments, is for the exclusive use of the 
above-named addresses and contains confidential information and/or 
information protected by law. Any other recipient is prohibited from 
duplicating, passing on to third parties, or publishing this 
information. If by error you are the recipient of this communication 
please inform the sender immediately and permanently delete this e-mail.

--

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] VS2010: /subsystem:console only in debug build

2012-03-06 Thread Andreas Haferburg

Hi,

I'd like to suppress the console, but only in release builds. What's the 
official way to do that?

add_executable(... win32 ...) doesn't work, because it switches off the console 
in debug builds.

When I set LINKER_FLAGS_RELEASE to /subsystem:windows, I can suppress the console in the release 
builds. However, the Properties window in VS2010 still displays Console (/SUBSYSTEM:CONSOLE) in 
the linker settings, and has two entries in the command line: /SUBSYSTEM:CONSOLE and 
/subsystem:windows. Only the latter seems to count.


When I set LINKER_FLAGS_RELEASE to /SUBSYSTEM:WINDOWS, CMake just drops it, and only retains 
/SUBSYSTEM:CONSOLE in the linker flags.


It seems to me that CMake recognizes /SUBSYSTEM:WINDOWS, but chooses to ignore it for some reason. 
The fact that /subsystem:windows works the way it does seems like a bug. So what's the proper way 
to achieve what I want?


I'm using CMake 2.8.7 on Win 7 with VS2010.

Cheers
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