[cmake-developers] [CMake 0012399]: cmake installer for Mac fails to create /usr/bin symlinks over previous version

2011-08-12 Thread Mantis Bug Tracker

The following issue has been SUBMITTED. 
== 
http://public.kitware.com/Bug/view.php?id=12399 
== 
Reported By:freddie
Assigned To:
== 
Project:CMake
Issue ID:   12399
Category:   CMake
Reproducibility:always
Severity:   major
Priority:   normal
Status: new
== 
Date Submitted: 2011-08-12 08:17 EDT
Last Modified:  2011-08-12 08:17 EDT
== 
Summary:cmake installer for Mac fails to create /usr/bin
symlinks over previous version
Description: 
With 2.8.4 installed in the system, together with its symlinks in /usr/bin,
attempts to install 2.8.5 fail at the /usr/bin symlink creation stage unless
they are removed manually first.

Steps to Reproduce: 
1. Install 2.8.4 with symlinks.
2. Install 2.8.5 with symlinks.
== 

Issue History 
Date ModifiedUsername   FieldChange   
== 
2011-08-12 08:17 freddieNew Issue
==

___
cmake-developers mailing list
cmake-developers@cmake.org
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


Re: [CMake] Sub dependencies?

2011-08-12 Thread Michael Wild
If the projects are independent, you might want to take a look at this 
Wiki page: 
http://www.cmake.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file.

HTH

Michael

___
Powered by www.kitware.com

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

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

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


Re: [CMake] touch flag once all (target) sucess

2011-08-12 Thread t m
 I would like to touch flag file in the CMAKE_BINARY_DIR once the
 target all is executed with sucess.
 Since currently I'm not able to specify the dependency to this
 build-in target I do not have any hook to recognize if all sucess and
 1. Does anyone knows any hint that can help me with this issue
 2. Question to CMake developers/maintainers: Is there any plan  to
 implement this ticket in near future:
 http://www.cmake.org/Bug/view.php?id=8438#c26520
 The only way I can think of is to provide custom functions for
 add_library, add_executable and add_custom_target (if you use the same
 name, the original commands are available by appending a underscore to
 the name) which add a dependency of you flag target on all the other
 targets.


Thank you for feedback Michael. I take care about maintaing a bunch of
common cmake scripts for group of developers.
The workflow is a little bit complicated to describe it in short. I
just need to know
the compilation status form other processes that call: make all and
make package.
Therefore I think simply file flag is the best choice. I don't wont to
make it in wrapper
for make and I'm looking for solution in cmake.

The implementation of this ticket
http://www.cmake.org/Bug/view.php?id=8438#c26520 will help me.
However this is 2,5 years old ticket so I'm looking for some time
being solution.

Thanks, T. Majchrowski.
___
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] Sub dependencies?

2011-08-12 Thread Doug
I'm sorry if I'm being dumb here, but I fail to see how that helps.

That example is one where foobar depends explicitly on foo and bar.

What if foo depends on bar2?

How do I inherit that dependency from foo in foobar?

_that's_ what I'm looking for.

(If that example somehow explains that, I'm sorry, I can't see it. Can you
point to a specific point in the page?)

~
Doug.

On Fri, Aug 12, 2011 at 2:34 PM, Michael Wild them...@gmail.com wrote:

 If the projects are independent, you might want to take a look at this
 Wiki page:

 http://www.cmake.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file
 .

 HTH

 Michael

 ___
 Powered by www.kitware.com

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

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

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

___
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] Sub dependencies?

2011-08-12 Thread Michael Wild
On Fri 12 Aug 2011 10:49:45 AM CEST, Doug wrote:
 I'm sorry if I'm being dumb here, but I fail to see how that helps.
 
 That example is one where foobar depends explicitly on foo and bar.
 
 What if foo depends on bar2? 
 
 How do I inherit that dependency from foo in foobar? 
 
 _that's_ what I'm looking for.
 
 (If that example somehow explains that, I'm sorry, I can't see it. Can
 you point to a specific point in the page?)
 
 ~
 Doug.
 
 On Fri, Aug 12, 2011 at 2:34 PM, Michael Wild them...@gmail.com
 mailto:them...@gmail.com wrote:
 
 If the projects are independent, you might want to take a look at this
 Wiki page:
 
 http://www.cmake.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file.
 
 HTH
 
 Michael
 

And that is what the example is *about*. The FooBar project *exports*
its targets, along with their dependencies, so that when other projects
do find_package(FooBar), they will be able to link against the foo
library without having to know any of the dependencies of it. E.g. the
project hello might look like this:

project(hello)
find_package(FooBar REQUIRED)
include_directories(${FOOBAR_INCLUDE_DIRS})
add_executable(hello hello.c)
target_link_libraries(hello ${FOOBAR_LIBRARIES})


Michael
___
Powered by www.kitware.com

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

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

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


Re: [CMake] Sub dependencies?

2011-08-12 Thread Andreas Pakulat
On 12.08.11 16:48:09, Doug wrote:
 why?
 
 I've invoked:
 
 find_package(liba REQUIRED)
 
 not:
 
 find_package(libpng REQUIRED)
 
 My application has no knowledge about libpng, or libjpg or whatever the heck
 else liba uses to load images.

