Re: [CMake] fixup_bundle on Windows : issue with multiple exe applications

2016-03-19 Thread David Cole via CMake
A multiple folder approach will be very difficult.

The basic assumptions are:

- On Windows, the "one executable path" is the destination path to
which to copy all of the DLLs that need to be copied, so they all end
up in the same directory. (You'd have to have multiple copies in
multiple locations, at which point, it probably makes sense to have
each of your exes set up to use a common shared DLL folder instead.)

- On Mac, the "one executable path" is used to fixup libraries to use
"@executable_path" relative references, so it's different for each
different exe path. If two executables depend on the same library, but
are in different places, but the library is only in one place, then
you cannot use an "@executable_path" relative reference to find the
library.

If all your executables are not in the same directory with each other,
then BundleUtilities will probably not make you a happy camper.


HTH,
David C.



On Fri, Mar 4, 2016 at 9:30 AM, Benjamin Ballet  wrote:
> FYI verifying_app failed with main.exe failed (3.4.3) because toptool
> depends on topdool.dll located only in toptoolfolder. The workaround is to
> include toptoolfolder in libs folder for fixup_bundle(main.exe...)
>
> David your answer was helpful to me. I know it's an expected behavior.
>
> Would a patch handling such multiple folder application been accepted ? I
> may try to work on it, since I either have to work on the workarounds or a
> nice improvment.
>
>
> 2016-03-04 14:15 GMT+01:00 Benjamin Ballet :
>>
>> Indeed I was lucky : It worked with 3.3.1 but not anymore with 3.4.3..
>> I've got a strang bug with one .NET dll generated near a tool :
>>
>> CMake Error at C:/Program Files
>> (x86)/CMake/share/cmake-3.4/Modules/GetPrerequisites.cmake:798 (message):
>> 106>C:/Program Files (x86)/Microsoft Visual Studio
>> 12.0/VC/bin/dumpbin.exe
>> 106>failed: 1181
>>
>> I'm digging
>>
>>
>>
>> 2016-03-03 21:02 GMT+01:00 David Cole :
>>>
>>> It was designed originally with the assumption that all the
>>> executables in a bundle are in the same directory. If you violate that
>>> assumption, I don't think you can count on it to do the right thing
>>> 100% of the time.
>>>
>>> If it works for you calling it multiple times with deepest first, then
>>> maybe you can get lucky...
>>>
>>> I would definitely dig into it and understand exactly what it's doing,
>>> though, if you want to make sure it's going to continue working for
>>> your scenario.
>>>
>>>
>>> HTH,
>>> David C.
>>>
>>>
>>> On Thu, Mar 3, 2016 at 1:43 PM, Benjamin Ballet 
>>> wrote:
>>> > Hello
>>> >
>>> > I'd like to discuss a problem I encountered today with the very useful
>>> > module BundleUtilities
>>> >
>>> > We have an application on Windows with one main exe file in the top
>>> > folder
>>> > and a few other exe in subdirectories, like that :
>>> >
>>> > applicationfolder  \
>>> >   | main.exe
>>> >   | toolsfolder \
>>> > | supertoolfolder \
>>> > |
>>> > supertool.exe
>>> > | toptoolfolder \
>>> >  |
>>> > toptool.exe
>>> >
>>> > But if I simply call
>>> > fixup_bundle("applicationfolder/main.exe" plugins libs)
>>> >
>>> > the verify_app will fails.
>>> >
>>> > Just a reminder that there is no rpath on Windows : dll must be either
>>> > in
>>> > PATH or in the same folder or in the working directory.
>>> >
>>> > We expected fixup_bundle to copy the required dll for main.exe in
>>> > applicationfolder, the required dll for supertool.exe in
>>> > supertoolfolder and
>>> > the required dll for toptool.exe in toptoolfolder, but it acually
>>> > didn't
>>> > copied anything in supertoolfolder and toptoolfolder.
>>> >
>>> > I worked around this issue by calling fixup_bundle multiple time with
>>> > the
>>> > following order : (the deepest exes first)
>>> >
>>> >
>>> > fixup_bundle("applicationfolder/toolsfolder/supertoolfolder/supertool.exe"
>>> > plugins libs)
>>> > fixup_bundle("applicationfolder/toolsfolder/toptoolfolder/toptool.exe"
>>> > plugins libs)
>>> > fixup_bundle("applicationfolder/main.exe" plugins libs)
>>> >
>>> >
>>> > --
>>> > Benjamin BALLET
>>> > Ingénieur R
>>> >
>>> > ACTIVISU
>>> > 19, rue Klock - 92110 Clichy
>>> >> Standard Tél :  01 44 69 37 37
>>> >> www.activisu.com
>>> >
>>> > --
>>> >
>>> > Powered by www.kitware.com
>>> >
>>> > Please keep messages on-topic and check the CMake FAQ at:
>>> > http://www.cmake.org/Wiki/CMake_FAQ
>>> >
>>> > Kitware offers various services to support the CMake community. For
>>> > more
>>> > information on each offering, please visit:
>>> >
>>> > CMake Support: http://cmake.org/cmake/help/support.html
>>> > CMake Consulting: http://cmake.org/cmake/help/consulting.html
>>> 

