Re: [CMake] Announcements mailing list

2012-06-25 Thread Ben Medina
You could subscribe to the Kitware blog. It's more than just CMake, but they do 
announce all releases there.  

Thanks,
Ben


On Monday, June 25, 2012 at 4:16 PM, Craig Scott wrote:

> Hi all. There's a fair amount of traffic on this list these days. Even in 
> digest 
> mode, it's not unusual to get up to 8 or more emails a day from this list 
> alone. For those who really just want to know when new CMake releases are 
> coming out, this list is a bit too busy. Any chance a separate mailing list 
> can be set up just for announcements from Kitware? It should only accept 
> submissions from Kitware staff and should only be used for notices about 
> releases (including release candidates, betas, etc.). I've come across such 
> lists for other software (eg Doxygen) and it is a very convenient way to keep 
> tabs on what's coming up without having to be exposed to all the low level 
> development and bugs/issues in between.
> 
> Any chance?
> 
> --
> Craig Scott | Senior Software Engineer
> Southern Innovation
> Melbourne, Australia
> www.southerninnovation.com 
> 
> --
> 
> 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] Visual Studio 2012 Beta: unable to compile individual files

2012-06-21 Thread Ben Medina
Yes, you have to be running a nightly build of CMake. 2.8.8 does not
use relative paths in VS2010 projects.

On Thu, Jun 21, 2012 at 3:17 AM, Klaim - Joël Lamotte  wrote:
> Hi, I'm having the same problem with a project generated with CMake 2.8.8 to
> VS2010 open with VS2012 RC.
>
>
> On Wed, Jun 13, 2012 at 3:20 AM, Ben Medina  wrote:
>>
>> - Using the VS2010 generator, the project files have relative paths.
>> VS2012RC can load 2010 project files without modifying them. If I do
>> this, compilation of individual files is successful.
>
>
>
> I tried this but it doesn't seem to work here.
> I first deleted the cache of CMake (using the GUI), modified my root cmake
> file to add relative paths (that I have never seen working before, by the
> way)
> but once the project is generated and open in VS2012 I still can't compile a
> unique cpp file.
>
> Is there, maybe, another condition?
>
> Joel Lamotte
--

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] ExternalProject_Add and Boost

2012-06-18 Thread Ben Medina
That's right. You can pass various initial cache entries, such as
BOOST_ROOT, via the CMAKE_CACHE_ARGS parameter to ExternalProject_Add.

A useful example of this is the Titan project:
http://www.kitware.com/InfovisWiki/index.php/Main_Page
You can see how it builds VTK as an external project, forcing it to
use the externally-built Boost via cache arguments.

On Mon, Jun 18, 2012 at 11:03 AM, Knox, Kent  wrote:
> That is an interesting approach; if this 'superbuild' cmake project 
> downloaded and built all the external dependencies first, then my project 
> could find those dependencies with the appropriate find module?  I suppose 
> that the 'superbuild' could set the BOOST_ROOT variable (or other appropriate 
> variables) for my real project.  I'll play around with this idea when I get 
> some time, thanks for the comment!
>
> -Original Message-
> From: Ben Medina [mailto:ben.med...@gmail.com]
> Sent: Monday, June 18, 2012 11:59 AM
> To: Knox, Kent
> Cc: cmake@cmake.org
> Subject: Re: [CMake] ExternalProject_Add and Boost
>
>> 4.       ExternalProject_Add will download, configure and build projects at
>> 'build' time.  From the documentation, this sounded like a design decision.
>> However, this means that you can't use the already robust and mature
>> findboost() module to configure the Boost project.  Would it be
>> possible to add support to ExternalProject_Add to work at 'configure' time?
>
> The approach that seems most common is to create a "superbuilder"
> project that builds your dependencies as external projects, then builds your 
> own project (also as an external project) at the end.
>
>
>
--

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] ExternalProject_Add and Boost

2012-06-18 Thread Ben Medina
> 4.   ExternalProject_Add will download, configure and build projects at
> ‘build’ time.  From the documentation, this sounded like a design decision.
> However, this means that you can’t use the already robust and mature
> findboost() module to configure the Boost project.  Would it be possible to
> add support to ExternalProject_Add to work at ‘configure’ time?

The approach that seems most common is to create a "superbuilder"
project that builds your dependencies as external projects, then
builds your own project (also as an external project) at the end.

On Sun, Jun 17, 2012 at 11:42 PM, Knox, Kent  wrote:
> Hi all~
>
>
>
> I have been experimenting in my project with using ExternalProject_Add.  My
> goal is to make our build process more automated, with less headache to get
> up and started developing on a fresh system.  I decided that boost would be
> a great dependency to automate, which I successfully completed and is a HUGE
> help. I would like also like to ask the community to code review what I did,
> and possibly offer feedback.  I also have my own comments with the
> experience.
>
>
>
> My code for review (this was developed only for windows, for now):
>
>
>
> include( ExternalProject )
>
>
>
> set( Boost_Version 1.49.0 )
>
> string( REPLACE "." "_" Boost_Version_Underscore ${Boost_Version} )
>
>
>
> message( STATUS "Boost_Version: " ${Boost_Version} )
>
>
>
> # Below is a CMake command to download, build and install Boost on the
> user’s computer
>
> ExternalProject_Add(
>
> Boost
>
>     PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/boost
>
>         URL
> http://downloads.sourceforge.net/project/boost/boost/${Boost_Version}/boost_${Boost_Version_Underscore}.zip
>
>     URL_MD5 854dcbbff31b896c85c38247060b7713
>
>         UPDATE_COMMAND "bootstrap.bat"
>
>     CONFIGURE_COMMAND ""
>
>     BUILD_COMMAND bjam --with-program_options address-model=64
> toolset=msvc-11.0 link=static stage
>
>     BUILD_IN_SOURCE 1
>
>         INSTALL_COMMAND ""
>
> )
>
>
>
> set_property( TARGET Boost PROPERTY FOLDER "Externals")
>
>
>
> ExternalProject_Get_Property( Boost source_dir )
>
> ExternalProject_Get_Property( Boost binary_dir )
>
> set( Boost_INCLUDE_DIRS ${source_dir} )
>
> set( Boost_LIBRARIES
> debug;${binary_dir}/stage/lib/libboost_program_options-vc110-mt-gd-1_49.lib;optimized;${binary_dir}/stage/lib/libboost_program_options-vc110-mt-1_49.lib
> )
>
>
>
> A few of my comments while developing this.   Boost’s native build system is
> called Jam.  However, there are efforts to port Boost to cmake, available
> either on github or gitorious.  I would rather stick with one build system
> and use cmake, but I could not use either of these repositories with
> ExternalProject_Add.
>
> 1.   Github appears to only use the https protocol, and the cmake file(
> download … ) command does not appear to handle this protocol.  So, I think
> GitHub is verboten for any ExternalProject_Add.  Am I right, or am I missing
> something?  Any plans to add https support?
>
> 2.   ExternalProject_Add checks the file extension of the URL download,
> to ‘verify’ the download is a supported package.  I would actually like to
> request that it not verify the file extension.  A lot of these public code
> repositories offer tarball and zipball downloads, but the links they provide
> are forwarding scripts (and they don’t offer you direct links), and
> oftentimes the URL to use has no extension.  I had this problem with both
> github and gitorious.  I think it has to be left to the user to verify that
> the link they use if valid.
>
> 3.   The official subversion repository of boost offers .7z packages to
> download.  These packages are about half the size of .zips.  Will cmake add
> decompression support for 7z archives in the near future?
>
> 4.   ExternalProject_Add will download, configure and build projects at
> ‘build’ time.  From the documentation, this sounded like a design decision.
> However, this means that you can’t use the already robust and mature
> findboost() module to configure the Boost project.  Would it be possible to
> add support to ExternalProject_Add to work at ‘configure’ time?  Maybe a
> flag to choose when to pay the build cost?  This would help me abstract the
> differences between linux and windows, for instance.  I understand that some
> people care that ‘configure’ is fast, but I would prefer not to rewrite the
> logic already in the findboost packge.  Also, if ExternalProject_Add worked
> at ‘configure’ time, then I would think that it would be possible for the
> findboost package maintainer to incorporate ExternalProject_Add into the
> find module itself.  Then, users could pass a possible flag into findBoost
> that says, ‘if you don’t find boost locally on the system, just download the
> lastest version of boost for me and proceed with configuring.’
>
>
>
> Thanks in advance for comments,
>
> Kent

Re: [CMake] Visual Studio rebuilding ZERO_CHECK

2012-06-13 Thread Ben Medina
For Visual Studio, I always disable the zero check project by setting
CMAKE_SUPPRESS_REGENERATION to true in my CMake cache. The downside is
that you have to run CMake by hand to regenerate project files. But
the experience of CMake running while Visual Studio has the project
loaded is quite terrible in VS2010, so it's not a big loss for me.

On Wed, Jun 13, 2012 at 8:14 AM, J Decker  wrote:
> On Wed, Jun 13, 2012 at 7:29 AM, Jonathan Romero  wrote:
>>
>>
>> On Wed, Jun 13, 2012 at 10:04 AM, Micha Renner 
>> wrote:
>>>
>>> Am Mittwoch, den 13.06.2012, 14:51 +0200 schrieb Robert Carnecky:
>>> > Hello,
>>> >
>>> > My Visual Studio 2010 is constantly prompting me to build ZERO_CHECK
>>> > every time I try to run my program, even though nothing has changed. Is
>>> > there a workaround for this?
>>>
>>> No, that is the current situation. This problem and some others belong
>>> to a complex of problems which CMake has with Visual Studio since 2008.
>>> May be it becomes better with VS 2012.
>>>
>>> Micha
>>>
>>>
>>> >
>>> > How to reproduce:
>>> > 1. Set up the simplest project possible (see below).
>>> > 2. Configure and generate using the CMake GUI.
>>> > 3. Open the project file and build the project. Project successfully
>>> > builds.
>>> > 4. Start the application from within Visual Studio (press F5). A message
>>> > box appears, saying "This project is out of date: ZERO_CHECK. Would you
>>> > like to build it?".
>>> > 5. Click on yes. ZERO_CHECK is built, no actual code gets compiled. The
>>> > application starts and exits.
>>> > 6. Go to step 4 (message box appears again).
>>> >
>>> > I do not want to enable automatic rebuilds without prompts, since I have
>>> > other projects where a build can take very long and I do not want to
>>> > start it when not necessary. Starting a build immediately deletes the
>>> > executable file and I would not be able to run the last version while
>>> > making changes to the code.
>>> >
>>> > Thanks in advance,
>>> > Robert
>>> >
>>> >
>>> > CMakeLists.txt:
>>> > project(test)
>>> > cmake_minimum_required (VERSION 2.8.8)
>>> > add_executable(main main.cpp)
>>> >
>>> > main.cpp:
>>> > int main() {return 0;}
>>> >
>>> > System:
>>> > CMake 2.8.8
>>> > Visual Studio 2010, 64bit compiler
>>> > Windows 7 64bit
>>> > --
>>> >
>>> > 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
>>
>>
>> Did you set your startup project?  ZERO_CHECK will be the default but you
>> can override it by right clicking on the actual project you wish to run and
>> choosing "Set as Startup Project" in visual studio.  I believe this is a
>> user specific setting in visual studio (not a project setting) so you always
>> have to do this through the GUI.  I dont think there is anything in your
>> CMakeLists.txt you can do to work around it.
>>
>
> It doesn't matter what project is startup, it's got an always-build
> sort of condition.  (but that's what catches changes if you modify
> cmakelists.txt and rebuild)
>
>> --
>> Jonathan S. Romero
>>
>> --
>>
>> 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
--

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] Visual Studio 2012 Beta: unable to compile individual files

2012-06-12 Thread Ben Medina
Thanks, Fraser! Note that the sample project I attached "may take a
few hours" to appear publicly, according to their bug report page.

And I apologize: everywhere I mention VS2012 beta in the above thread,
I meant VS2012 RC.

On Tue, Jun 12, 2012 at 12:02 PM, Fraser Hutchison
 wrote:
> Yeah - I can reproduce this too (better late than never - sorry!) I've
> upvoted your bug report Ben.
>
> Cheers,
>
> Fraser.
>
>
>
> On 12/06/2012 19:55, Ben Medina wrote:
>>
>> I've filed a bug with Microsoft:
>>
>> https://connect.microsoft.com/VisualStudio/feedback/details/748640/cannot-compile-individual-files-if-project-contains-full-path-to-file
>>
>> On Tue, Jun 12, 2012 at 11:20 AM, Ben Medina  wrote:
>>>
>>> Thanks! Here are the results:
>>>
>>> - Using the VS2010 generator, the project files have relative paths.
>>> VS2012RC can load 2010 project files without modifying them. If I do
>>> this, compilation of individual files is successful.
>>>
>>> - Using the VS11 generator, the project files have absolute paths, and
>>> compilation of individual files fails.
>>>
>>> So can the same relative path workaround be done for the VS11 generator?
>>>
>>> - Ben
>>>
>>> On Tue, Jun 12, 2012 at 8:54 AM, Brad King  wrote:
>>>>
>>>> On 06/12/2012 11:51 AM, Brad King wrote:
>>>>>
>>>>>  http://www.cmake.org/Bug/view.php?id=12570
>>>>>
>>>>> The main change to address it is here:
>>>>>
>>>>>  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d931ce9f
>>>>
>>>> I forgot to point out that this change is not in CMake 2.8.8
>>>> but will be in 2.8.9.
>>>>
>>>> -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
>
>
>
--

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] Visual Studio 2012 Beta: unable to compile individual files

2012-06-12 Thread Ben Medina
I've filed a bug with Microsoft:
https://connect.microsoft.com/VisualStudio/feedback/details/748640/cannot-compile-individual-files-if-project-contains-full-path-to-file