I might have misinterpreted what you wrote so far, but if your
executable links only against liba and only uses symbols from liba then
indeed you won't need to link against libpng. However the linker errors
you posted initially indicated otherwise, since the linker seemed to
need libpng symbols when linking your executable. This means one of the
object files or static libraries of your executable uses symbols from
libpng, which means the executable needs to link against libpng.

Andreas

___
Powered by www.kitware.com

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

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

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


[CMake] CMake 2.8.5 problem with include directories with response files

2011-08-12 Thread Peter Visser

Hello,

I experience a problem with include directories with response files 
when upgrading from CMake 2.8.4 to CMake 2.8.5. The problem is probably 
that gcc does not handle the response files correctly. Is it possible to 
disable the response files with an option in CMake ?


I have a small HelloWorld wxWidgets example.
The makefile is generated for MSYS : cmake -G MSYS Makefiles
wxWidgets include directories are set with  FIND_PACKAGE(wxWidgets)

The compile line:
/C/Programs/MinGWGet/bin/g++.exe   -D__WXMSW__ -mthreads -O3 -DNDEBUG 
@CMakeFiles/HelloWorld.dir/includes_CXX.rsp   -o 
CMakeFiles/HelloWorld.dir/HelloWorld.cpp.obj -c 
/D/examples/001_HelloWorld/src/HelloWorld.cpp


The problem:
HelloWorld.cpp:7:20: fatal error: wx/wx.h: No such file or directory 
compilation terminated.


The content of the response file is good:
-isystem 
/usr/local/wx2812-release-static/lib/wx/include/msw-ansi-release-static-2.8 
-isystem /usr/local/wx2812-release-static/include/wx-2.8


when the content is put on the command line, the include files are found 
and HelloWorld compiles just fine.


Playing a bit with (--verbose) gave the following result:

GNU C++ (GCC) version 4.5.2 (mingw32)
compiled by GNU C version 4.5.2, GMP version 5.0.1, MPFR 
version 2.4.1, MPC version 0.8.1

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory 
/usr/local/wx2812-release-static/lib/wx/include/msw-ansi-release-static-2.8
ignoring nonexistent directory 
/usr/local/wx2812-release-static/include/wx-2.8


The paths are valid but not understood by gcc when read from the 
response file. If I change the content of the response file to:
-Ic:/programs/mingw/msys/1.0/local/wx2812-release-static/lib/wx/include/msw-ansi-release-static-2.8/ 
-Ic:/programs/mingw/msys/1.0/local/wx2812-release-static/include/wx-2.8