Re: [CMake] fixup_bundle on Windows : issue with multiple exe applications

2016-03-04 Thread Benjamin Ballet
FYI verifying_app failed with main.exe failed (3.4.3) because toptool
depends on topdool.dll located only in toptoolfolder. The workaround is to
include toptoolfolder in libs folder for fixup_bundle(main.exe...)

David your answer was helpful to me. I know it's an expected behavior.

Would a patch handling such multiple folder application been accepted ? I
may try to work on it, since I either have to work on the workarounds or a
nice improvment.


2016-03-04 14:15 GMT+01:00 Benjamin Ballet :

> Indeed I was lucky : It worked with 3.3.1 but not anymore with 3.4.3..
> I've got a strang bug with one .NET dll generated near a tool :
>
> CMake Error at C:/Program Files
> (x86)/CMake/share/cmake-3.4/Modules/GetPrerequisites.cmake:798 (message):
> 106>C:/Program Files (x86)/Microsoft Visual Studio
> 12.0/VC/bin/dumpbin.exe
> 106>failed: 1181
>
> I'm digging
>
>
>
> 2016-03-03 21:02 GMT+01:00 David Cole :
>
>> It was designed originally with the assumption that all the
>> executables in a bundle are in the same directory. If you violate that
>> assumption, I don't think you can count on it to do the right thing
>> 100% of the time.
>>
>> If it works for you calling it multiple times with deepest first, then
>> maybe you can get lucky...
>>
>> I would definitely dig into it and understand exactly what it's doing,
>> though, if you want to make sure it's going to continue working for
>> your scenario.
>>
>>
>> HTH,
>> David C.
>>
>>
>> On Thu, Mar 3, 2016 at 1:43 PM, Benjamin Ballet 
>> wrote:
>> > Hello
>> >
>> > I'd like to discuss a problem I encountered today with the very useful
>> > module BundleUtilities
>> >
>> > We have an application on Windows with one main exe file in the top
>> folder
>> > and a few other exe in subdirectories, like that :
>> >
>> > applicationfolder  \
>> >   | main.exe
>> >   | toolsfolder \
>> > | supertoolfolder \
>> > |
>> > supertool.exe
>> > | toptoolfolder \
>> >  |
>> > toptool.exe
>> >
>> > But if I simply call
>> > fixup_bundle("applicationfolder/main.exe" plugins libs)
>> >
>> > the verify_app will fails.
>> >
>> > Just a reminder that there is no rpath on Windows : dll must be either
>> in
>> > PATH or in the same folder or in the working directory.
>> >
>> > We expected fixup_bundle to copy the required dll for main.exe in
>> > applicationfolder, the required dll for supertool.exe in
>> supertoolfolder and
>> > the required dll for toptool.exe in toptoolfolder, but it acually didn't
>> > copied anything in supertoolfolder and toptoolfolder.
>> >
>> > I worked around this issue by calling fixup_bundle multiple time with
>> the
>> > following order : (the deepest exes first)
>> >
>> >
>> fixup_bundle("applicationfolder/toolsfolder/supertoolfolder/supertool.exe"
>> > plugins libs)
>> > fixup_bundle("applicationfolder/toolsfolder/toptoolfolder/toptool.exe"
>> > plugins libs)
>> > fixup_bundle("applicationfolder/main.exe" plugins libs)
>> >
>> >
>> > --
>> > Benjamin BALLET
>> > Ingénieur R
>> >
>> > ACTIVISU
>> > 19, rue Klock - 92110 Clichy
>> >> Standard Tél :  01 44 69 37 37
>> >> www.activisu.com
>> >
>> > --
>> >
>> > Powered by www.kitware.com
>> >
>> > Please keep messages on-topic and check the CMake FAQ at:
>> > http://www.cmake.org/Wiki/CMake_FAQ
>> >
>> > Kitware offers various services to support the CMake community. For more
>> > information on each offering, please visit:
>> >
>> > CMake Support: http://cmake.org/cmake/help/support.html
>> > CMake Consulting: http://cmake.org/cmake/help/consulting.html
>> > CMake Training Courses: http://cmake.org/cmake/help/training.html
>> >
>> > Visit other Kitware open-source projects at
>> > http://www.kitware.com/opensource/opensource.html
>> >
>> > Follow this link to subscribe/unsubscribe:
>> > http://public.kitware.com/mailman/listinfo/cmake
>>
>
>
>
> --
> *Benjamin BALLET*
> Ingénieur R
>
> *ACTIVISU*
> 19, rue Klock - 92110 Clichy
> *> Standard Tél* :  01 44 69 37 37
> *>* www.activisu.com
>