On Tue, Jun 12, 2012 at 11:20 AM, Ben Medina  wrote:
> Thanks! Here are the results:
>
> - Using the VS2010 generator, the project files have relative paths.
> VS2012RC can load 2010 project files without modifying them. If I do
> this, compilation of individual files is successful.
>
> - Using the VS11 generator, the project files have absolute paths, and
> compilation of individual files fails.
>
> So can the same relative path workaround be done for the VS11 generator?
>
> - Ben
>
> On Tue, Jun 12, 2012 at 8:54 AM, Brad King  wrote:
>> On 06/12/2012 11:51 AM, Brad King wrote:
>>>  http://www.cmake.org/Bug/view.php?id=12570
>>>
>>> The main change to address it is here:
>>>
>>>  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d931ce9f
>>
>> I forgot to point out that this change is not in CMake 2.8.8
>> but will be in 2.8.9.
>>
>> -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] Visual Studio 2012 Beta: unable to compile individual files

2012-06-12 Thread Ben Medina
Thanks! Here are the results:

- Using the VS2010 generator, the project files have relative paths.
VS2012RC can load 2010 project files without modifying them. If I do
this, compilation of individual files is successful.

- Using the VS11 generator, the project files have absolute paths, and
compilation of individual files fails.

So can the same relative path workaround be done for the VS11 generator?

- Ben

On Tue, Jun 12, 2012 at 8:54 AM, Brad King  wrote:
> On 06/12/2012 11:51 AM, Brad King wrote:
>>  http://www.cmake.org/Bug/view.php?id=12570
>>
>> The main change to address it is here:
>>
>>  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d931ce9f
>
> I forgot to point out that this change is not in CMake 2.8.8
> but will be in 2.8.9.
>
> -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] Visual Studio 2012 Beta: unable to compile individual files

2012-06-12 Thread Ben Medina
Thanks for the suggestion. Unfortunately, CMAKE_USE_RELATIVE_PATHS
seems to have no effect for this generator.

- Ben

On Tue, Jun 12, 2012 at 2:21 AM, Brett Delle Grazie
 wrote:
> On 12 June 2012 00:21, Ben Medina  wrote:
>> Has anyone tried the Visual Studio 2012 beta with CMake's "Visual
>> Studio 11" generator? I've tried with several projects, and even a
>> simple project that just contains main.cpp has the same problem:
>> compiling a single file does not work. Instead, I get this in the
>> output window:
>>
>> 1>Error: Cannot build selected files.
>>
>> This seems to be because the paths to source files are absolute in the
>> CMake-generated project file. If I use Visual Studio's project wizard
>> to create a new project, the paths are relative, since the vcxproj and
>> the source files are in the same directory. Changing the
>> project-wizard-generated file to use absolute paths results in the
>> same error.
>>
>> Any thoughts? Should I file a bug with Microsoft?
>
> There is a variable that controls the build:
> CMAKE_USE_RELATIVE_PATHS
>
> If you set this to 'TRUE' (its false by default), does that make a difference?
>
>>
>> Thanks,
>> Ben
>> --
>
> --
> Best Regards,
>
> Brett Delle Grazie
--

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] Visual Studio 2012 Beta: unable to compile individual files

2012-06-12 Thread Ben Medina
Thanks for checking. Full project builds work fine for me; it's just
individual file compilations in the IDE that fail.

- Ben

On Tue, Jun 12, 2012 at 8:40 AM, Brad King  wrote:
> On Mon, Jun 11, 2012 at 7:21 PM, Ben Medina  wrote:
>> Has anyone tried the Visual Studio 2012 beta with CMake's "Visual Studio 11" 
>> generator?
>
> I just installed the VS 2012 RC from MSDN:
>
>  Microsoft Visual Studio Professional 2012 RC Version 11.0.50522.1 RCREL
>  Microsoft .NET Framework Version 4.5.50501
>  Microsoft Visual C++ 2012 RC   04167-004-0009005-02506
>
> Using CMake 2.8.8 with the "Visual Studio 11" generator I was able to
> build CMake from today's Git master branch (commit ebc702c8).  It
> built and all tests passed.
>
> -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] Visual Studio 2012 Beta: unable to compile individual files

2012-06-12 Thread Ben Medina
Yes, manually editing the hand-generated (well, project wizard
generated) file to use full paths triggers the problem. I guess I'll
report this to Microsoft, but it would be nice to confirm that others
are having the same problem.

- Ben

On Tue, Jun 12, 2012 at 5:19 AM, Brad King  wrote:
> On 06/11/2012 07:21 PM, Ben Medina wrote:
>> Has anyone tried the Visual Studio 2012 beta with CMake's "Visual
>> Studio 11" generator? I've tried with several projects, and even a
>> simple project that just contains main.cpp has the same problem:
>> compiling a single file does not work. Instead, I get this in the
>> output window:
>>
>> 1>Error: Cannot build selected files.
>>
>> This seems to be because the paths to source files are absolute in the
>> CMake-generated project file. If I use Visual Studio's project wizard
>> to create a new project, the paths are relative, since the vcxproj and
>> the source files are in the same directory. Changing the
>> project-wizard-generated file to use absolute paths results in the
>> same error.
>>
>> Any thoughts? Should I file a bug with Microsoft?
>
> If you manually edit the hand-generated project file saved by the IDE
> to change the sources to full paths, does that by itself cause the
> problem?
>
> Thanks,
> -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] Visual Studio 2012 Beta: unable to compile individual files

2012-06-11 Thread Ben Medina
Has anyone tried the Visual Studio 2012 beta with CMake's "Visual
Studio 11" generator? I've tried with several projects, and even a
simple project that just contains main.cpp has the same problem:
compiling a single file does not work. Instead, I get this in the
output window:

1>Error: Cannot build selected files.

This seems to be because the paths to source files are absolute in the
CMake-generated project file. If I use Visual Studio's project wizard
to create a new project, the paths are relative, since the vcxproj and
the source files are in the same directory. Changing the
project-wizard-generated file to use absolute paths results in the
same error.

Any thoughts? Should I file a bug with Microsoft?

Thanks,
Ben
--

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_SUPPRESS_REGENERATION in VS2010

2012-06-04 Thread Ben Medina
This works for me with CMake 2.8.8 and VS2010. I have this in my CMakeCache.txt:

CMAKE_SUPPRESS_REGENERATION:BOOL=ON

And the ZERO_CHECK target does not appear.

Which version of CMake are you using? I vaguely recall that this
feature was broken a few releases back.

- Ben

On Fri, Jun 1, 2012 at 8:31 AM, LaViolette, Alan
 wrote:
> I am porting our product over to use cmake vs2010 and am experiencing issues
> with the automatic regeneration (2010 does not seem to like its projects
> changing while open), so I would like to just turn it off.
>
>
>
> I have put the CMAKE_SUPPRESS_REGENERATION variable in and still get the
> ZERO_CHECK and the CMakeList.txt dependencies in the project files.  What do
> I need to get this to work.
>
>
>
> I am setting it from the command line so it is defined first thing
>
> "-DCMAKE_SUPPRESS_REGENERATION:BOOL=1"
>
>
>
> Thanks
>
>
>
> --
>
> Alan LaViolette
>
> Software Engineering Consultant
>
> OVERWATCH
>
> An Operating Unit of Textron Systems
>
> 21660 Ridgetop Circle, Suite 110
>
> Sterling, VA 20166
>
> Office: (703) 437-7651 x 2419
>
> Fax: (703) 437-0039
>
> alaviole...@overwatch.textron.com
>
> www.overwatch.com
>
>
>
> "WARNING: Documents that can be viewed, printed or retrieved from this
> E-Mail may contain technical data whose export is restricted by the Arms
> Export Control Act (Title 22, U.S.C., Sec 2751, et seq,) or the Export
> Administration Act of 1979, as amended, Title 50, U.S.C., App. 2401 et seq.
> and which may not be exported, released or disclosed to non-U.S. persons
> (i.e. persons who are not U.S. citizens or lawful permanent residents
> [“green card” holders]) inside or outside the United States, without first
> obtaining an export license.  Violations of these export laws are subject to
> severe civil, criminal and administrative penalties."
>
>
>
>
> --
>
> 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] Copying of 3rd party DLLs in a POST-BUILD step

2012-01-11 Thread Ben Medina
Yes, that's exactly it. I'll try to add something to the wiki.

On Wed, Jan 11, 2012 at 6:01 AM, Eric Noulard  wrote:
> 2012/1/11 Robert Dailey :
>> He probably just uses a project.vcproj.user file, and uses the
>> configure_file() command on it to fill in command arguments, environment
>> variables, etc etc.
>>
>> I've done this before and it works fantastically, although I have never
>> tried it to force the EXE to search for my DLL files without copying them.
>
> All of this may be worth a new Wiki entry, since those questions have 
> popped-up
> several on the list.
>
>
> --
> 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
--

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] Copying of 3rd party DLLs in a POST-BUILD step

2012-01-10 Thread Ben Medina
I'd guess the performance of fixup_bundle will be a big pitfall if
you're planning on doing this after every build.

An entirely different approach is to configure a Visual Studio .user
file to set the PATH environment variable (not setting it globally;
just for debugging your app from within VS). You still have to track
which directories to add to the PATH, but this approach has worked
flawlessly for us (across multiple versions of VS, as well as 32- and
64-bit configs).

On Mon, Jan 9, 2012 at 8:41 AM, David Cole  wrote:
> 2012/1/9 Hauke Heibel :
>> 2012/1/9 Michael Stürmer :
>>> Awesome! Sometimes you just need to know what's already available to solve 
>>> your problems in a very elegant way. I'll have a look at these bundles and 
>>> probably switch to them instead of maintaining my own stuff!
>>
>> When looking at the initial problem, I am pretty much convinced that
>> you need a combination of your own script and GetPrerequisites since
>> you want to copy to your run-time output directory - and there to
>> specific sub-directories depending on the build type.
>>
>> It may well be that I have overseen some functionality in those new modules 
>> ...
>>
>> - Hauke
>
> BundleUtilities, on Windows, should copy dlls to be in the same
> directory as the executable being analyzed... So, as long as the exe
> is in the right directory when fixup_bundle is called on it, then the
> dlls will get copied into that same directory.
>
>
> Cheers,
> 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
--

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] Program with Qt opening with a bash screen on windows before showing the gui...

2011-12-01 Thread Ben Medina
Qt also provides qtmain.lib to resolve the need for WinMain, in case
you run into that linker error.

On Wed, Nov 30, 2011 at 4:26 PM, David Cole  wrote:
> On Wed, Nov 30, 2011 at 6:51 PM, Renato Utsch  wrote:
>> Hello CMake guys...
>>
>> Well, I was writing a portable program using CMake that uses Qt as it's GUI
>> framework...
>>
>> I compiled it on linux and it worked really well, no problems. But when
>> compiling on Windows, the program opened a blank bash screen before opening
>> the proper gui. I thought that this could be with Qt itself, but when I
>> tried with qmake, the program runned normally, without any bash screen
>> opening...
>>
>> I used the Visual C++ Express 2008 to compile, with Qt libraries 4.7.4 for
>> the Visual 2008. Here is the CMakeLists.txt:
>>
>> project(test CXX)
>> cmake_minimum_required(VERSION 2.8)
>> find_package(Qt4 REQUIRED)
>> include(${QT_USE_FILE})
>> set(test_SRCS
>>     main.cpp
>>     MainWindow.cpp
>> )
>> set(test_MOC_SRCS
>>     MainWindow.hpp
>> )
>>
>> set(test_RCCS
>>     rc.qrc
>> )
>> qt4_wrap_cpp(test_MOCS ${test_MOC_SRCS})
>> qt4_add_resources(test_RCC_SRCS ${test_RCCS})
>> add_definitions(-DQT_NO_DEBUG)
>> add_executable(test
>>     ${test_SRCS}
>>     ${test_MOCS}
>>     ${test_RCC_SRCS})
>> target_link_libraries(test ${QT_LIBRARIES})
>>
>> If there is any solution to this I would be very grateful, because I really
>> want to use CMake.
>>
>>
>> Thanks!
>>
>>
>> Renato
>>
>> --
>>
>> 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
>
> Add the WIN32 argument to add_executable to tell it it's a Windows app
> and not a console app.
>
> Like this:
>
> add_executable(test WIN32
>    ${test_SRCS}
>    ${test_MOCS}
>    ${test_RCC_SRCS})
>
>
> 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
--

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] Boost external project doesn't build with VS2010 generator

2011-10-26 Thread Ben Medina
I tend to use the online documentation:
http://www.cmake.org/cmake/help/cmake-2-8-docs.html#module:ExternalProject

But I agree that an example would also be useful. Perhaps the wiki
could have examples of how to use external project with common 3rd
party libs (e.g. boost, Qt).