It also works fine, so in short when -isystem is in a response file it 
does not work :-(
Is there a way to influence the way CMake generates the response file, 
disabling it or forcing an absolute path instead of the -isystem path ?

Or should the FIND_PACKAGE(wxWidgets) generate an absolute path ?

Best regards,

Peter.
___
Powered by www.kitware.com

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

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

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


Re: [CMake] CMake 2.8.5 problem with include directories with response files

2011-08-12 Thread David Cole
Sounds like you're using MSYS Makefiles but then running make from a
non-MSYS shell.

If you want to run in a non-MSYS shell, then you should use MinGW
Makefiles instead. (Start over with an entirely clean build tree if
you do this...)

If you use MSYS Makefiles, you should run make from an MSYS shell,
where /usr/local should be an acceptable path.


HTH,
David


On Fri, Aug 12, 2011 at 7:42 AM, Peter Visser pervu...@gmail.com wrote:
 Hello,

 I experience a problem with include directories with response files when
 upgrading from CMake 2.8.4 to CMake 2.8.5. The problem is probably that gcc
 does not handle the response files correctly. Is it possible to disable the
 response files with an option in CMake ?

 I have a small HelloWorld wxWidgets example.
 The makefile is generated for MSYS : cmake -G MSYS Makefiles
 wxWidgets include directories are set with  FIND_PACKAGE(wxWidgets)

 The compile line:
 /C/Programs/MinGWGet/bin/g++.exe   -D__WXMSW__ -mthreads -O3 -DNDEBUG
 @CMakeFiles/HelloWorld.dir/includes_CXX.rsp   -o
 CMakeFiles/HelloWorld.dir/HelloWorld.cpp.obj -c
 /D/examples/001_HelloWorld/src/HelloWorld.cpp

 The problem:
 HelloWorld.cpp:7:20: fatal error: wx/wx.h: No such file or directory
 compilation terminated.

 The content of the response file is good:
 -isystem
 /usr/local/wx2812-release-static/lib/wx/include/msw-ansi-release-static-2.8
 -isystem /usr/local/wx2812-release-static/include/wx-2.8

 when the content is put on the command line, the include files are found and
 HelloWorld compiles just fine.

 Playing a bit with (--verbose) gave the following result:

 GNU C++ (GCC) version 4.5.2 (mingw32)
        compiled by GNU C version 4.5.2, GMP version 5.0.1, MPFR version
 2.4.1, MPC version 0.8.1
 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
 ignoring nonexistent directory
 /usr/local/wx2812-release-static/lib/wx/include/msw-ansi-release-static-2.8
 ignoring nonexistent directory
 /usr/local/wx2812-release-static/include/wx-2.8

 The paths are valid but not understood by gcc when read from the response
 file. If I change the content of the response file to:
 -Ic:/programs/mingw/msys/1.0/local/wx2812-release-static/lib/wx/include/msw-ansi-release-static-2.8/
 -Ic:/programs/mingw/msys/1.0/local/wx2812-release-static/include/wx-2.8

 It also works fine, so in short when -isystem is in a response file it does
 not work :-(
 Is there a way to influence the way CMake generates the response file,
 disabling it or forcing an absolute path instead of the -isystem path ?
 Or should the FIND_PACKAGE(wxWidgets) generate an absolute path ?

 Best regards,

 Peter.
 ___
 Powered by www.kitware.com

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

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

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

___
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] Setting MIDL Include path via cmake

2011-08-12 Thread David Cole
We actually have a test for idl files in the CMake test suite: VSMidl.
See where it was added in this commit:

  
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=13caaa3eb74a11dbf067409ea129321718d34dfe

However, there does appear to be an inconsistency between Visual
Studio 9 and earlier generators and Visual Studio 10: the VS10 one
does add include directories, whereas the VS9 and earlier generators
do not...

In 2.8.5, there's another issue, though. If you inspect the property
pages of an idl file in the GUI, it does not show anything. This is
related to the fact that we generate full path names for the idl file
in the vcxproj file, and Visual Studio doesn't display the property
pages correctly... (Separate issue, but the additional include
directory actually is there, you can verify with a text editor.)

So. can you use VS10? If not, it should be fairly simple to add
the additional include directories to older generators. I'll see if I
can get to it before the next CMake release. (or at the very least,
shortly thereafter...)


Thanks,
David


On Fri, Aug 5, 2011 at 12:37 PM, Paul Whelan pwhe...@aer.com wrote:
 It neither shows up in the IDE nor builds with a cannot find include file
 error. The project is kind of big and complex, so I created a quick sample
 that exhibits the same behavior. I included the project directory with
 original visual studio projects and a CMakeLists.txt file I wrote to do the
 same thing. A second directory (IDLSampleBld) contains the results of
 running cmake out of source.

 On 8/5/2011 10:54 AM, David Cole wrote:

 H... I have some old code where I built an ActiveX control that
 included an idl file that does this:

   include_directories(${CMAKE_CURRENT_BINARY_DIR}/\$(IntDir))
   include_directories(${CMAKE_CURRENT_BINARY_DIR}/\$(OutDir))

 I know it used to work, but I haven't built that project in about 4
 years... (I don't think I can simply trivially build it, as some of
 the things that it depends on are no longer actively developed and
 building with today's CMake and Visual Studio versions...)

 I do not know whether the include directories showed up in the VS
 Properties dialog, or if the flags were simply added to the midl
 command line, but I did have it working at one point.

 Either it's gotten broken by something in the interim, or it still
 works even though the VS GUI doesn't reflect reality... Does your
 project fail to build when using two include_directories commands as
 above?

 Is the build error simply a midl or a C++ cannot find include file
 x.h? Or something else?

 Is your project available for me to try? Or can you make a smalll
 simple stand-alone reproduce case?

 If we can't get it working with VS and it's built-in midl handling, we
 can always resort to running midl as a custom command


 HTH,
 David


 On Fri, Aug 5, 2011 at 8:10 AM, Paul Whelanpwhe...@aer.com  wrote:

 No, that just sets the compiler's include path. If you look at visual
 studio's property dialog for a COM dll, the MIDL properties General tab
 contains an Additional include directories entry much like the C++
 general
 tab. However, it isn't getting populated by cmake as best I can tell.

 On 8/4/2011 5:27 PM, David Cole wrote:

 Does calling

   include_directories(${CMAKE_CURRENT_BINARY_DIR})

 before calling add_library work?


 On Thu, Aug 4, 2011 at 4:14 PM, Paul Whelanpwhe...@aer.com    wrote:

 Hi guys,

 I'm new to the mailing list and fairly new to cmake itself, so I hope
 this
 isn't to basic a question to be posting here. Please refer me to the
 appropriate url/forum, etc if it is.

 I have a windows COM project that I'm trying to convert to a cmake
 build.
 The IDL file in that project has includes of header files in it, so I
 need a
 way to set the MIDL compiler's include path from cmake. I don't see an
 obvious variable to set in cmake and the visual studio (2008) project
 that
 it generates comes up with a blank MIDL include path. Any suggestions
 on
 how
 to set that and maybe also where I should be looking for that type of
 info
 if it is readily available?

 Thanks,
 Paul
 ___
 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 2.8.5 problem with include directories with response files

2011-08-12 Thread Peter Visser

On 8/12/2011 3:17 PM, David Cole wrote:

Sounds like you're using MSYS Makefiles but then running make from a
non-MSYS shell.


I have tried the following msys shells.
sh.exe
rxvt.exe
mintty.exe

For all these shells the include directories with response files do not 
work. If I paste the content from the response files on the command line 
the -isystem include paths work. So my best guess is that this is not a 
MSYS Shell question but that GCC is a bit picky on the @file construction.


includes_CXX.rsp file with content: -isystem /usr/local/somepath/
fails : g++.exe @includes_CXX.rsp
ok : g++.exe -isystem /usr/local/somepath/

Thanks for your suggestion,

Peter.

ps. Generating MinGW Makefiles generates an error (sh.exe in path) if 
CMake is invoked from one these MSYS shells which is correct behaviour.

___
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 0012322]: Ability to add source files to target created with ExternalProject

2011-08-12 Thread David Cole
You can re-open the issue if you would like to have more discussion there.

The build step does not always re-run. If you have an update step
before the build step, then the update step always re-runs, and the
build step after it, but many external projects do not have an update
step, or anything else that always forces a build when there's a
Build Solution executed on the containing project. (If it does, then
that's a bug, because it's only supposed to re-execute steps that
*need* to be re-executed.)


Thanks,
David


On Fri, Aug 12, 2011 at 10:46 AM, Yuri Timenkov y...@timenkov.ru wrote:
 Hello David,
 It seems that I can't add notes to closed bug, so I ask you directly.
 I don't quite understand what kind of automatic dependencies you're talking
 about.
 If I change file in this way and do build solution cmake will
 automatically launch build for external project. IIRC it always executes
 build when I build solution.
 As I said, for my local purposes I can use modified ExternalProject.cmake
 file, but I thought such feature might be useful for others.

 On Fri, Aug 12, 2011 at 5:24 PM, Mantis Bug Tracker
 man...@public.kitware.com wrote:

 A NOTE has been added to this issue.
 ==
 http://public.kitware.com/Bug/view.php?id=12322
 ==
 Reported By:                Yuri
 Assigned To:                David Cole
 ==
 Project:                    CMake
 Issue ID:                   12322
 Category:                   CMake
 Reproducibility:            always
 Severity:                   tweak
 Priority:                   normal
 Status:                     resolved
 Resolution:                 won't fix
 Fixed in Version:           CMake 2.8.6
 ==
 Date Submitted:             2011-07-08 05:27 EDT
 Last Modified:              2011-08-12 09:24 EDT
 ==
 Summary:                    Ability to add source files to target created
 with
 ExternalProject
 Description:
 In my scenario I have part of project which should be built with different
 toolset (Main project is built with VC2010, and some legacy libraries with
 VC6
 and VS2005).
 Basically nested project contains
 set(Proj_SRCS src1.cpp src2.cpp...)
 add_library(Proj MODULE ${Proj_SRCS})

 So set() command may be moved into separate file which in turn could be
 included
 into main project. So I want to see them there to edit in IDE, but not
 compile.

 The only possibility to add files to custom target - is specify SOURCES in
 add_custom_target command (It's impossible to call cmTarget::AddSources
 from
 outside). However, ExternalProject_Add macro doesn't add any sources.

 Moreover, there is a kind of chicken-and-egg problem: all arguments are
 parsed
 and set as property on target. But you can't set property while there is
 no
 target.

 So as quick work-around I made private copy of ExternalProject.cmake and
 pass
 sources as directory property.

 So I'm asking for ideas how to properly implement this feature: modify
 somehow
 parameters parsing in ExternalProject, or may be introduce command which
 allows
 adding new sources to existing targets (I'm not sure if this will work,
 but for
 me it sounds like target_link_libraries command).
 ==

 --
  (0027196) David Cole (manager) - 2011-08-12 09:23
  http://public.kitware.com/Bug/view.php?id=12322#c27196
 --
 I don't think we should do this.

 If we allow source files from external projects to be added directly to
 the IDE
 representations of the external projects in the containing project, then
 people
 will expect the dependencies to work correctly automatically...

 The dependencies will not work automatically. You will have to forcefully
 trigger an incremental rebuild of the external project on *any* build of
 the
 containing project, and then hope that its build system appropriately
 picks up
 only the incremental build changes necessary.

 I view this as fragile, and would not like to see it go in CMake unless it
 can
 be made robust, and shown to work automatically and as developers would
 expect
 in the vast majority of use cases.

 --
  (0027197) David Cole (manager) - 2011-08-12 09:24
  http://public.kitware.com/Bug/view.php?id=12322#c27197
 --
 If you need more help on this issue/topic, please send email to the CMake
 users
 list asking for advice there. There's a much wider readership of the
 mailing
 list than there is of the bug 

Re: [CMake] [CMake 0012322]: Ability to add source files to target created with ExternalProject

2011-08-12 Thread Yuri Timenkov
Ok, I'll double-check this next monday. That's why I was confused.

On the second thought if you have a list of sources you can add them as
dependencies in addition to build rule, then step will be re-run as
expected. May be it's my case.

Anyways I need to do some more investigation.

Best wishes,
Yuri

On Aug 12, 2011 6:54 PM, David Cole david.c...@kitware.com wrote:
 You can re-open the issue if you would like to have more discussion there.

 The build step does not always re-run. If you have an update step
 before the build step, then the update step always re-runs, and the
 build step after it, but many external projects do not have an update
 step, or anything else that always forces a build when there's a
 Build Solution executed on the containing project. (If it does, then
 that's a bug, because it's only supposed to re-execute steps that
 *need* to be re-executed.)


 Thanks,
 David


 On Fri, Aug 12, 2011 at 10:46 AM, Yuri Timenkov y...@timenkov.ru wrote:
 Hello David,
 It seems that I can't add notes to closed bug, so I ask you directly.
 I don't quite understand what kind of automatic dependencies you're
talking
 about.
 If I change file in this way and do build solution cmake will
 automatically launch build for external project. IIRC it always executes
 build when I build solution.
 As I said, for my local purposes I can use modified ExternalProject.cmake
 file, but I thought such feature might be useful for others.

 On Fri, Aug 12, 2011 at 5:24 PM, Mantis Bug Tracker
 man...@public.kitware.com wrote:

 A NOTE has been added to this issue.
 ==
 http://public.kitware.com/Bug/view.php?id=12322
 ==
 Reported By:Yuri
 Assigned To:David Cole
 ==
 Project:CMake
 Issue ID:   12322
 Category:   CMake
 Reproducibility:always
 Severity:   tweak
 Priority:   normal
 Status: resolved
 Resolution: won't fix
 Fixed in Version:   CMake 2.8.6
 ==
 Date Submitted: 2011-07-08 05:27 EDT
 Last Modified:  2011-08-12 09:24 EDT
 ==
 Summary:Ability to add source files to target
created
 with
 ExternalProject
 Description:
 In my scenario I have part of project which should be built with
different
 toolset (Main project is built with VC2010, and some legacy libraries
with
 VC6
 and VS2005).
 Basically nested project contains
 set(Proj_SRCS src1.cpp src2.cpp...)
 add_library(Proj MODULE ${Proj_SRCS})

 So set() command may be moved into separate file which in turn could be
 included
 into main project. So I want to see them there to edit in IDE, but not
 compile.

 The only possibility to add files to custom target - is specify SOURCES
in
 add_custom_target command (It's impossible to call cmTarget::AddSources
 from
 outside). However, ExternalProject_Add macro doesn't add any sources.

 Moreover, there is a kind of chicken-and-egg problem: all arguments are
 parsed
 and set as property on target. But you can't set property while there is
 no
 target.

 So as quick work-around I made private copy of ExternalProject.cmake and
 pass
 sources as directory property.

 So I'm asking for ideas how to properly implement this feature: modify
 somehow
 parameters parsing in ExternalProject, or may be introduce command which
 allows
 adding new sources to existing targets (I'm not sure if this will work,
 but for
 me it sounds like target_link_libraries command).
 ==

 --
  (0027196) David Cole (manager) - 2011-08-12 09:23
  http://public.kitware.com/Bug/view.php?id=12322#c27196
 --
 I don't think we should do this.

 If we allow source files from external projects to be added directly to
 the IDE
 representations of the external projects in the containing project, then
 people
 will expect the dependencies to work correctly automatically...

 The dependencies will not work automatically. You will have to
forcefully
 trigger an incremental rebuild of the external project on *any* build of
 the
 containing project, and then hope that its build system appropriately
 picks up
 only the incremental build changes necessary.

 I view this as fragile, and would not like to see it go in CMake unless
it
 can
 be made robust, and shown to work automatically and as developers would
 expect
 in the vast majority of use cases.

 

Re: [CMake] [CMake 0012322]: Ability to add source files to target created with ExternalProject

2011-08-12 Thread David Cole
The typical ExternalProject is a bit of a black-box to the containing
project, and a list of sources is something most users will not
have... That's another reason why I am skeptical as to the usefulness
of this feature to the general ExternalProject consumer.


On Fri, Aug 12, 2011 at 11:24 AM, Yuri Timenkov y...@timenkov.ru wrote:
 Ok, I'll double-check this next monday. That's why I was confused.

 On the second thought if you have a list of sources you can add them as
 dependencies in addition to build rule, then step will be re-run as
 expected. May be it's my case.

 Anyways I need to do some more investigation.

 Best wishes,
 Yuri

 On Aug 12, 2011 6:54 PM, David Cole david.c...@kitware.com wrote:
 You can re-open the issue if you would like to have more discussion there.

 The build step does not always re-run. If you have an update step
 before the build step, then the update step always re-runs, and the
 build step after it, but many external projects do not have an update
 step, or anything else that always forces a build when there's a
 Build Solution executed on the containing project. (If it does, then
 that's a bug, because it's only supposed to re-execute steps that
 *need* to be re-executed.)


 Thanks,
 David


 On Fri, Aug 12, 2011 at 10:46 AM, Yuri Timenkov y...@timenkov.ru wrote:
 Hello David,
 It seems that I can't add notes to closed bug, so I ask you directly.
 I don't quite understand what kind of automatic dependencies you're
 talking
 about.
 If I change file in this way and do build solution cmake will
 automatically launch build for external project. IIRC it always executes
 build when I build solution.
 As I said, for my local purposes I can use modified ExternalProject.cmake
 file, but I thought such feature might be useful for others.

 On Fri, Aug 12, 2011 at 5:24 PM, Mantis Bug Tracker
 man...@public.kitware.com wrote:

 A NOTE has been added to this issue.
 ==
 http://public.kitware.com/Bug/view.php?id=12322
 ==
 Reported By:                Yuri
 Assigned To:                David Cole
 ==
 Project:                    CMake
 Issue ID:                   12322
 Category:                   CMake
 Reproducibility:            always
 Severity:                   tweak
 Priority:                   normal
 Status:                     resolved
 Resolution:                 won't fix
 Fixed in Version:           CMake 2.8.6
 ==
 Date Submitted:             2011-07-08 05:27 EDT
 Last Modified:              2011-08-12 09:24 EDT
 ==
 Summary:                    Ability to add source files to target
 created
 with
 ExternalProject
 Description:
 In my scenario I have part of project which should be built with
 different
 toolset (Main project is built with VC2010, and some legacy libraries
 with
 VC6
 and VS2005).
 Basically nested project contains
 set(Proj_SRCS src1.cpp src2.cpp...)
 add_library(Proj MODULE ${Proj_SRCS})

 So set() command may be moved into separate file which in turn could be
 included
 into main project. So I want to see them there to edit in IDE, but not
 compile.

 The only possibility to add files to custom target - is specify SOURCES
 in
 add_custom_target command (It's impossible to call cmTarget::AddSources
 from
 outside). However, ExternalProject_Add macro doesn't add any sources.

 Moreover, there is a kind of chicken-and-egg problem: all arguments are
 parsed
 and set as property on target. But you can't set property while there is
 no
 target.

 So as quick work-around I made private copy of ExternalProject.cmake and
 pass
 sources as directory property.

 So I'm asking for ideas how to properly implement this feature: modify
 somehow
 parameters parsing in ExternalProject, or may be introduce command which
 allows
 adding new sources to existing targets (I'm not sure if this will work,
 but for
 me it sounds like target_link_libraries command).
 ==

 --
  (0027196) David Cole (manager) - 2011-08-12 09:23
  http://public.kitware.com/Bug/view.php?id=12322#c27196
 --
 I don't think we should do this.

 If we allow source files from external projects to be added directly to
 the IDE
 representations of the external projects in the containing project, then
 people
 will expect the dependencies to work correctly automatically...

 The dependencies will not work automatically. You will have to
 forcefully
 trigger an incremental rebuild of the external project on *any* build of
 the
 containing project, and then hope that its 

Re: [CMake] [CMake 0012322]: Ability to add source files to target created with ExternalProject

2011-08-12 Thread Yuri Timenkov
It is, if you use it for 3rd-party libraries.

But some people (including me :)) may use it to build different parts of
single project with different compilers (I have one library which should be
built with VC6 and the rest of the project with VC2010, but I change code in
each place with same frequency).

In this case it is far from black box. But I completely agree, that this is
discussion about typical usage. I just was very happy when I got chance to
significantly simplify and make even more user-friendly our build procedure
:).

On Fri, Aug 12, 2011 at 7:29 PM, David Cole david.c...@kitware.com wrote:

 The typical ExternalProject is a bit of a black-box to the containing
 project, and a list of sources is something most users will not
 have... That's another reason why I am skeptical as to the usefulness
 of this feature to the general ExternalProject consumer.


 On Fri, Aug 12, 2011 at 11:24 AM, Yuri Timenkov y...@timenkov.ru wrote:
  Ok, I'll double-check this next monday. That's why I was confused.
 
  On the second thought if you have a list of sources you can add them as
  dependencies in addition to build rule, then step will be re-run as
  expected. May be it's my case.
 
  Anyways I need to do some more investigation.
 
  Best wishes,
  Yuri
 
  On Aug 12, 2011 6:54 PM, David Cole david.c...@kitware.com wrote:
  You can re-open the issue if you would like to have more discussion
 there.
 
  The build step does not always re-run. If you have an update step
  before the build step, then the update step always re-runs, and the
  build step after it, but many external projects do not have an update
  step, or anything else that always forces a build when there's a
  Build Solution executed on the containing project. (If it does, then
  that's a bug, because it's only supposed to re-execute steps that
  *need* to be re-executed.)
 
 
  Thanks,
  David
 
 
  On Fri, Aug 12, 2011 at 10:46 AM, Yuri Timenkov y...@timenkov.ru
 wrote:
  Hello David,
  It seems that I can't add notes to closed bug, so I ask you directly.
  I don't quite understand what kind of automatic dependencies you're
  talking
  about.
  If I change file in this way and do build solution cmake will
  automatically launch build for external project. IIRC it always
 executes
  build when I build solution.
  As I said, for my local purposes I can use modified
 ExternalProject.cmake
  file, but I thought such feature might be useful for others.
 
  On Fri, Aug 12, 2011 at 5:24 PM, Mantis Bug Tracker
  man...@public.kitware.com wrote:
 
  A NOTE has been added to this issue.
  ==
  http://public.kitware.com/Bug/view.php?id=12322
  ==
  Reported By:Yuri
  Assigned To:David Cole
  ==
  Project:CMake
  Issue ID:   12322
  Category:   CMake
  Reproducibility:always
  Severity:   tweak
  Priority:   normal
  Status: resolved
  Resolution: won't fix
  Fixed in Version:   CMake 2.8.6
  ==
  Date Submitted: 2011-07-08 05:27 EDT
  Last Modified:  2011-08-12 09:24 EDT
  ==
  Summary:Ability to add source files to target
  created
  with
  ExternalProject
  Description:
  In my scenario I have part of project which should be built with
  different
  toolset (Main project is built with VC2010, and some legacy libraries
  with
  VC6
  and VS2005).
  Basically nested project contains
  set(Proj_SRCS src1.cpp src2.cpp...)
  add_library(Proj MODULE ${Proj_SRCS})
 
  So set() command may be moved into separate file which in turn could
 be
  included
  into main project. So I want to see them there to edit in IDE, but not
  compile.
 
  The only possibility to add files to custom target - is specify
 SOURCES
  in
  add_custom_target command (It's impossible to call
 cmTarget::AddSources
  from
  outside). However, ExternalProject_Add macro doesn't add any sources.
 
  Moreover, there is a kind of chicken-and-egg problem: all arguments
 are
  parsed
  and set as property on target. But you can't set property while there
 is
  no
  target.
 
  So as quick work-around I made private copy of ExternalProject.cmake
 and
  pass
  sources as directory property.
 
  So I'm asking for ideas how to properly implement this feature: modify
  somehow
  parameters parsing in ExternalProject, or may be introduce command
 which
  allows
  adding new sources to existing targets (I'm not sure if this will
 work,
  but for
  me it sounds like target_link_libraries command).
  

[CMake] Fwd: [CMake 0012398]: IF infamous variable/string functionality fails to work with macro arguments

2011-08-12 Thread David Cole
Does anybody here on the list have an opinion one way or the other on
whether it's worth pursuing a fix to this re-opened bug regarding
CMake macro and if command behavior...?

Thanks for any input, either here on the list, or directly in the bug
notes themselves.


Thanks,
David



-- Forwarded message --
From: Mantis Bug Tracker man...@public.kitware.com
Date: Fri, Aug 12, 2011 at 2:49 PM
Subject: [CMake 0012398]: IF infamous variable/string
functionality fails to work with macro arguments
To: david.c...@kitware.com



The following issue has been REOPENED.
==
http://public.kitware.com/Bug/view.php?id=12398
==
Reported By:                freddie
Assigned To:                David Cole
==
Project:                    CMake
Issue ID:                   12398
Category:                   CMake
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     feedback
==
Date Submitted:             2011-08-12 08:13 EDT
Last Modified:              2011-08-12 14:49 EDT
==
Summary:                    IF infamous variable/string functionality fails
to work with macro arguments
Description:
There is a problem with the IF command when it is used directly with macro
arguments. Apparently, they are not considered variables and are used directly
as strings.

However, if their contents can be construed as variables themselves (even though
it is not desired), we have a problem when the only way to perform the test is
to create another explicit variable assigning it to what the macro argument
contains.