-- 
*Benjamin BALLET*
Ingénieur R

*ACTIVISU*
19, rue Klock - 92110 Clichy
*> Standard Tél* :  01 44 69 37 37
*>* www.activisu.com
-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:

Re: [CMake] fixup_bundle on Windows : issue with multiple exe applications

2016-03-04 Thread Benjamin Ballet
Indeed I was lucky : It worked with 3.3.1 but not anymore with 3.4.3..
I've got a strang bug with one .NET dll generated near a tool :

CMake Error at C:/Program Files
(x86)/CMake/share/cmake-3.4/Modules/GetPrerequisites.cmake:798 (message):
106>C:/Program Files (x86)/Microsoft Visual Studio
12.0/VC/bin/dumpbin.exe
106>failed: 1181

I'm digging



2016-03-03 21:02 GMT+01:00 David Cole :

> It was designed originally with the assumption that all the
> executables in a bundle are in the same directory. If you violate that
> assumption, I don't think you can count on it to do the right thing
> 100% of the time.
>
> If it works for you calling it multiple times with deepest first, then
> maybe you can get lucky...
>
> I would definitely dig into it and understand exactly what it's doing,
> though, if you want to make sure it's going to continue working for
> your scenario.
>
>
> HTH,
> David C.
>
>
> On Thu, Mar 3, 2016 at 1:43 PM, Benjamin Ballet 
> wrote:
> > Hello
> >
> > I'd like to discuss a problem I encountered today with the very useful
> > module BundleUtilities
> >
> > We have an application on Windows with one main exe file in the top
> folder
> > and a few other exe in subdirectories, like that :
> >
> > applicationfolder  \
> >   | main.exe
> >   | toolsfolder \
> > | supertoolfolder \
> > |
> > supertool.exe
> > | toptoolfolder \
> >  |
> > toptool.exe
> >
> > But if I simply call
> > fixup_bundle("applicationfolder/main.exe" plugins libs)
> >
> > the verify_app will fails.
> >
> > Just a reminder that there is no rpath on Windows : dll must be either in
> > PATH or in the same folder or in the working directory.
> >
> > We expected fixup_bundle to copy the required dll for main.exe in
> > applicationfolder, the required dll for supertool.exe in supertoolfolder
> and
> > the required dll for toptool.exe in toptoolfolder, but it acually didn't
> > copied anything in supertoolfolder and toptoolfolder.
> >
> > I worked around this issue by calling fixup_bundle multiple time with the
> > following order : (the deepest exes first)
> >
> >
> fixup_bundle("applicationfolder/toolsfolder/supertoolfolder/supertool.exe"
> > plugins libs)
> > fixup_bundle("applicationfolder/toolsfolder/toptoolfolder/toptool.exe"
> > plugins libs)
> > fixup_bundle("applicationfolder/main.exe" plugins libs)
> >
> >
> > --
> > Benjamin BALLET
> > Ingénieur R
> >
> > ACTIVISU
> > 19, rue Klock - 92110 Clichy
> >> Standard Tél :  01 44 69 37 37
> >> www.activisu.com
> >
> > --
> >
> > Powered by www.kitware.com
> >
> > Please keep messages on-topic and check the CMake FAQ at:
> > http://www.cmake.org/Wiki/CMake_FAQ
> >
> > Kitware offers various services to support the CMake community. For more
> > information on each offering, please visit:
> >
> > CMake Support: http://cmake.org/cmake/help/support.html
> > CMake Consulting: http://cmake.org/cmake/help/consulting.html
> > CMake Training Courses: http://cmake.org/cmake/help/training.html
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> >
> > Follow this link to subscribe/unsubscribe:
> > http://public.kitware.com/mailman/listinfo/cmake
>