On Wed, Oct 26, 2011 at 9:00 AM, David Cole  wrote:
> On Wed, Oct 26, 2011 at 11:56 AM, Ben Medina  wrote:
>> David,
>>
>> Yes, adding "call" to the front of the command works. Thanks! Would be
>> great to get that fixed for 2.8.7, as I spent a good portion of
>> yesterday racking my brain about this.
>>
>> I also discovered that, if using a variable to build the
>> CONFIGURE_COMMAND, that variable should be a list, rather than a
>> space-separated string. Would be nice to document that, too.
>
> How / where should that be documented? Where would you have looked for
> that information?
>
> That's how all the *_COMMAND args for ExternalProject are...
>
> I think it would be better expressed through example/sample code that
> uses variables, but I'm not sure where the best place to put the
> documentation is.
>
>
> David
>
>
>>
>> Thanks,
>> Ben
>>
>> On Tue, Oct 25, 2011 at 6:51 PM, David Cole  wrote:
>>> Try changing the configure command to "call bootstrap.bat" instead.
>>> I suspect this is related to the symptoms reported in these bugs:
>>>   http://public.kitware.com/Bug/view.php?id=12445
>>>   http://public.kitware.com/Bug/view.php?id=12461
>>>
>>> Related to using "bat" or "cmd" files as custom commands. We need to get
>>> those fixed for 2.8.7 in the VS 2010 generator.
>>> Let me know if adding "call " to the front of the command works in this
>>> case.
>>>
>>> Thanks,
>>> David
>>>
>>> On Tue, Oct 25, 2011 at 5:30 PM, Ben Medina  wrote:
>>>>
>>>> Hello all,
>>>>
>>>> I'm trying to build Boost as an external project, but it won't build
>>>> if I use the VS2010 generator. I've whittled the code down to the
>>>> following CMakeLists.txt:
>>>>
>>>> cmake_minimum_required(VERSION 2.8)
>>>> project (boost-external)
>>>>
>>>> set (Boost_Source "E:/boost_1_47_0")
>>>>
>>>> include(ExternalProject)
>>>> ExternalProject_Add(
>>>>    Boost
>>>>    SOURCE_DIR "${Boost_Source}"
>>>>    UPDATE_COMMAND ""
>>>>    BUILD_IN_SOURCE 1
>>>>    CONFIGURE_COMMAND bootstrap.bat
>>>>    BUILD_COMMAND b2 install
>>>>    INSTALL_COMMAND ""
>>>>    )
>>>>
>>>> When I build the project, the configure step happens, but the build
>>>> step is skipped:
>>>>
>>>> Microsoft (R) Visual Studio Version 10.0.40219.1.
>>>> Copyright (C) Microsoft Corp. All rights reserved.
>>>> 2>-- Build started: Project: Boost, Configuration: Debug x64 --
>>>> 2>  Performing configure step for 'Boost'
>>>> 2>  Building Boost.Build engine
>>>> 2>
>>>> 2>  Bootstrapping is done. To build, run:
>>>> 2>
>>>> 2>      .\b2
>>>> 2>
>>>> 2>  To adjust configuration, edit 'project-config.jam'.
>>>> 2>  Further information:
>>>> 2>
>>>> 2>      - Command line help:
>>>> 2>      .\b2 --help
>>>> 2>
>>>> 2>      - Getting started guide:
>>>> 2>      http://boost.org/more/getting_started/windows.html
>>>> 2>
>>>> 2>      - Boost.Build documentation:
>>>> 2>      http://www.boost.org/boost-build2/doc/html/index.html
>>>> 3>-- Build started: Project: ALL_BUILD, Configuration: Debug x64
>>>> --
>>>> 3>  Build all projects
>>>> == Build: 3 succeeded, 0 failed, 0 up-to-date, 0 skipped
>>>> ==
>>>>
>>>> When I use the VS2008 generator, the project builds as expected:
>>>>
>>>> Microsoft (R) Visual Studio Version 9.0.30729.1.
>>>> Copyright (C) Microsoft Corp. All rights reserved.
>>>> 1>-- Build started: Project: Boost, Configuration: Debug x64 --
>>>> 1>Creating directories for 'Boost'
>>>> 1>No download step for 'Boost'
>>>> 1>No patch step for 'Boost&#x

Re: [CMake] Boost external project doesn't build with VS2010 generator

2011-10-26 Thread Ben Medina
David,

Yes, adding "call" to the front of the command works. Thanks! Would be
great to get that fixed for 2.8.7, as I spent a good portion of
yesterday racking my brain about this.

I also discovered that, if using a variable to build the
CONFIGURE_COMMAND, that variable should be a list, rather than a
space-separated string. Would be nice to document that, too.

Thanks,
Ben

On Tue, Oct 25, 2011 at 6:51 PM, David Cole  wrote:
> Try changing the configure command to "call bootstrap.bat" instead.
> I suspect this is related to the symptoms reported in these bugs:
>   http://public.kitware.com/Bug/view.php?id=12445
>   http://public.kitware.com/Bug/view.php?id=12461
>
> Related to using "bat" or "cmd" files as custom commands. We need to get
> those fixed for 2.8.7 in the VS 2010 generator.
> Let me know if adding "call " to the front of the command works in this
> case.
>
> Thanks,
> David
>
> On Tue, Oct 25, 2011 at 5:30 PM, Ben Medina  wrote:
>>
>> Hello all,
>>
>> I'm trying to build Boost as an external project, but it won't build
>> if I use the VS2010 generator. I've whittled the code down to the
>> following CMakeLists.txt:
>>
>> cmake_minimum_required(VERSION 2.8)
>> project (boost-external)
>>
>> set (Boost_Source "E:/boost_1_47_0")
>>
>> include(ExternalProject)
>> ExternalProject_Add(
>>    Boost
>>    SOURCE_DIR "${Boost_Source}"
>>    UPDATE_COMMAND ""
>>    BUILD_IN_SOURCE 1
>>    CONFIGURE_COMMAND bootstrap.bat
>>    BUILD_COMMAND b2 install
>>    INSTALL_COMMAND ""
>>    )
>>
>> When I build the project, the configure step happens, but the build
>> step is skipped:
>>
>> Microsoft (R) Visual Studio Version 10.0.40219.1.
>> Copyright (C) Microsoft Corp. All rights reserved.
>> 2>-- Build started: Project: Boost, Configuration: Debug x64 --
>> 2>  Performing configure step for 'Boost'
>> 2>  Building Boost.Build engine
>> 2>
>> 2>  Bootstrapping is done. To build, run:
>> 2>
>> 2>      .\b2
>> 2>
>> 2>  To adjust configuration, edit 'project-config.jam'.
>> 2>  Further information:
>> 2>
>> 2>      - Command line help:
>> 2>      .\b2 --help
>> 2>
>> 2>      - Getting started guide:
>> 2>      http://boost.org/more/getting_started/windows.html
>> 2>
>> 2>      - Boost.Build documentation:
>> 2>      http://www.boost.org/boost-build2/doc/html/index.html
>> 3>-- Build started: Project: ALL_BUILD, Configuration: Debug x64
>> --
>> 3>  Build all projects
>> == Build: 3 succeeded, 0 failed, 0 up-to-date, 0 skipped
>> ==
>>
>> When I use the VS2008 generator, the project builds as expected:
>>
>> Microsoft (R) Visual Studio Version 9.0.30729.1.
>> Copyright (C) Microsoft Corp. All rights reserved.
>> 1>-- Build started: Project: Boost, Configuration: Debug x64 --
>> 1>Creating directories for 'Boost'
>> 1>No download step for 'Boost'
>> 1>No patch step for 'Boost'
>> 1>No update step for 'Boost'
>> 1>Performing configure step for 'Boost'
>> 1>Building Boost.Build engine
>> ...
>> 1>Generating Code...
>> 1>Bootstrapping is done. To build, run:
>> 1>    .\b2
>> 1>
>> 1>To adjust configuration, edit 'project-config.jam'.
>> 1>Further information:
>> 1>    - Command line help:
>> 1>    .\b2 --help
>> 1>
>> 1>    - Getting started guide:
>> 1>    http://boost.org/more/getting_started/windows.html
>> 1>
>> 1>    - Boost.Build documentation:
>> 1>    http://www.boost.org/boost-build2/doc/html/index.html
>> 1>Performing build step for 'Boost'
>> 1>has_icu_test.cpp
>> 1>Performing configuration checks
>> ...
>>
>> And it goes on to build from there.
>>
>>
>> I'm using CMake 2.8.6. Is there some way I can work around this, or
>> should I file a bug?
>>
>> Thanks,
>> Ben
>> --
>>
>> 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] Boost external project doesn't build with VS2010 generator

2011-10-25 Thread Ben Medina
Hello all,

I'm trying to build Boost as an external project, but it won't build
if I use the VS2010 generator. I've whittled the code down to the
following CMakeLists.txt:

cmake_minimum_required(VERSION 2.8)
project (boost-external)

set (Boost_Source "E:/boost_1_47_0")

include(ExternalProject)
ExternalProject_Add(
Boost
SOURCE_DIR "${Boost_Source}"
UPDATE_COMMAND ""
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND bootstrap.bat
BUILD_COMMAND b2 install
INSTALL_COMMAND ""
)

When I build the project, the configure step happens, but the build
step is skipped:

Microsoft (R) Visual Studio Version 10.0.40219.1.
Copyright (C) Microsoft Corp. All rights reserved.
2>-- Build started: Project: Boost, Configuration: Debug x64 --
2>  Performing configure step for 'Boost'
2>  Building Boost.Build engine
2>
2>  Bootstrapping is done. To build, run:
2>
2>  .\b2
2>
2>  To adjust configuration, edit 'project-config.jam'.
2>  Further information:
2>
2>  - Command line help:
2>  .\b2 --help
2>
2>  - Getting started guide:
2>  http://boost.org/more/getting_started/windows.html
2>
2>  - Boost.Build documentation:
2>  http://www.boost.org/boost-build2/doc/html/index.html
3>-- Build started: Project: ALL_BUILD, Configuration: Debug x64 --
3>  Build all projects
== Build: 3 succeeded, 0 failed, 0 up-to-date, 0 skipped ==

When I use the VS2008 generator, the project builds as expected:

Microsoft (R) Visual Studio Version 9.0.30729.1.
Copyright (C) Microsoft Corp. All rights reserved.
1>-- Build started: Project: Boost, Configuration: Debug x64 --
1>Creating directories for 'Boost'
1>No download step for 'Boost'
1>No patch step for 'Boost'
1>No update step for 'Boost'
1>Performing configure step for 'Boost'
1>Building Boost.Build engine
...
1>Generating Code...
1>Bootstrapping is done. To build, run:
1>.\b2
1>
1>To adjust configuration, edit 'project-config.jam'.
1>Further information:
1>- Command line help:
1>.\b2 --help
1>
1>- Getting started guide:
1>http://boost.org/more/getting_started/windows.html
1>
1>- Boost.Build documentation:
1>http://www.boost.org/boost-build2/doc/html/index.html
1>Performing build step for 'Boost'
1>has_icu_test.cpp
1>Performing configuration checks
...

And it goes on to build from there.


I'm using CMake 2.8.6. Is there some way I can work around this, or
should I file a bug?

Thanks,
Ben
--

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] ExternalProject: avoiding rebuilds

2011-10-11 Thread Ben Medina
As an extreme example, consider using boost's header-only libraries.
If I point external project at a boost tarball, every time I rebuild
(or make clean; make), CMake will re-extract the tarball, which is
quite slow for a tarball with so many files.

Why does CMake re-extract tarballs at all? When would this behavior be
desirable?

On Mon, Sep 26, 2011 at 10:37 AM, Ben Medina  wrote:
> John is right. The external project may be at the bottom of a chain of
> (my own) project dependencies. I need to preserve the ability to
> easily rebuild just my projects (and their dependencies), not external
> projects. Think of ExternalProject as a replacement for pre-built
> libraries, and you'll see where I'm coming from.
>
> Perhaps I need to file a feature request on Mantis.
>
> On Sat, Sep 24, 2011 at 2:32 AM, John Drescher  wrote:
>> On Sat, Sep 24, 2011 at 4:11 AM, Rolf Eike Beer  wrote:
>>> Am Freitag, 23. September 2011, 16:26:46 schrieb Ben Medina:
>>>> Hello all,
>>>>
>>>> I'm trying to adopt greater usage of ExternalProject in my project.
>>>> One problem I'd like to resolve is spurious rebuilds of external
>>>> projects.
>>>
>>> [...]
>>>
>>>> This works great: building "test" first untars the CLAPACK source and
>>>> builds it, as expected. However, if I rebuild test (i.e. in Visual
>>>> Studio, right-click on test and rebuild), then the CLAPACK tarball get
>>>> extracted *again*, and a full rebuild of CLAPACK happens. I'd expect
>>>> that, unless the tarball is changed, a rebuild of the external project
>>>> is a no-op.
>>>>
>>>> Is there a way to achieve my desired behavior?
>>>
>>> Yes, use the correct option. Rebuild means "rebuild this target and all of
>>> it's dependencies". There is a different option, something like "rebuild 
>>> only
>>> this target". Just use this one.
>>>
>>
>> That may be difficult in practice. I mean I typically have 20 to 40
>> targets in my projects and sometimes I would want them all rebuilt.
>> However I there is a batch build option in Visual Studio that can be
>> used for that. In this case you check which targets you want built so
>> you can click select all and then uncheck the external project.
>>
>> John
>> --
>>
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at 
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the CMake FAQ at: 
>> http://www.cmake.org/Wiki/CMake_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.cmake.org/mailman/listinfo/cmake
>>
>
--
Powered by www.kitware.com

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

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

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


[CMake] How to change the "Start in" directory for Windows Start menu shortcuts

2011-10-04 Thread Ben Medina
Hello all,

We're using NSIS via CPack for our Windows installer. One thing we'd
like to change is the "Start in" directory for Windows Start menu
shortcuts. Currently, it appears to default to the installation
directory, but that's not very useful: users aren't going to be saving
files underneath C:\Program Files\MyApp. Is it possible to change the
start in directory?

Thanks,
Ben
--
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 2.8.6 available for download

2011-10-04 Thread Ben Medina
Excellent! Preliminary VS11 support makes me very happy.

On Tue, Oct 4, 2011 at 12:30 PM, David Cole  wrote:
> On behalf of myself, Ken, Bill, Brad, Alex, Zach, Ben and the rest of
> the CMake team from all around the world, we are pleased to announce
> that CMake 2.8.6 is now available for download at:
>
>  http://www.cmake.org/files/v2.8/?C=M;O=D
>
> It is also available from the usual download links found on the CMake web 
> site:
>
>  http://www.cmake.org/cmake/resources/software.html
>
> This email is also available on the Kitware blog at
>
>  http://www.kitware.com/blog/home/post/176
>
> This release we do not have pre-built binaries for the SunOS anymore.
> As mentioned on the CMake mailing list recently, our Sun hardware has
> bitten the proverbial dust.
>
> However, we are now providing two sets of installers for the Mac. The
> "Darwin" versions are for Mac OSX 10.4 and later, and are "ppc;i386"
> universal binaries. The "Darwin64" versions are for 10.6 and later,
> and are "x86_64;i386" universal binaries.
>
> This release contains a last-minute addition that you should consider
> "Experimental": a generator in the Windows build targeting Visual
> Studio 11. It will remain "Experimental" until VS11 itself is
> finalized. Please try it out if you have the developer preview of
> Visual Studio 11 installed. Let us know if you run into any VS11
> specific issues. It is very new, and only tested enough to convince us
> it would be useful to include it for all of you to try out. If VS 11
> crashes while you're using it, please send the crash reports in so
> that Microsoft has a chance to fix all those crashing bugs before VS11
> becomes an official release.
>
>
> Thanks for using CMake!
>
> -Dave
>
>
> Changes in CMake 2.8.6 (since 2.8.6-rc4)
> 
> Alex Neundorf (5):
>      Remove trailing whitespace
>      Minor improvements to the UsePkgConfig.cmake docs
>      Remove trailing whitespace
>      Improve behaviour of --find-package mode with try_run/try_compile
>      Use makefile->IssueMessage() for better error messages
>
> Bill Hoffman (2):
>      Use version 11.0 for 12.x and 9.10 for 10.x intel versions to
> fix 12.1 vsIDE.
>      Also, check for 11.x as an intel fortran version.
>
> Brad King (2):
>      Add Visual Studio 11 generator for x86 and x64 tools
>      Teach our tests about special cases for VS 11
>
> David Cole (1):
>      CTestCustom.cmake: Ignore clang's summary warning
>
> Philip Lowman (1):
>      FindBullet: Also search for _Debug postfixed library names
>
> Raphael Kubo da Costa (1):
>      Fix typo in set_target_properties' documentation.
>
> Rolf Eike Beer (1):
>      Fix typo in UsePkgConfig.cmake
>
> Changes in CMake 2.8.6-rc4 (since 2.8.6-rc3)
> 
> Alex Neundorf (3):
>      FindFLEX.cmake: also search the include dir
>      Fix typos in FeatureSummary.cmake (#12462)
>      Don't warn when setting a property multiple times to the same value 
> #12464
>
> Bill Hoffman (2):
>      For VS Intel Fortran IDE builds, add a check to find the Fortran
> library PATH.
>      Enable Fortran tests for IDE builds.
>
> Brad King (5):
>      FortranCInterface: Compile separate Fortran lib in VerifyC[XX]
>      Move IntelVSImplicitPath project to better location
>      Simplify IntelVSImplicitPath detection project
>      libarchive: Fix ssize_t detection with mingwrt 3.20
>      Make file(DOWNLOAD) fail on http error
>
> David Cole (8):
>      Tests: Add a KWStyle test, equivalent to the make StyleCheck target
>      KWStyle Test: Activate by default if KWStyle is found
>      Xcode: Use EFFECTIVE_PLATFORM_NAME reference in ComputeOutputDir
>      Xcode: Add test to demonstrate iOS project in Xcode
>      CMake: Reference test targets only when BUILD_TESTING is ON
>      Tests: Add the more modern Mac64 nightly build
>      Release Scripts: Use Qt 4.7.4 on dashmacmini5 (#12460)
>      Revert "FindThreads: Try pthreads with no special option first (#11333)"
>
> Eric NOULARD (4):
>      CPack fix #12449 doc mispelled
>      CPack fix template too
>      CPackDeb fix #10325 automagically use fakeroot for DEB if
> fakeroot is found
>      CPackRPM authorize per-component pre/post-[un]install scripts (#0012063)
>
> Marcus D. Hanwell (4):
>      Just code style changes.
>      Don't warn when nothing to do in visibility function.
>      Made ADD_COMPILER_EXPORT_FLAGS into a macro.
>      Make add_compiler_export_flags a function again.
>
> Rolf Eike Beer (1):
>      remove stray brace in CPackDeb documentation
>
> Changes in CMake 2.8.6-rc3 (since 2.8.6-rc2)
> 
> Alexey Ozeritsky (2):
>      FindBLAS/LAPACK fixes
>      FindBLAS/LAPACK fixes
>
> Andreas Schneider (1):
>      Modules: Add support for more java archives in add_jar().
>
> Björn Ricks (4):
>      Search for the installed python interpreter first
>      Determine python version
>      Update documentation of

Re: [CMake] ExternalProject: avoiding rebuilds

2011-09-26 Thread Ben Medina
It's the same as "make clean; make", so it's not just a Visual Studio thing.

On Mon, Sep 26, 2011 at 10:45 AM, Rolf Eike Beer  wrote:
> Am Montag, 26. September 2011, 10:37:57 schrieb Ben Medina:
>> John is right. The external project may be at the bottom of a chain of
>> (my own) project dependencies. I need to preserve the ability to
>> easily rebuild just my projects (and their dependencies), not external
>> projects. Think of ExternalProject as a replacement for pre-built
>> libraries, and you'll see where I'm coming from.
>>
>> Perhaps I need to file a feature request on Mantis.
>
> You may try, but I don't think that this will help. AFAICT this "clean and
> then rebuild" stuff is a Visual Studio thing.
>
> 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] ExternalProject: avoiding rebuilds

2011-09-26 Thread Ben Medina
John is right. The external project may be at the bottom of a chain of
(my own) project dependencies. I need to preserve the ability to
easily rebuild just my projects (and their dependencies), not external
projects. Think of ExternalProject as a replacement for pre-built
libraries, and you'll see where I'm coming from.

Perhaps I need to file a feature request on Mantis.

On Sat, Sep 24, 2011 at 2:32 AM, John Drescher  wrote:
> On Sat, Sep 24, 2011 at 4:11 AM, Rolf Eike Beer  wrote:
>> Am Freitag, 23. September 2011, 16:26:46 schrieb Ben Medina:
>>> Hello all,
>>>
>>> I'm trying to adopt greater usage of ExternalProject in my project.
>>> One problem I'd like to resolve is spurious rebuilds of external
>>> projects.
>>
>> [...]
>>
>>> This works great: building "test" first untars the CLAPACK source and
>>> builds it, as expected. However, if I rebuild test (i.e. in Visual
>>> Studio, right-click on test and rebuild), then the CLAPACK tarball get
>>> extracted *again*, and a full rebuild of CLAPACK happens. I'd expect
>>> that, unless the tarball is changed, a rebuild of the external project
>>> is a no-op.
>>>
>>> Is there a way to achieve my desired behavior?
>>
>> Yes, use the correct option. Rebuild means "rebuild this target and all of
>> it's dependencies". There is a different option, something like "rebuild only
>> this target". Just use this one.
>>
>
> That may be difficult in practice. I mean I typically have 20 to 40
> targets in my projects and sometimes I would want them all rebuilt.
> However I there is a batch build option in Visual Studio that can be
> used for that. In this case you check which targets you want built so
> you can click select all and then uncheck the external project.
>
> John
> --
>
> 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] ExternalProject: avoiding rebuilds

2011-09-23 Thread Ben Medina
Hello all,

I'm trying to adopt greater usage of ExternalProject in my project.
One problem I'd like to resolve is spurious rebuilds of external
projects.

For example, I'd like to build CLAPACK as an external project, so I do
something like this:

ExternalProject_Add (clapack
URL ${tarball_location}
URL_MD5 4fd18eb33f3ff8c5d65a7d43913d661b
UPDATE_COMMAND ""
CMAKE_CACHE_ARGS "${clapack_cmake_args}"
INSTALL_COMMAND ""
)

add_executable (test main.cpp)

add_dependencies(test clapack)

This works great: building "test" first untars the CLAPACK source and
builds it, as expected. However, if I rebuild test (i.e. in Visual
Studio, right-click on test and rebuild), then the CLAPACK tarball get
extracted *again*, and a full rebuild of CLAPACK happens. I'd expect
that, unless the tarball is changed, a rebuild of the external project
is a no-op.

Is there a way to achieve my desired behavior?

I have another external project where the source is checked into my
source tree. A rebuild on that external project is a no-op unless the
source files have changed. However, I'd rather avoid checking in
3rdparty source code into my source tree.

Thanks,
Ben
--

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] Running unit test as part of the build

2011-09-12 Thread Ben Medina
On Sat, Sep 10, 2011 at 9:10 AM, Erik Johansson  wrote:

> How does one get cmake to run the unit test as part of the build so that:
> - If the unit test fails, the build fails.
> - If the unit test has failed, and make is run again, the unit test
> will run again.
> - If the unit test has succeeded, and make is run again, the unit test
> will not run again.
>
> I know how to get two out of three, but not all three at once.

Good question! We currently do the first and third items in your list.
How are you going about the second?
___
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] Link flags not applied to static library

2011-06-22 Thread Ben Medina
So that the answer stays on the list:

One must use the STATIC_LIBRARY_FLAGS property, rather than
LINK_FLAGS, for static libraries.

On Tue, Jun 21, 2011 at 3:12 PM, Ben Medina  wrote:
> Since I got no feedback, I assume it's a bug. I've filed it here:
>
> 0012295: LINK_FLAGS_RELEASE has no effect on static libraries for MSVC
> generators
>
> http://www.cmake.org/Bug/view.php?id=12295
>
> On Mon, Jun 13, 2011 at 11:50 AM, Ben Medina  wrote:
>> Hello all,
>>
>> I'm using CMake 2.8.4 and am seeing an odd differenc between static
>> and shared libraries in regard to the LINK_FLAGS property. In
>> particular, I'm enabling "Whole program optimization" in Visual Studio
>> 2010, which is done by add /GL as a compiler flag and /LTCG as a
>> linker flag for the release configuration. However, the link flag is
>> not used for static libraries, leading to a build warning about
>> compiling with /GL but linking without /LTCG.
>>
>> Here's an example:
>>
>> cmake_minimum_required (VERSION 2.8)
>> project (link_test)
>>
>> set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /GL")
>>
>> add_library (static_test STATIC a.cpp)
>> set_target_properties (
>>    static_test
>>    PROPERTIES
>>    LINK_FLAGS_RELEASE "/LTCG"
>>    )
>>
>> add_library (shared_test SHARED a.cpp)
>> set_target_properties (
>>    shared_test
>>    PROPERTIES
>>    LINK_FLAGS_RELEASE "/LTCG"
>>    )
>>
>> Just add an empty file called a.cpp to the directory, then build the
>> whole project in release configuration. You'll get a warning like this
>> for the static_test library:
>>
>> 2>  a.obj : MSIL .netmodule or module compiled with /GL found;
>> restarting link with /LTCG; add /LTCG to the link command line to
>> improve
>>
>> Why is CMake not applying LINK_FLAGS_RELEASE to the static library?
>>
>> Thanks,
>> Ben
>>
>
___
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] Link flags not applied to static library

2011-06-21 Thread Ben Medina
Since I got no feedback, I assume it's a bug. I've filed it here:

0012295: LINK_FLAGS_RELEASE has no effect on static libraries for MSVC
generators

http://www.cmake.org/Bug/view.php?id=12295

On Mon, Jun 13, 2011 at 11:50 AM, Ben Medina  wrote:
> Hello all,
>
> I'm using CMake 2.8.4 and am seeing an odd differenc between static
> and shared libraries in regard to the LINK_FLAGS property. In
> particular, I'm enabling "Whole program optimization" in Visual Studio
> 2010, which is done by add /GL as a compiler flag and /LTCG as a
> linker flag for the release configuration. However, the link flag is
> not used for static libraries, leading to a build warning about
> compiling with /GL but linking without /LTCG.
>
> Here's an example:
>
> cmake_minimum_required (VERSION 2.8)
> project (link_test)
>
> set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /GL")
>
> add_library (static_test STATIC a.cpp)
> set_target_properties (
>    static_test
>    PROPERTIES
>    LINK_FLAGS_RELEASE "/LTCG"
>    )
>
> add_library (shared_test SHARED a.cpp)
> set_target_properties (
>    shared_test
>    PROPERTIES
>    LINK_FLAGS_RELEASE "/LTCG"
>    )
>
> Just add an empty file called a.cpp to the directory, then build the
> whole project in release configuration. You'll get a warning like this
> for the static_test library:
>
> 2>  a.obj : MSIL .netmodule or module compiled with /GL found;
> restarting link with /LTCG; add /LTCG to the link command line to
> improve
>
> Why is CMake not applying LINK_FLAGS_RELEASE to the static library?
>
> Thanks,
> Ben
>
___
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] Link flags not applied to static library

2011-06-13 Thread Ben Medina
Hello all,

I'm using CMake 2.8.4 and am seeing an odd differenc between static
and shared libraries in regard to the LINK_FLAGS property. In
particular, I'm enabling "Whole program optimization" in Visual Studio
2010, which is done by add /GL as a compiler flag and /LTCG as a
linker flag for the release configuration. However, the link flag is
not used for static libraries, leading to a build warning about
compiling with /GL but linking without /LTCG.

Here's an example:

cmake_minimum_required (VERSION 2.8)
project (link_test)

set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /GL")

add_library (static_test STATIC a.cpp)
set_target_properties (
static_test
PROPERTIES
LINK_FLAGS_RELEASE "/LTCG"
)

add_library (shared_test SHARED a.cpp)
set_target_properties (
shared_test
PROPERTIES
LINK_FLAGS_RELEASE "/LTCG"
)

Just add an empty file called a.cpp to the directory, then build the
whole project in release configuration. You'll get a warning like this
for the static_test library:

2>  a.obj : MSIL .netmodule or module compiled with /GL found;
restarting link with /LTCG; add /LTCG to the link command line to
improve

Why is CMake not applying LINK_FLAGS_RELEASE to the static library?

Thanks,
Ben
___
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] VS Project environment settings

2011-01-14 Thread Ben Medina
These settings are stored in a separate "user" file, rather than in
the main vc[x]proj file. So one solution is to have CMake create the
user file for you with whatever settings you want. We are doing this
via configure_file, using a generic user file as a template.

- Ben

On Tue, Jan 11, 2011 at 9:40 AM, Marco Nolden
 wrote:
> Hi,
>
> with the new external project support in CMake it is very easy to build
> complex projects in one run, but it is still complicated to resolve the
> different library paths on windows. There is a bug in the Cmake bugtracker
> describing the problem very well, and as somebody pointed out it also
> affects IDEs on other platforms:
>
>  http://www.cmake.org/Bug/view.php?id=8884
>
> Is this still on the todo list? Does anyone know another solution to start
> debug and release versions from Visual Studio when multiple external
> projects are used?
>
> Best,
>
> Marco
>
> ___
> 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] Regex help: multi-line matching and matching backslashes

2011-01-11 Thread Ben Medina
Thanks for the help, David and and Fraser! I have it working.

On Tue, Jan 11, 2011 at 4:33 AM, David Cole  wrote:
> Thanks, Fraser. Of course...
>
> If you need to escape a backslash such that the regular expression itself
> contains a backslash at a certain point, then you need to double it up. For
> example to match the backslash character itself, you need to use "[\\]", but
> to encode other escape chars directly that CMake knows about, you only need
> one. (Just as you only need one to put the real "\n" character into the
> string in the first place.
>
> This code shows that "Matches2" contains your expected results:
>
>
> cmake_minimum_required(VERSION 2.8)
>
> set(contents "Hello\nWorld!")
> message("contents='${contents}'")
>
> string(REGEX MATCHALL "Hello[\\r\\n\\t ]*World!" matches ${contents})
> message("Matches1:")
> foreach(match ${matches})
>   message("match='${match}'")
> endforeach()
>
> string(REGEX MATCHALL "Hello[\r\n\t ]*World!" matches ${contents})
> message("Matches2:")
> foreach(match ${matches})
>   message("match='${match}'")
> endforeach()
>
>
>
> On Mon, Jan 10, 2011 at 5:38 PM, Fraser Hutchison
>  wrote:
>>
>> I think if you remove the double "\\" it should work, i.e. use:
>>
>> string (REGEX MATCHALL "TEST_?F?\\([A-Za-z_0-9]+,[\r\n\t]*[A-Za-z_0-9
>> ]+\\)" found_tests ${contents})
>>
>> Cheers,
>>
>> Fraser.
>>
>>
>>
>>
>> On 1/10/2011 5:04 PM, Ben Medina wrote:
>>
>> It doesn't seem to work:
>>
>> cmake_minimum_required (VERSION 2.8)
>>
>> set (contents "Hello\nWorld!")
>> message ("${contents}")
>> string (REGEX MATCHALL "Hello[\\r\\n\\t ]*World!" matches ${contents})
>>
>> message ("Matches:")
>> foreach (match ${matches})
>> message ("${match}")
>> endforeach ()
>>
>> This produces no matches. If you replace "\n" with " " in the contents
>> string, then you get a match.
>>
>> Thanks,
>> Ben
>>
>> On Fri, Jan 7, 2011 at 12:18 PM, David Cole 
>> wrote:
>>
>> It should work.
>>
>> But I'm pretty sure we don't recognize "\s" for white space. Try "[
>> \\t\\n\\r]" instead of \\s.
>>
>> But. watch out for white space after "(" and before ")" too. You might
>> miss some lines if they have spaces there.
>>
>>
>> On Fri, Jan 7, 2011 at 2:55 PM, Ben Medina  wrote:
>>
>> I need to parse a C++ file for Google Test macros. (I'm aware the
>> GTEST_ADD_TESTS provided by FindGtest.cmake, but I need the test list
>> for my own purposes). I had been using a regex similar to the one in
>> GTEST_ADD_TESTS to match tests:
>>
>> string (REGEX MATCHALL "TEST_?F?\\([A-Za-z_0-9 ,]+)\\)" found_tests
>> ${contents})
>>
>> But this doesn't work when the test is split onto two lines, like this:
>>
>> TEST(SampleTest,\
>>     MultilineTest)
>>
>> So, I've been trying to build a regex that will match tests split onto
>> multiple lines. This should work:
>>
>> string (REGEX MATCHALL "TEST_?F?\\([A-Za-z_0-9
>> ]+,[\\s]*[A-Za-z_0-9 ]+\\)" found_tests ${contents})
>>
>> After the comma, the regex should greedily match all whitespace
>> (including newlines) via the "\\s" and backslashes via the ""
>> (Note that all special characters are escaped). This works in other
>> regex engines, but fails in CMake.
>>
>> Is this possible in CMake, or do I need to use another tool?
>>
>> Here is my test file (named tests.cpp):
>>
>> TEST(SampleTest, SingleLineTest)
>> TEST(SampleTest,\
>>     MultilineTest)
>> TEST_F(SampleTest, SingleLineFixtureTest)
>> TEST_F(SampleTest,\
>>     MultilineFixtureTest)
>>
>> And my CMakeLists.txt:
>>
>> cmake_minimum_required (VERSION 2.8)
>>
>> file (READ "tests.cpp" contents)
>> string (REGEX MATCHALL "TEST_?F?\\([A-Za-z_0-9
>> ]+,[\\s]*[A-Za-z_0-9 ]+\\)" found_tests ${contents})
>> message ("Found tests:")
>> foreach (test ${found_tests})
>>    message ("${test}")
>> endforeach ()
>>
>> Thanks,
>> Ben
>> ___
>> 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
>
>
___
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] Regex help: multi-line matching and matching backslashes

2011-01-10 Thread Ben Medina
It doesn't seem to work:

cmake_minimum_required (VERSION 2.8)

set (contents "Hello\nWorld!")
message ("${contents}")
string (REGEX MATCHALL "Hello[\\r\\n\\t ]*World!" matches ${contents})

message ("Matches:")
foreach (match ${matches})
message ("${match}")
endforeach ()

This produces no matches. If you replace "\n" with " " in the contents
string, then you get a match.

Thanks,
Ben

On Fri, Jan 7, 2011 at 12:18 PM, David Cole  wrote:
> It should work.
>
> But I'm pretty sure we don't recognize "\s" for white space. Try "[
> \\t\\n\\r]" instead of \\s.
>
> But. watch out for white space after "(" and before ")" too. You might
> miss some lines if they have spaces there.
>
>
> On Fri, Jan 7, 2011 at 2:55 PM, Ben Medina  wrote:
>>
>> I need to parse a C++ file for Google Test macros. (I'm aware the
>> GTEST_ADD_TESTS provided by FindGtest.cmake, but I need the test list
>> for my own purposes). I had been using a regex similar to the one in
>> GTEST_ADD_TESTS to match tests:
>>
>> string (REGEX MATCHALL "TEST_?F?\\([A-Za-z_0-9 ,]+)\\)" found_tests
>> ${contents})
>>
>> But this doesn't work when the test is split onto two lines, like this:
>>
>> TEST(SampleTest,\
>>     MultilineTest)
>>
>> So, I've been trying to build a regex that will match tests split onto
>> multiple lines. This should work:
>>
>> string (REGEX MATCHALL "TEST_?F?\\([A-Za-z_0-9
>> ]+,[\\s]*[A-Za-z_0-9 ]+\\)" found_tests ${contents})
>>
>> After the comma, the regex should greedily match all whitespace
>> (including newlines) via the "\\s" and backslashes via the ""
>> (Note that all special characters are escaped). This works in other
>> regex engines, but fails in CMake.
>>
>> Is this possible in CMake, or do I need to use another tool?
>>
>> Here is my test file (named tests.cpp):
>>
>> TEST(SampleTest, SingleLineTest)
>> TEST(SampleTest,\
>>     MultilineTest)
>> TEST_F(SampleTest, SingleLineFixtureTest)
>> TEST_F(SampleTest,\
>>     MultilineFixtureTest)
>>
>> And my CMakeLists.txt:
>>
>> cmake_minimum_required (VERSION 2.8)
>>
>> file (READ "tests.cpp" contents)
>> string (REGEX MATCHALL "TEST_?F?\\([A-Za-z_0-9
>> ]+,[\\s]*[A-Za-z_0-9 ]+\\)" found_tests ${contents})
>> message ("Found tests:")
>> foreach (test ${found_tests})
>>    message ("${test}")
>> endforeach ()
>>
>> Thanks,
>> Ben
>> ___
>> 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] Regex help: multi-line matching and matching backslashes

2011-01-07 Thread Ben Medina
I need to parse a C++ file for Google Test macros. (I'm aware the
GTEST_ADD_TESTS provided by FindGtest.cmake, but I need the test list
for my own purposes). I had been using a regex similar to the one in
GTEST_ADD_TESTS to match tests:

string (REGEX MATCHALL "TEST_?F?\\([A-Za-z_0-9 ,]+)\\)" found_tests ${contents})

But this doesn't work when the test is split onto two lines, like this:

TEST(SampleTest,\
 MultilineTest)

So, I've been trying to build a regex that will match tests split onto
multiple lines. This should work:

string (REGEX MATCHALL "TEST_?F?\\([A-Za-z_0-9
]+,[\\s]*[A-Za-z_0-9 ]+\\)" found_tests ${contents})

After the comma, the regex should greedily match all whitespace
(including newlines) via the "\\s" and backslashes via the ""
(Note that all special characters are escaped). This works in other
regex engines, but fails in CMake.

Is this possible in CMake, or do I need to use another tool?

Here is my test file (named tests.cpp):

TEST(SampleTest, SingleLineTest)
TEST(SampleTest,\
 MultilineTest)
TEST_F(SampleTest, SingleLineFixtureTest)
TEST_F(SampleTest,\
 MultilineFixtureTest)

And my CMakeLists.txt:

cmake_minimum_required (VERSION 2.8)

file (READ "tests.cpp" contents)
string (REGEX MATCHALL "TEST_?F?\\([A-Za-z_0-9
]+,[\\s]*[A-Za-z_0-9 ]+\\)" found_tests ${contents})
message ("Found tests:")
foreach (test ${found_tests})
message ("${test}")
endforeach ()

Thanks,
Ben
___
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] fixup_bundle: installing multiple executables that depend on the same libraries

2010-12-31 Thread Ben Medina
That sounds fine for now, thanks.

But what would you do if you had multiple gui apps?

On Fri, Dec 31, 2010 at 11:21 AM, David Cole  wrote:
> Another alternative is to put your command line executables into the
> bundle on the Mac, and then they'll be fixed up, too. One caveat is
> that the directory nesting level of the executables should all be the
> same within the bundle so that "@exectuable_path/.." style references
> work from each fixed up executable.
>
> Then you can put just symlinks to those exes anywhere you like that's
> convenient.
>
> It's all sort of roll-your-own, though. There's no other existing
> support to my knowledge...
>
>
>
> On Fri, Dec 31, 2010 at 2:03 PM, Ben Medina  wrote:
>> Hello all,
>>
>> My project is sprouting new executables, and the simple use case of
>> using fixup_bundle is no longer sufficient. At the moment, I have:
>> 1. A Qt-based gui application.
>> 2. A command line application.
>>
>> Both of these apps share common 3rdparty library dependencies (boost,
>> Qt, etc.). And I anticipate several more apps in the near future, both
>> gui and command line.
>>
>> Simply running fixup_bundle on each app works fine on Windows and
>> Linux; the executables both end up in the bin directory, and all their
>> dependent libs get copied there as well. However, on the Mac, things
>> are more complicated. My GUI app is built as a bundle, so fixup_bundle
>> copies all dependent libs into the bundle. But the command line app is
>> dependent on some of those same libs, and I don't want duplicate
>> copies of them in my installation.
>>
>> So I'm wondering what the best path forward is. Ultimately, I think I
>> should be doing something like this:
>> 1. Install all the common 3rdparty library dependencies somewhere out
>> in /Library/Application Support.
>> 2. Install small wrapper scripts for both apps that set
>> DYLD_LIBRARY_PATH to point to where the 3rdparty libs are installed,
>> then launch the app.
>>
>> Does this sound reasonable? Is it possible with CMake/CPack? If so,
>> are there any examples of how to do this?
>>
>> Thanks,
>> Ben
>> ___
>> 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] fixup_bundle: installing multiple executables that depend on the same libraries

2010-12-31 Thread Ben Medina
Hello all,

My project is sprouting new executables, and the simple use case of
using fixup_bundle is no longer sufficient. At the moment, I have:
1. A Qt-based gui application.
2. A command line application.

Both of these apps share common 3rdparty library dependencies (boost,
Qt, etc.). And I anticipate several more apps in the near future, both
gui and command line.

Simply running fixup_bundle on each app works fine on Windows and
Linux; the executables both end up in the bin directory, and all their
dependent libs get copied there as well. However, on the Mac, things
are more complicated. My GUI app is built as a bundle, so fixup_bundle
copies all dependent libs into the bundle. But the command line app is
dependent on some of those same libs, and I don't want duplicate
copies of them in my installation.

So I'm wondering what the best path forward is. Ultimately, I think I
should be doing something like this:
1. Install all the common 3rdparty library dependencies somewhere out
in /Library/Application Support.
2. Install small wrapper scripts for both apps that set
DYLD_LIBRARY_PATH to point to where the 3rdparty libs are installed,
then launch the app.

Does this sound reasonable? Is it possible with CMake/CPack? If so,
are there any examples of how to do this?

Thanks,
Ben
___
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] copy_resolved_item_into_bundle doesn't copy when I want it to

2010-12-21 Thread Ben Medina
That sounds fine. However, I have install rules located in multiple
files; my project contains multiple apps, and each apps has its
install rules in its own lists file. Where do I put my "delete bundle"
install code to ensure that it runs before all other install commands?

Thanks,
Ben

On Tue, Dec 21, 2010 at 4:04 AM, David Cole  wrote:
> copy_resolved_item_into_bundle only skips the copy if the file to be copied
> and the destination file refer to exactly the same file. In that sense, it
> already is a copy_if_different.
>
> On the Mac, after a bundle is created and fixed up for the first time, all
> the references from one library to another are "internal to the bundle" via
> @executable_path references. Once that is done, the entities which had
> originally referred to external libraries (typically by their full path
> names in the build tree) no longer refer to those external libraries, but to
> the copies inside the bundle.
>
> Now, the second time fixup_bundle runs, there is nothing that refers to that
> library in the build tree *unless* one of your install rules places
> something new inside the bundle that has an external reference again. If you
> have simply rebuilt a library that got pulled in via the first call to
> fixup_bundle, there is nothing that will pull in the new copy again. (That's
> sort of the point of fixup_bundle is to break those "external" references.)
>
> So... this is basically a long-winded, explanatory way of saying "don't do
> that." :-)
>
> For your workflow to be bullet-proof, you should delete the bundle at step
> 2.5 -- after changing one of the pulled in libraries, but before running
> "make install" again. Perhaps it would even be best to put in a "delete
> bundle" step as the very first part of "make install", just as a call to
> "fixup_bundle" is typically your very last step of make install.
>
> I realize this is non-ideal, but I think it's reasonable given the benefit
> that fixup_bundle provides. As always, I'm open to discussion and
> suggestions if anybody has ideas for improving BundleUtilities.
>
>
> HTH,
> David
>
>
> On Mon, Dec 20, 2010 at 6:44 PM, Ben Medina  wrote:
>>
>> Hello all,
>>
>> I'm using fixup_bundle as part of my installation rules. One problem
>> I've run into is that if you build the install target multiple times,
>> fixup_bundle (or, more specifically, copy_resolved_item_into_bundle)
>> won't copy a library over if it's coming from the same location. This
>> causes a failure for the following workflow:
>>
>> 1. Build the install target.
>> 2. Make a change to one of the libraries that fixup_bundle resolved for
>> you.
>> 3. Build the install target again.
>>
>> The second time you build the install, the updated library does not
>> get copied, and any application that depends on the change in that
>> library will be broken.
>>
>> Is there is reason copy_resolved_item_into_bundle doesn't just use
>> copy_if_different?
>>
>> Thanks,
>> Ben
>> ___
>> 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] copy_resolved_item_into_bundle doesn't copy when I want it to

2010-12-20 Thread Ben Medina
Hello all,

I'm using fixup_bundle as part of my installation rules. One problem
I've run into is that if you build the install target multiple times,
fixup_bundle (or, more specifically, copy_resolved_item_into_bundle)
won't copy a library over if it's coming from the same location. This
causes a failure for the following workflow:

1. Build the install target.
2. Make a change to one of the libraries that fixup_bundle resolved for you.
3. Build the install target again.

The second time you build the install, the updated library does not
get copied, and any application that depends on the change in that
library will be broken.

Is there is reason copy_resolved_item_into_bundle doesn't just use
copy_if_different?

Thanks,
Ben
___
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] Makefile to CMakeLists.txt (GTEST)

2010-12-01 Thread Ben Medina
Note that recent versions of gtest come with a CMakeLists.txt, so you
can just use add_subdirectory on the gtest source tree.

- Ben

On Wed, Dec 1, 2010 at 7:59 AM, Kevyn-Alexandre Paré
 wrote:
> Philip,
>
> Thx for the reply. Neither of these solutions change a thing.
>
> I try to play with ADD_CUSTOM_TARGET but same error...
>
> ADD_CUSTOM_TARGET(RRThread.o ALL COMMAND ${CMAKE_C_COMPILER} -I
> ${MICRONTRACKER_COMMON_PATH} -I${GTEST_HEADER_PATH} -lpthread -c
> ${MICRONTRACKER_COMMON_PATH}RRThread.c
> ${UNIT_TEST_PATH}common/UT_RRThread.cc)
>
> ADD_CUSTOM_TARGET(UT_RRThread ALL COMMAND ${CMAKE_CXX_COMPILER} -I
> ${MICRONTRACKER_COMMON_PATH} -I${GTEST_HEADER_PATH} -lpthread RRThread.o
> UT_RRThread.o ${GTEST_LIB_PATH}gtest.a ${GTEST_LIB_PATH}gtest_main.a -o
> UT_RRThread)
>
> Result:
> UT_RRThread.o: In function `thread_proc(void*)':
> UT_RRThread.cc:(.text+0x28): undefined reference to `exitThread()'
> ...
>
> I pretty sure that I'm missing little detail. How can I implicitly add
> dependency to the object during the linking?
>
> Regards
>
> --
> Kevyn-Alexandre Paré
>
>
> On Mon, 2010-11-29 at 18:17 -0500, Philip Lowman wrote:
>> Try adding the "gtest.a" library as well.  Also, order does matter
>> when you are linking static libraries so you might need to play with
>> the ordering.
>>
>>
>> Also, when you get some time, have a look at FindGTest.cmake.  It may
>> help you simplify adding your tests.
>>
>> On Mon, Nov 29, 2010 at 5:55 PM, Kevyn-Alexandre Paré
>>  wrote:
>>         Hi,
>>
>>         /// -> What I trying to do is to compile my unit test with
>>         google test
>>         with cmake from a working Makefile.
>>
>>         /// -> Here the Makefile
>>
>>         RRThread.o : $(USER_DIR)/RRThread.c $(USER_DIR)/RRThread.h
>>         $(GTEST_HEADERS)
>>            $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(USER_DIR)/RRThread.c
>>
>>         UT_RRThread.o : $(UNITTEST_DIR)/UT_RRThread.cc \
>>                             $(USER_DIR)/RRThread.h $(GTEST_HEADERS)#
>>            $(CXX) $(CPPFLAGS) $(CXXFLAGS) -I$(USER_DIR) -c
>>         $(UNITTEST_DIR)/UT_RRThread.cc
>>
>>         UT_RRThread : RRThread.o UT_RRThread.o gtest_main.a
>>            $(CXX) $(CPPFLAGS) $(CXXFLAGS) -lpthread $^ -o $@
>>
>>
>>         /// -> Here how I thought of doing it with CMakeLists.txt:::
>>
>>         INCLUDE_DIRECTORIES(${GTEST_HEADER} ${USER_DIR})
>>
>>         ADD_EXECUTABLE(UT ${USER_DIR}RRThread.c
>>         ${UNIT_TEST_PATH}UT_RRThread.cc)
>>
>>         TARGET_LINK_LIBRARIES(UT pthread
>>         ${GTEST_LIB_PATH}gtest_main.a)
>>
>>         /// -> My result:
>>
>>         Linking CXX executable UT
>>         /usr/bin/cmake -E cmake_link_script CMakeFiles/UT.dir/link.txt
>>         --verbose=1
>>         /usr/bin/c++      CMakeFiles/UT.dir/common/RRThread.c.o
>>         CMakeFiles/UT.dir/UnitTests/common/UT_RRThread.cc.o  -o UT
>>         -rdynamic
>>         -lpthread 
>> /home/andromeda/rogue-research/3rdParty/gtest/trunk/Release/lib/gtest_main.a
>>         CMakeFiles/UT.dir/UnitTests/common/UT_RRThread.cc.o: In
>>         function
>>         `thread_proc(void*)':
>>         UT_RRThread.cc:(.text+0x28): undefined reference to
>>         `exitThread()'
>>
>>
>>         /// -> My question and my problem is:
>>         Since I'm including the USER_DIR with INCLUDE_DIRECTORIES why
>>         is it
>>         complaining about not finding reference that is in that header
>>         file?
>>
>>
>>         Best Regards,
>>
>>         --
>>         Kevyn-Alexandre Paré
>>
>>         ___
>>         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
>>
>>
>>
>> --
>> Philip Lowman
>>
>
>
> ___
> 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] Problem with custom target dependencies on VS2010

2010-10-26 Thread Ben Medina
Hi all,

In our builds, we use custom targets to copy library headers to an
include directory from which clients of the library then #include
from. This works for VS2008 but is broken in VS2010 (using CMake 2.8.3
rc3).

Here is a small example:

---
CMakeLists.txt:
---

cmake_minimum_required(VERSION 2.8)
project(header-copy-test)

set (header_destination_dir ${CMAKE_BINARY_DIR}/include)
include_directories (${header_destination_dir})

set (headers_to_copy
${CMAKE_SOURCE_DIR}/headers/header.h
)

# Create a target responsible for:
# - creating the include directory
# - copying the header into that directory
add_custom_target (
${PROJECT_NAME}_headers ALL
DEPENDS ${header_destination_dir} ${headers_to_copy}
SOURCES ${headers_to_copy}
)
add_custom_command(
OUTPUT ${header_destination_dir}
COMMAND ${CMAKE_COMMAND} -E make_directory ${header_destination_dir}
VERBATIM
)
foreach (h ${headers_to_copy})
add_custom_command (
TARGET ${PROJECT_NAME}_headers
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${h}"
"${header_destination_dir}/"
VERBATIM
)
endforeach ()

# Now add an executable, and make it depend on the custom target above.
add_executable(
${PROJECT_NAME}
main.cpp
)
add_dependencies (${PROJECT_NAME} ${PROJECT_NAME}_headers)

---
main.cpp
---
#include "header.h"
int main() {}

---
headers/header.h
---
#error

Here are the steps to reproduce:
1. Use the VS2010 generator to generate the project, and open it in VS2010.
2. Right-click on the header-copy-test project in Solution Explorer,
and build. You should get a failure due to the #error in header.h.
3. Edit the original header.h (NOT the copied header) to remove the
#error, then repeat step 2. The corrected header should have been
copied, but it wasn't, leading to the same build error.

As I mentioned, this works as expected in VS2008. Am I doing something
wrong, or is this a bug in CMake or a limitation in VS2010 support?

Another issue is that I specified the headers as SOURCES in the custom
target, but they don't show up in the IDE.

Thanks,
Ben
___
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] Eliminate Debug/Release directories and name executables based on configuration

2010-08-10 Thread Ben Medina
CMake has explicit support for this, rather than using a prefix (which
doesn't work in VS2010):

http://www.cmake.org/Bug/view.php?id=9163

- Ben

On Mon, Aug 9, 2010 at 12:50 PM, Keith Gardner
 wrote:
> What you need to do to get rid of the Debug/Release directories is set the
> prefix property for your target with “../”.
>
>
>
> Eg.  set_target_properties( target_name PROPERTIES PREFIX “../” )
>
>
>
> To get a postfix for different configuration types you need to set the
> postfix property for the build type.
>
>
>
> Eg.  set_target_properties( target_name PROPERTIES DEBUG_POSTFIX
> “_d” )
>
> set_target_properties( target_name PROPERTIES RELWITHDEBINFO_POSTFIX “_rd” )
>
>
>
> From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf Of
> James Ihrig
> Sent: Monday, August 09, 2010 1:23 PM
> To: cmake@cmake.org
> Subject: [CMake] Eliminate Debug/Release directories and name executables
> based on configuration
>
>
>
> Hello,
>
>
>
> I'm using CMake for Visual Studio as well as Makefiles for Linux. In
> windows, debug and release directories seem to be added for the executables.
>
>
>
> I actually would like to do three things:
>
>
>
> 1) Test for a debug or release build
>
> 2) Name the executable created based on it's build. (myProgram_d.exe for
> debug, myProgram.exe for release.)
>
> 3) Place the output executables into the bin directory without debug and
> release directories.
>
>
>
> I have not found a way to test for the build type but I have tried these
> together, and in various combinations:
>
>
>
> set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/../Demo/bin)
>
> set(RUNTIME_OUTPUT_BINARY ${PROJECT_BINARY_DIR}/../Demo/bin)
>
> set(RUNTIME_OUTPUT_DIRECTORY_DEBUG ${PROJECT_BINARY_DIR}/../Demo/bin)
>
> set(RUNTIME_OUTPUT_DIRECTORY_RELEASE ${PROJECT_BINARY_DIR}/../Demo/bin)
>
> set(RUNTIME_OUTPUT_NAME_DEBUG demo_d.exe)
>
> set(RUNTIME_OUTPUT_NAME_RELEASE demo.exe)
>
>
>
> The closest I can come are these executables:
>
> Demo\bin\Debug\helloDemo.exe
>
> Demo\bin\Release\helloDemo.exe
>
>
>
> What I want is:
>
> Demo\bin\demo_d.exe
>
> Demo\bin\demo.exe
>
>
>
> Any help or suggestions would be greatly appreciated!
>
> -Jim
>
>
>
>
>
> P.S.
>
> For anyone curious what my main CMakeLists.txt looks like, here it is:
>
> http://codepad.org/Yuev7TWJ
>
>
>
> ___
> 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] Fwd: Eliminate Debug/Release directories and name executables based on configuration

2010-08-09 Thread Ben Medina
Sorry, meant to keep this on the list.

- Ben
-- Forwarded message --
From: Ben Medina 
Date: Mon, Aug 9, 2010 at 12:45 PM
Subject: Re: [CMake] Eliminate Debug/Release directories and name
executables based on configuration
To: James Ihrig 


I believe this is what the DEBUG_POSTFIX property is for:

set_target_properties (demo PROPERTIES DEBUG_POSTFIX _d)

- Ben

On Mon, Aug 9, 2010 at 11:23 AM, James Ihrig  wrote:
> Hello,
> I'm using CMake for Visual Studio as well as Makefiles for Linux. In
> windows, debug and release directories seem to be added for the executables.
> I actually would like to do three things:
> 1) Test for a debug or release build
> 2) Name the executable created based on it's build. (myProgram_d.exe for
> debug, myProgram.exe for release.)
> 3) Place the output executables into the bin directory without debug and
> release directories.
> I have not found a way to test for the build type but I have tried these
> together, and in various combinations:
> set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/../Demo/bin)
> set(RUNTIME_OUTPUT_BINARY ${PROJECT_BINARY_DIR}/../Demo/bin)
> set(RUNTIME_OUTPUT_DIRECTORY_DEBUG ${PROJECT_BINARY_DIR}/../Demo/bin)
> set(RUNTIME_OUTPUT_DIRECTORY_RELEASE ${PROJECT_BINARY_DIR}/../Demo/bin)
> set(RUNTIME_OUTPUT_NAME_DEBUG demo_d.exe)
> set(RUNTIME_OUTPUT_NAME_RELEASE demo.exe)
> The closest I can come are these executables:
> Demo\bin\Debug\helloDemo.exe
> Demo\bin\Release\helloDemo.exe
> What I want is:
> Demo\bin\demo_d.exe
> Demo\bin\demo.exe
> Any help or suggestions would be greatly appreciated!
> -Jim
>
> P.S.
> For anyone curious what my main CMakeLists.txt looks like, here it is:
> http://codepad.org/Yuev7TWJ
>
> ___
> 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] VS-C++ Express Version

2010-05-14 Thread Ben Medina
Right, that's bug 0010481, for which we're waiting a fix. We also are
waiting on 10502 and 0010589. There seems to be some disconnect ,
because 0010481 is marked as new and unassigned, but you guys have
already fixed it.

I'm curious if any of the Kitware folks have tried building ParaView
with VS2010

- Ben

On Fri, May 14, 2010 at 7:53 AM, David Cole  wrote:
> On Fri, May 14, 2010 at 8:02 AM, Philip Lowman  wrote:
>>
>> This is Microsoft's fault.  You should complain to them.
>
> Well, yes and no. It's a Visual Studio 2010 only thing... And it's partly
> CMake's fault. The *.filters files are presently unconditionally re-written
> at CMake time. We have a fix for that part of it that will be in the next
> release of CMake. (It's not even in git master, yet, though.) I'll push it
> today.
> And the reload macros are not working as well as they did in prior Visual
> Studio versions. This is a VS change that we have not figured out yet how to
> compensate for...
>
>>
>> The only workaround for VS Express is to close your solution and run CMake
>> manually then open your solution back up again.
>> The problem doesn't affect VS Professional (and I believe Standard)
>> because they have support for macros which CMake takes advantage of to
>> reload all of the VS project files without a lot of user interaction.
>
> The *.filters problem affects all versions of Visual Studio 2010. The fix
> will be in git master later today.
>
> Thanks,
> David Cole
>
> ___
> 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] Handling External Libraries and Resources

2010-05-13 Thread Ben Medina
We've struggled with the same issue, and for out latest project, we've
switched to using fixup_bundle to handle the installation of 3rd party
lib dependencies, rather than copying them into the build tree as a
build step.

To ensure that developers can still easily launch the app for
debugging, on Windows we create a custom vcproj.user file that
specifies a custom PATH environment variable. On Linux, we create a
custom shell script that specifies additional entries to
LD_LIBRARY_PATH before it launches the app. We're not currently using
XCode, so I'm not sure what's involved there.

- Ben

On Wed, May 12, 2010 at 6:09 PM, Patrik Gornicz  wrote:
>
>
> Sorry about the subject line.
>
> I've never posted to a mailing list before and I wasn't sure if [CMake] would 
> be automatically prepended or not, plus it seems I didn't do it correctly 
> myself ...
>
> Patrik Gornicz
>
>> From: gornic...@hotmail.com
>> To: cmake@cmake.org
>> Date: Wed, 12 May 2010 18:12:20 -0400
>> Subject: [CMake] [CMAKE] Handling External Libraries and Resources
>>
>>
>>
>> I've been tasked with developing a new build system for projects at my work
>> place. We decided to use CMake and have been quite pleased thus far. However,
>> we've run into a requirement we haven't been able to satisfy to our 
>> satisfaction.
>>
>> The requirement is with respect to handling external libraries and resources
>> when building.  By external libraries I mean libraries that the CMake system
>> itself does not build (ex. boost, third party libraries, etc.) but we want to
>> use without having to install them on the system (ie. keep them local to our
>> build tree).  By resources I mean anything else that our binaries require to
>> function normally (ex. images, music, audio clips, localized text files, 
>> etc.)
>>
>> Essentially, we want a directory, say targetdir, were all our runtime 
>> required
>> files get built or copied into such that the program can execute in a 
>> developer
>> friendly way using both XCode and Visual Studio.
>>
>> What is the best way to do this with CMake?
>>
>>
>> Requirements:
>>   * Must work well with XCode on the Mac, GNU Make on the Mac, and Visual
>>     Studio on Windows.
>>   * Updating resources and/or external libraries should cause their versions 
>> in
>>     the targetdir to get updated (ie. Dependency tracking)
>>
>> Reasons for desiring a targetdir:
>>   * Our application loads resources (ex. images) using paths relative to the
>>     main executable. (rather common, no?)
>>   * On Windows there is no rpath option to tell Windows where to search for
>>     dlls (at least to the best of my knowledge there isn't), hence, dlls need
>>     to be side-by-side with our main executable.
>>   * Its nice to have everything required to run a program in one location so 
>> an
>>     installer can be created without having everything scattered around a 
>> build
>>     tree.
>>
>> What we are currently doing:
>>   * Build all of our shared libraries and binaries into this target 
>> directory.
>>     * Ex. set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/targetdir")
>>     * Ex. set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/targetdir")
>>   * Manually keeping track of and copying external libraries and resources 
>> into
>>     this target directory.
>>     * CON: There doesn't seem to be a way to create custom commands and have 
>> a
>>    non custom target use/execute them.
>>   * Hence, we've created an addition target (called App-build-resources)
>>     which is a custom target and runs our custom copying code and the App
>>     target depends on this addition target.
>>     * CON: Currently we only have resources associated with applications
>>    (binaries), but it would be nice to have resources associated with
>>    libraries.
>>   * ie. It would be nice if a library copied resources it needs into the
>>     location it is being built. Currently this would require a
>>     Lib-build-resources target per library which is quite ugly.
>>     * PRO: A developer can select the App target (ex. Set As StartUp Project 
>> in
>>    Visual Studio) and simply build knowing that the custom target 
>> will
>>    run before the App target is considered up to data.
>>     * PRO: A developer can simply execute the App target after building
>>    directly because the App target creates the main executable.
>>     * CON: The CMake code is rather ugly due to the large amount of manual 
>> work going on.
>>   * Keeping track of what external file to link against and making 
>> targets
>>     link against it.
>>   * Keeping track of what external file and resources need to be copied
>>     into the targetdir.
>>
>> Other things we've tried or considered:
>>   * Using an INSTALL target that copies all of the built binaries, libraries,
>>     external libraries and resources into a directory that is within the 
>> source
>> 

[CMake] Can't double-click to launch Mac app bundle

2010-04-23 Thread Ben Medina
Hello all,

I have a Qt-based Mac app that I build with CMake. I run fixup_bundle
on it to copy all pre-requisites over during the install step.
However, when I double-click on the .app, the application does not
launch. It's icon bounces a few times in the dock, then goes away with
no errors. If I run the executable from the shell (i.e. execute the
binary in .app/Contents/MacOS), the application launches as expected.

Does anyone know what magic is required for double-click launching to work?

Thanks,
Ben
___
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] Creating a Mac bundle for an app dependent on Qt and ParaView

2010-04-22 Thread Ben Medina
FYI, this turned out to be user error. I somehow was starting with a
bundle that had been partially repaired, and fixup_bundle choked on
that. After I cleaned and rebuilt, fixup_bundle worked as expected.

Now if only it would copy qt_menu.nib

Thanks,
Ben

On Wed, Apr 21, 2010 at 10:43 AM, Ben Medina  wrote:
> Hello all,
>
> I am trying to package an app on the Mac into an app bundle. This app
> depends on Qt and ParaView, so I have code like this:
>
>    # directories to look for dependencies: Qt, ParaView/VTK
>    set(DIRS "${QT_LIBRARY_DIRS};${PARAVIEW_LIBRARY_DIRS}")
>
>    install(CODE
>        "
>        include(BundleUtilities)
>        fixup_bundle(\"${TP_MAC_BUNDLE_PATH}\" \"\" \"${DIRS}\")
>        "
>        COMPONENT Runtime
>    )
>
> However, I get errors about finding the ParaView libs during
> packaging. For each ParaView lib:
>
> warning: target
> '@executable_path/../MacOS/libvtkPVServerManager.dylib' is not
> absolute...
> warning: target
> '@executable_path/../MacOS/libvtkPVServerManager.dylib' does not
> exist...
> /usr/bin/otool: can't open file:
> @executable_path/../MacOS/libvtkPVServerManager.dylib (No such file or
> directory)
>
> Followed by:
>
> Error copying file
> "@executable_path/../MacOS/libvtkPVServerManager.dylib" to
> ".../MyApp.app/Contents/MacOS/libvtkPVServerManager.dylib".
>
> Obviously, it's not looking in the right place for the libs. I'm
> expecting it to look in PARAVIEW_LIBRARY_DIRS, as I specified in the
> last argument to fixup_bundle (and, indeed, PARAVIEW_LIBRARY_DIRS does
> get set to a directory containing the specified libs). But it's
> looking in the bundle itself. What am I doing wrong?
>
> Thanks,
> Ben
>
___
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] Creating a Mac bundle for an app dependent on Qt and ParaView

2010-04-21 Thread Ben Medina
Hello all,

I am trying to package an app on the Mac into an app bundle. This app
depends on Qt and ParaView, so I have code like this:

# directories to look for dependencies: Qt, ParaView/VTK
set(DIRS "${QT_LIBRARY_DIRS};${PARAVIEW_LIBRARY_DIRS}")

install(CODE
"
include(BundleUtilities)
fixup_bundle(\"${TP_MAC_BUNDLE_PATH}\" \"\" \"${DIRS}\")
"
COMPONENT Runtime
)

However, I get errors about finding the ParaView libs during
packaging. For each ParaView lib:

warning: target
'@executable_path/../MacOS/libvtkPVServerManager.dylib' is not
absolute...
warning: target
'@executable_path/../MacOS/libvtkPVServerManager.dylib' does not
exist...
/usr/bin/otool: can't open file:
@executable_path/../MacOS/libvtkPVServerManager.dylib (No such file or
directory)

Followed by:

Error copying file
"@executable_path/../MacOS/libvtkPVServerManager.dylib" to
".../MyApp.app/Contents/MacOS/libvtkPVServerManager.dylib".

Obviously, it's not looking in the right place for the libs. I'm
expecting it to look in PARAVIEW_LIBRARY_DIRS, as I specified in the
last argument to fixup_bundle (and, indeed, PARAVIEW_LIBRARY_DIRS does
get set to a directory containing the specified libs). But it's
looking in the bundle itself. What am I doing wrong?

Thanks,
Ben
___
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] Minimal Info.plist

2010-04-20 Thread Ben Medina
That seems to be how everyone does it, so I guess I'll follow suit.
What's throwing me off is the wiki says this about the Bundle
generator: "Rationale: de-facto standard mechanism for distributing
bundles." Unless that's only specifically referencing the previous
sentence about distributing a compressed disk image.

Is there any documentation about why one would choose the Bundle
generator over DragNDrop?

Thanks,
Ben

On Mon, Apr 19, 2010 at 5:21 PM, Ryan Pavlik  wrote:
> You might consider the MACOSX_BUNDLE target property, which lets you build a
> bundle right at that time, including the info.plist - you can then use this
> with DragNDrop to have a DMG containing one or more app bundles for easy
> install.
>
> Ryan
>
> On 04/19/2010 07:04 PM, Ben Medina wrote:
>>
>> Hello all,
>>
>> I'm using the CPack Bundle generator to package my application on the
>> Mac (assuming this is preferable to the DragNDrop generator according
>> to http://www.cmake.org/Wiki/CMake:CPackPackageGenerators). One
>> requirement is providing an Info.plist file, but I don't know what
>> information is required in my plist. Is there are example somewhere of
>> a minimal Info.plist for a CMake-built app?
>>
>> It seems that the DragNDrop generator creates a plist for you, but
>> that functionality is missing from the Bundle generator. Can I
>> directly invoke whatever the DragNDrop generator is using to create a
>> default plist?
>>
>> Thanks,
>> Ben
>> ___
>> 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
>>
>
> --
> Ryan Pavlik
> HCI Graduate Student
> Virtual Reality Applications Center
> Iowa State University
>
> rpav...@iastate.edu
> http://academic.cleardefinition.com
> Internal VRAC/HCI Site: http://tinyurl.com/rpavlik
>
> ___
> 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] Minimal Info.plist

2010-04-19 Thread Ben Medina
Hello all,

I'm using the CPack Bundle generator to package my application on the
Mac (assuming this is preferable to the DragNDrop generator according
to http://www.cmake.org/Wiki/CMake:CPackPackageGenerators). One
requirement is providing an Info.plist file, but I don't know what
information is required in my plist. Is there are example somewhere of
a minimal Info.plist for a CMake-built app?

It seems that the DragNDrop generator creates a plist for you, but
that functionality is missing from the Bundle generator. Can I
directly invoke whatever the DragNDrop generator is using to create a
default plist?

Thanks,
Ben
___
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 2.8.1 + Qt/Cocoa + OS X Problem -- qt_menu.nib not getting copied

2010-04-19 Thread Ben Medina
Hi Mike,

I would be interested in taking a look at your git repo. Where is it located?

Thanks,
Ben

On Fri, Apr 16, 2010 at 7:36 AM, Michael Jackson
 wrote:
> Lets take a deeper look at what is needed for an OS X bundle, cmake and Qt.
>
>  The issues with making an OS X app bundle "relocatable" are well known
> (those following along at home can Google search..). If you are including
> libraries into the bundle then the "install_name" of those
> libraries/frameworks need to be something like "@executable_path" and
> placed correctly into the app bundle. This is what "BundleUtilities.cmake"
> does for you. Nothing More.
>
>   The nib file that Qt-Cocoa needs is particular to Qt-Cocoa builds. It has
> NOTHING to do with CMake at all. I, like everyone else, has a shell script
> template and CMake template file that they use to create their Qt/Cocoa
> bundles and we forget that BundleUtilities does NOT actually take care of
> some of this for us. Now, CMake _could_ offer a bit better support for
> Qt/Cocoa by maybe explicitly offering a "DeployQtApplication" cmake function
> that would "do the right thing" based on the type of Qt being used (Carbon
> vs Cocoa), copying plugins, copying the nib file, creating a qt.conf file if
> needed. That would be an excellent feature request to submit to the bug
> tracker.
>
>  If you are interested you are welcome to pull some apps from my git repo
> and take a look at how I am generating the app bundle.
>
>  So, I agree with your philosophical concerns that CMake _could_ offer some
> convenience functions to more explicitly deal with Qt/Cocoa.
>
>  Hope that helps.
> ___
> Mike Jackson                      www.bluequartz.net
> Principal Software Engineer       mike.jack...@bluequartz.net
> BlueQuartz Software               Dayton, Ohio
>
>
> On Apr 16, 2010, at 10:13 AM, kent williams wrote:
>
>> If you have the URL of this example, I'd love to look at it. I have
>> been poring over the CMake wiki without finding anything.
>>
>> But that's not what I was concerned about. What bothers me is that:
>>
>> 1, If you build against Qt-Carbon, this isn't a problem.
>> 2. if qtmenu.nib is needed, and it isn't being fixed by
>> BundleUtilities::fixup_bundle, then fixup_bundle isn't actually fixing
>> up the bundle.
>>
>> The bug 1 I found in the CMake bug tracker actually is
>> specifically about working around this problem in the specific case of
>> building the Qt CMake client.
>>
>> My broader philosophical concern is that actually making a proper OS X
>> bundle with CMake is a process with too many moving parts.  The whole
>> point of CMake is to eliminate boilerplate by dealing with the build
>> process at a higher level, and this strikes me as definitely something
>> that has to happen every time you build a bundle for OSX
>>
>> On Thu, Apr 15, 2010 at 9:07 PM, Mike Jackson
>>  wrote:
>>>
>>> I do not see any where in your code commands to actually copy the nib
>>> file from the qtgui framework into your app bundle. I know thatbthe
>>> way I set up my installation code I explicitly put a command to copy
>>> the nib file. I believe there is a qt example on the cmake wiki that
>>> shows how to do that.
>>>
>>> -
>>> Mike Jackson                      www.bluequartz.net
>>> Principal Software Engineer       mike.jack...@bluequartz.net
>>> BlueQuartz Software               Dayton, Ohio
>>>
>>>
>>> On Apr 15, 2010, at 17:06, kent williams 
>>> wrote:
>>>
 I'll include my CMakeLists.txt at the end of this message, but the
 long and the short of it is this: My ApplicationBundle crashes when I
 try and open it with this classic error message:

 Qt internal error: qt_menu.nib could not be loaded. The .nib file
 should be placed in QtGui.framework/Versions/Current/Resources/  or in
 the resources directory of your application bundle.

 This is supposed to be fixed, as documented in this bug:

 http://public.kitware.com/Bug/view.php?id=1

 I checked out the latest GIT CMake and verified that the file in
 question is the same in 2.8.1 and current GIT trunk.

 So is there some magical extra step I need to get my bundle properly
 fixed up?

 project( BRAINSTracerQT )
 cmake_minimum_required(VERSION 2.8)
 cmake_policy(VERSION 2.8)

 find_package( VTK REQUIRED )
 include(${VTK_USE_FILE})

 find_package( ITK REQUIRED )
 include(${ITK_USE_FILE})

 find_package( Qt4 REQUIRED )
 if(QT_USE_FILE)
  include(${QT_USE_FILE})
  set(QT_USE_QTXML 1)
 else(QT_USE_FILE)
  set( QT_LIBRARIES   ${QT_QT_LIBRARY})
 endif(QT_USE_FILE)

 find_package(ModuledescriptionParser REQUIRED)
 include(${ModuleDescriptionParser_USE_FILE})

 find_package(TCL REQUIRED)

 find_package( VTK REQUIRED )
 include(${VTK_USE_FILE})

 find_package( ITK REQUIRED )
 include(${ITK_U

Re: [CMake] Problems with ExternalProject_Add and tar.gz files

2010-04-02 Thread Ben Medina
Thanks. Bug filed:
http://www.cmake.org/Bug/view.php?id=10505

On Fri, Apr 2, 2010 at 2:28 PM, Luigi Calori  wrote:
> I got exactly the same error in doing something similar:
> it is the untar phase based on cmake that seem to fail on some kind of tar:
> in the untar phase, externalProject uses cmake -E tar xvf 
> and this is the part that fail.
> if I issue the command:
>
>>cmake -E tar xzf boost-1.41.0.cmake0.tar.gz
> or unpack and
> cmake -E tar xf boost-1.41.0.cmake0.tar
>
> got the same error
> CMake Error: Problem with tar_extract_all(): Invalid argument
>
> It seem somehow related to some kind of tar version or content:
>
> for example it happened to me also getting the latest pycrypto
> http://ftp.dlitz.net/pub/dlitz/crypto/pycrypto/pycrypto-2.1.0.tar.gz
>
> Probably we should issue a bug
>
> HTH
>
> Ben Medina wrote:
>>
>> I'm trying to get ExternalProject_Add to work, using a tar.gz file as
>> the source. My experiment thus far is with boost, and my code looks
>> like this:
>>
>>    include (ExternalProject)
>>    set (boost_libs_to_build program_options)
>>    ExternalProject_Add(
>>        boost
>>        URL
>> http://sodium.resophonic.com/boost-cmake/1.41.0.cmake0/boost-1.41.0.cmake0.tar.gz
>>        CMAKE_ARGS -DBUILD_PROJECT=${boost_libs_to_build}
>>    )
>>
>> This produces the boost target, as expected, but building the target
>> results in failure:
>>
>> 2>Performing download step (download and extract) for 'boost'
>> 2>-- downloading...
>> 2>
>> src='http://sodium.resophonic.com/boost-cmake/1.41.0.cmake0/boost-1.41.0.cmake0.tar.gz'
>> 2>
>> dst='C:/tecdev/tecplot/360/trunk/_build/win64-vs2008/boost-prefix/src/boost-1.41.0.cmake0.tar.gz'
>> 2>     timeout='none'
>> 2>-- downloading... done
>> 2>-- extracting...
>> 2>
>> src='C:/tecdev/tecplot/360/trunk/_build/win64-vs2008/boost-prefix/src/boost-1.41.0.cmake0.tar.gz'
>> 2>
>> dst='C:/tecdev/tecplot/360/trunk/_build/win64-vs2008/boost-prefix/src/boost'
>> 2>-- extracting... [tar xfz]
>> 2>CMake Error: Problem with tar_extract_all(): Invalid argument
>> 2>CMake Error: Problem extracting tar:
>>
>> C:/tecdev/tecplot/360/trunk/_build/win64-vs2008/boost-prefix/src/boost-1.41.0.cmake0.tar.gz
>> 2>-- extracting... [error clean up]
>> 2>CMake Error at boost-stamp/extract-boost.cmake:30 (message):
>> 2>  error: extract of
>> 2>
>>  'C:/tecdev/tecplot/360/trunk/_build/win64-vs2008/boost-prefix/src/boost-1.41.0.cmake0.tar.gz'
>> 2>  failed
>>
>> Is there any way to know exactly what is going wrong with the extraction?
>>
>> Thanks,
>> Ben
>> ___
>> 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] Problems with ExternalProject_Add and tar.gz files

2010-04-02 Thread Ben Medina
I'm trying to get ExternalProject_Add to work, using a tar.gz file as
the source. My experiment thus far is with boost, and my code looks
like this:

include (ExternalProject)
set (boost_libs_to_build program_options)
ExternalProject_Add(
boost
URL 
http://sodium.resophonic.com/boost-cmake/1.41.0.cmake0/boost-1.41.0.cmake0.tar.gz
CMAKE_ARGS -DBUILD_PROJECT=${boost_libs_to_build}
)

This produces the boost target, as expected, but building the target
results in failure:

2>Performing download step (download and extract) for 'boost'
2>-- downloading...
2> 
src='http://sodium.resophonic.com/boost-cmake/1.41.0.cmake0/boost-1.41.0.cmake0.tar.gz'
2> 
dst='C:/tecdev/tecplot/360/trunk/_build/win64-vs2008/boost-prefix/src/boost-1.41.0.cmake0.tar.gz'
2> timeout='none'
2>-- downloading... done
2>-- extracting...
2> 
src='C:/tecdev/tecplot/360/trunk/_build/win64-vs2008/boost-prefix/src/boost-1.41.0.cmake0.tar.gz'
2> 
dst='C:/tecdev/tecplot/360/trunk/_build/win64-vs2008/boost-prefix/src/boost'
2>-- extracting... [tar xfz]
2>CMake Error: Problem with tar_extract_all(): Invalid argument
2>CMake Error: Problem extracting tar:
C:/tecdev/tecplot/360/trunk/_build/win64-vs2008/boost-prefix/src/boost-1.41.0.cmake0.tar.gz
2>-- extracting... [error clean up]
2>CMake Error at boost-stamp/extract-boost.cmake:30 (message):
2>  error: extract of
2>  
'C:/tecdev/tecplot/360/trunk/_build/win64-vs2008/boost-prefix/src/boost-1.41.0.cmake0.tar.gz'
2>  failed

Is there any way to know exactly what is going wrong with the extraction?

Thanks,
Ben
___
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 2.8.1 RC 3 is ready to try

2010-02-18 Thread Ben Medina
On Wed, Feb 17, 2010 at 7:39 AM, Bill Hoffman  wrote:
> CMake 2.8.1 RC 3 is ready to try:
>
> http://www.cmake.org/files/v2.8/?C=M;O=D
>
> Please try your projects with it.   If you find any issues, let me know. I
> think we are getting very close to the actual release.  Pretty much
> regressions only at this point, so PLEASE test your software with this
> release.

I just took it for a spin on the Windows side of my projects. It
worked flawlessly with VS2005 and VS2008. However, with VS2010, CMake
is re-run in the middle of the build. It happens as soon as I hit a
project that depends on Qt, and running of moc fails. Here is the
relevant output (with some names changed to protect the innocent):

19>-- Rebuild All started: Project: xxx_qt, Configuration: Debug x64 --
19>Build started 2/18/2010 1:25:53 PM.
19>InitializeBuildStatus:
19>  Creating "xxx_qt.dir\Debug\xxx_qt.unsuccessfulbuild" because
"AlwaysCreate" was specified.
19>CustomBuild:
19>  Generating __/intern/moc_EventReceiverDestroyedListener.cxx
19>  Generating __/moc_GLDrawArea.cxx
19>  The system cannot find the path specified.
19>  moc: Cannot open options file specified with @
19>  Usage: moc [options] 
19>-o   write output to file rather than stdout
19>-Iadd dir to the include path for header files
19>-E preprocess only; do not generate meta object code
19>-D[=]  define macro, with optional definition
19>-U  undefine macro
19>-i do not generate an #include statement
19>-p   path prefix for included file
19>-f[] force #include, optional file name
19>-nwdo not display warnings
19>@read additional options from file
19>-v display version of moc
19>  Building Custom Rule
C:/dev/vs2010/sdk/trunk/libs/integrationmanager/qt/_build/CMakeLists.txt
19>  CMake is re-running because CMakeFiles/generate.stamp dependency
file is missing.

You can see it successfully mocs one item, then fails on the next. Is
there a way to tell what commands it's giving to moc?

Thanks,
Ben
___
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] Problems with 2.8.0 and VS 10 generator: CMAKE_CFG_INTDIR, UNC paths, and QT_LIBRARIES

2009-11-17 Thread Ben Medina
Hello,

I'm doing some testing of VS 2010 B2 with CMake 2.8.0, and I've run
into several problems:

1. CMAKE_CFG_INTDIR is set to $(ConfigurationName), a macro which no
longer exists in VS 2010. According to the CMake docs
(http://www.cmake.org/cmake/help/cmake-2-8-docs.html#variable:CMAKE_CFG_INTDIR),
it is supposed to be $(Configuration), but that's not what I'm seeing.

2. The VS10 generator seems to no longer replace forward slashes with
back slashes in file paths, which breaks UNC paths in the project
files. For example, if I specify a link against
"//server/share/somelibrary.lib" in CMake, it should be translated to
"\\server\share\somelibrary.lib" in the vcproj file. This works for
the VS9 generator, but not the VS10 generator, leading to a linker
error.

3. find_package (Qt4 REQUIRED) sets QT_LIBRARIES to a list that
contains a space-separated entry. For example:

optimized;C:/Qt/4.5.2/lib/QtOpenGL4.lib;debug;C:/Qt/4.5.2/lib/QtOpenGLd4.lib;opengl32.lib
glu32.lib gdi32.lib
user32.lib;optimized;C:/Qt/4.5.2/lib/QtGui4.lib;debug;C:/Qt/4.5.2/lib/QtGuid4.lib;imm32;winmm;optimized;C:/Qt/4.5.2/lib/QtCore4.lib;debug;C:/Qt/4.5.2/lib/QtCored4.lib;ws2_32

Note in the middle of that is "opengl32.lib glu32.lib gdi32.lib
user32.lib", with no semicolon separators.

This causes no problems for the VS9 generator, as the vcproj file's
 list is space-separated, anyway. However, the
VS10 generator produces a semicolon-separated list for the
 tag. This leads the linker to think it should
link against a file called "opengl32.lib glu32.lib gdi32.lib
user32.lib", which fails, of course.

Do these sounds like legitimate bugs, or my own problems? I didn't
find anything resembling these in Mantis.
___
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