The problem doesn't appear to pertain to functions.

Steps to Reproduce:
Please use the attached CMakeLists.txt file with cmake -Wno-dev ..

Additional Information:
It would really be a good idea to create a version of if/elseif/else/endif which
does NOT attempt to treat its arguments as variables, either by creating a new
name for the command or, better yet, by adding a new policy (possibly not
associated with a version yet).

Otherwise, when trying to compare things which might be variables but should not
be treated as such for the purposes of the comparison, one runs into subtle
problems (when checks randomly fail) or has to create a level of indirection,
by setting a new variable just for that.

I am sure you've heard this all before.
==
Relationships       ID      Summary
--
duplicate of        0009590 IF(VARIABLE) doesn't work inside Makro
==

--
 (0027199) freddie (reporter) - 2011-08-12 14:49
 http://public.kitware.com/Bug/view.php?id=12398#c27199
--
Your comparison of macro with preprocessor macros makes sense. If only it worked
that way. In cmake language, ${foo} expands a variable; if ARGV0 is not a
variable, then you must either substitute ARGV0 for what was specified in the
parameter list for the macro, or use a different expansion {#{ARGV0}, for
instance); otherwise, people who can't be called stupid will keep running into
these problems.

However, the analogy stops there; FUNCTION is not equivalent to functions or
methods in C/C++ in the sense that variables are automatically local to the
function, and setting a variable in a different scope is problematic. If I have
a directory-specific variable that I set and append to in multiple places (I'd
call it namespace-specific), I can't use it here because it's hard to say how
many parent-scope levels up it is. So we end up using macros.

And about IF: I am not sure about this worth the effort statement. This
behaviour is quite unusual (I don't know of any other language that does this)
and, as it turns out, extremely inconvenient; forget that, after reading the
manual on IF and MACRO (and the IF epilogue) several times, I still ran into
problems as described in this bug. What about making it impossible to use the
macro arguments with IF completely and calling it a feature? Making it easy to
work with cmake and avoid peculiar bugs is probably more important.

--
 (0027198) David Cole (manager) - 2011-08-12 10:36
 http://public.kitware.com/Bug/view.php?id=12398#c27198
--
You're right... we've heard it before. :-)

It would be possible to change this via a cmake policy, but I'm not sure 

Re: [CMake] Setting MIDL Include path via cmake

2011-08-12 Thread David Cole
I pushed this commit to 'next' just now:

  
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ac22e2a8790e507d7600e0876585424db70f785b

Which makes the VS 7, 8 and 9 generators use include_directories for
midl command lines, to make them consistent with the VS 10 generator.

If nobody objects to this change, and it doesn't cause us any problems
on any of the dashboard tests tonight, then we can put this change
into the upcoming 2.8.6...


Cheers,
David


On Fri, Aug 12, 2011 at 10:27 AM, David Cole david.c...@kitware.com wrote:
 We actually have a test for idl files in the CMake test suite: VSMidl.
 See where it was added in this commit:

  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=13caaa3eb74a11dbf067409ea129321718d34dfe

 However, there does appear to be an inconsistency between Visual
 Studio 9 and earlier generators and Visual Studio 10: the VS10 one
 does add include directories, whereas the VS9 and earlier generators
 do not...

 In 2.8.5, there's another issue, though. If you inspect the property
 pages of an idl file in the GUI, it does not show anything. This is
 related to the fact that we generate full path names for the idl file
 in the vcxproj file, and Visual Studio doesn't display the property
 pages correctly... (Separate issue, but the additional include
 directory actually is there, you can verify with a text editor.)

 So. can you use VS10? If not, it should be fairly simple to add
 the additional include directories to older generators. I'll see if I
 can get to it before the next CMake release. (or at the very least,
 shortly thereafter...)


 Thanks,
 David


 On Fri, Aug 5, 2011 at 12:37 PM, Paul Whelan pwhe...@aer.com wrote:
 It neither shows up in the IDE nor builds with a cannot find include file
 error. The project is kind of big and complex, so I created a quick sample
 that exhibits the same behavior. I included the project directory with
 original visual studio projects and a CMakeLists.txt file I wrote to do the
 same thing. A second directory (IDLSampleBld) contains the results of
 running cmake out of source.

 On 8/5/2011 10:54 AM, David Cole wrote:

 H... I have some old code where I built an ActiveX control that
 included an idl file that does this:

   include_directories(${CMAKE_CURRENT_BINARY_DIR}/\$(IntDir))
   include_directories(${CMAKE_CURRENT_BINARY_DIR}/\$(OutDir))

 I know it used to work, but I haven't built that project in about 4
 years... (I don't think I can simply trivially build it, as some of
 the things that it depends on are no longer actively developed and
 building with today's CMake and Visual Studio versions...)

 I do not know whether the include directories showed up in the VS
 Properties dialog, or if the flags were simply added to the midl
 command line, but I did have it working at one point.

 Either it's gotten broken by something in the interim, or it still
 works even though the VS GUI doesn't reflect reality... Does your
 project fail to build when using two include_directories commands as
 above?

 Is the build error simply a midl or a C++ cannot find include file
 x.h? Or something else?

 Is your project available for me to try? Or can you make a smalll
 simple stand-alone reproduce case?

 If we can't get it working with VS and it's built-in midl handling, we
 can always resort to running midl as a custom command


 HTH,
 David


 On Fri, Aug 5, 2011 at 8:10 AM, Paul Whelanpwhe...@aer.com  wrote:

 No, that just sets the compiler's include path. If you look at visual
 studio's property dialog for a COM dll, the MIDL properties General tab
 contains an Additional include directories entry much like the C++
 general
 tab. However, it isn't getting populated by cmake as best I can tell.

 On 8/4/2011 5:27 PM, David Cole wrote:

 Does calling

   include_directories(${CMAKE_CURRENT_BINARY_DIR})

 before calling add_library work?


 On Thu, Aug 4, 2011 at 4:14 PM, Paul Whelanpwhe...@aer.com    wrote:

 Hi guys,

 I'm new to the mailing list and fairly new to cmake itself, so I hope
 this
 isn't to basic a question to be posting here. Please refer me to the
 appropriate url/forum, etc if it is.

 I have a windows COM project that I'm trying to convert to a cmake
 build.
 The IDL file in that project has includes of header files in it, so I
 need a
 way to set the MIDL compiler's include path from cmake. I don't see an
 obvious variable to set in cmake and the visual studio (2008) project
 that
 it generates comes up with a blank MIDL include path. Any suggestions
 on
 how
 to set that and maybe also where I should be looking for that type of
 info
 if it is readily available?

 Thanks,
 Paul
 ___
 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:
 

Re: [CMake] Sub dependencies?

2011-08-12 Thread Doug
I see.

I've tried this approach and I get the error:
-- Found LIBPNG
CMake Error at CMakeLists.txt:49 (export):
  export given target /usr/lib/libpng.so which is not built by this
  project.


-- Configuring incomplete, errors occurred!

~
Doug.

On Fri, Aug 12, 2011 at 4:57 PM, Michael Wild them...@gmail.com wrote:

 On Fri 12 Aug 2011 10:49:45 AM CEST, Doug wrote:
  I'm sorry if I'm being dumb here, but I fail to see how that helps.
 
  That example is one where foobar depends explicitly on foo and bar.
 
  What if foo depends on bar2?
 
  How do I inherit that dependency from foo in foobar?
 
  _that's_ what I'm looking for.
 
  (If that example somehow explains that, I'm sorry, I can't see it. Can
  you point to a specific point in the page?)
 
  ~
  Doug.
 
  On Fri, Aug 12, 2011 at 2:34 PM, Michael Wild them...@gmail.com
  mailto:them...@gmail.com wrote:
 
  If the projects are independent, you might want to take a look at
 this
  Wiki page:
 
 http://www.cmake.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file
 .
 
  HTH
 
  Michael
 

 And that is what the example is *about*. The FooBar project *exports*
 its targets, along with their dependencies, so that when other projects
 do find_package(FooBar), they will be able to link against the foo
 library without having to know any of the dependencies of it. E.g. the
 project hello might look like this:

 project(hello)
 find_package(FooBar REQUIRED)
 include_directories(${FOOBAR_INCLUDE_DIRS})
 add_executable(hello hello.c)
 target_link_libraries(hello ${FOOBAR_LIBRARIES})


 Michael

___
Powered by www.kitware.com

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

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

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