-- 
*Benjamin BALLET*
Ingénieur R

*ACTIVISU*
19, rue Klock - 92110 Clichy
*> Standard Tél* :  01 44 69 37 37
*>* www.activisu.com
-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] fixup_bundle on Windows : issue with multiple exe applications

2016-03-03 Thread David Cole via CMake
It was designed originally with the assumption that all the
executables in a bundle are in the same directory. If you violate that
assumption, I don't think you can count on it to do the right thing
100% of the time.

If it works for you calling it multiple times with deepest first, then
maybe you can get lucky...

I would definitely dig into it and understand exactly what it's doing,
though, if you want to make sure it's going to continue working for
your scenario.


HTH,
David C.


On Thu, Mar 3, 2016 at 1:43 PM, Benjamin Ballet  wrote:
> Hello
>
> I'd like to discuss a problem I encountered today with the very useful
> module BundleUtilities
>
> We have an application on Windows with one main exe file in the top folder
> and a few other exe in subdirectories, like that :
>
> applicationfolder  \
>   | main.exe
>   | toolsfolder \
> | supertoolfolder \
> |
> supertool.exe
> | toptoolfolder \
>  |
> toptool.exe
>
> But if I simply call
> fixup_bundle("applicationfolder/main.exe" plugins libs)
>
> the verify_app will fails.
>
> Just a reminder that there is no rpath on Windows : dll must be either in
> PATH or in the same folder or in the working directory.
>
> We expected fixup_bundle to copy the required dll for main.exe in
> applicationfolder, the required dll for supertool.exe in supertoolfolder and
> the required dll for toptool.exe in toptoolfolder, but it acually didn't
> copied anything in supertoolfolder and toptoolfolder.
>
> I worked around this issue by calling fixup_bundle multiple time with the
> following order : (the deepest exes first)
>
> fixup_bundle("applicationfolder/toolsfolder/supertoolfolder/supertool.exe"
> plugins libs)
> fixup_bundle("applicationfolder/toolsfolder/toptoolfolder/toptool.exe"
> plugins libs)
> fixup_bundle("applicationfolder/main.exe" plugins libs)
>
>
> --
> Benjamin BALLET
> Ingénieur R
>
> ACTIVISU
> 19, rue Klock - 92110 Clichy
>> Standard Tél :  01 44 69 37 37
>> www.activisu.com
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

[CMake] fixup_bundle on Windows : issue with multiple exe applications

2016-03-03 Thread Benjamin Ballet
Hello

I'd like to discuss a problem I encountered today with the very useful
module BundleUtilities

We have an application on Windows with one main exe file in the top folder
and a few other exe in subdirectories, like that :

applicationfolder  \
  | main.exe
  | toolsfolder \
| supertoolfolder \
|
supertool.exe
| toptoolfolder \
 |
toptool.exe

But if I simply call
fixup_bundle("applicationfolder/main.exe" plugins libs)

the verify_app will fails.

Just a reminder that there is no rpath on Windows : dll must be either in
PATH or in the same folder or in the working directory.

We expected fixup_bundle to copy the required dll for main.exe in
applicationfolder, the required dll for supertool.exe in supertoolfolder
and  the required dll for toptool.exe in toptoolfolder, but it acually
didn't copied anything in supertoolfolder and toptoolfolder.

I worked around this issue by calling fixup_bundle multiple time with the
following order : (the deepest exes first)

fixup_bundle("applicationfolder/toolsfolder/supertoolfolder/supertool.exe"
plugins libs)
fixup_bundle("applicationfolder/toolsfolder/toptoolfolder/toptool.exe"
plugins libs)
fixup_bundle("applicationfolder/main.exe" plugins libs)


-- 
*Benjamin BALLET*
Ingénieur R

*ACTIVISU*
19, rue Klock - 92110 Clichy
*> Standard Tél* :  01 44 69 37 37
*>* www.activisu.com
-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake