Re: [CMake] Adding external executable

2012-11-09 Thread Manoj Vaghela
Hi Eric, David,

Thanks for your valuable suggestions. I am right now copying Qt libraries
(libQtCore, libQtGui, libQtOpenGL) manually using INSTALL( FILE ... )
command.

I installed latest version of CMake which enables DeployQt4 facility. It
will be very helpful if you give a small 4-5 lines of example which copies
the required Qt libraries by default to my install directory.

I looked at the example link Eric provided, but could not succeed
implementing it.

Thanks to both of you.

--
regards,
Manoj

On Fri, Nov 9, 2012 at 6:10 PM, David Cole  wrote:

> You should really take Eric's previous advice if you're building a Qt
> application:
>
> "A good starting point may be Mike's blog entry on DeployQt4 as well:
> http://mikemcquaid.com/2012/01/04/deploying-qt-applications-with-deployqt4/
> "
>
>
> On Fri, Nov 9, 2012 at 4:25 AM, Manoj Vaghela 
> wrote:
> > Dear Eric,
> >
> > Thank you very much for your quick reply.
> >
> > INSTALL( PROGRAMS ... ) worked fine.
> > If I am using this, I also do not need to specify any IMPORTED related
> > stuff.
> >
> > As my understanding now, the following lines are sufficient for creating
> > pack.
> >
> > INSTALL( TARGETS ${EXECUTABLE_NAME} DESTINATION ${INSTALL_DIR} ) // For
> > Executable from the current CMakeLists.txt
> >
> > INSTALL( PROGRAMS ${EXTERNAL_EXE} DESTINATION ${INSTALL_DIR} ) // For
> > including external executable in the archive
> >
> > INSTALL( FILES LIB1 LIB2 DESTINATION ${INSTALL_DIR} ) // For libraries
> > (current or external) or any other files
> >
> > A few clarifications required:
> >
> > For an application using Qt libraries, should I pack the related Qt
> > libraries (QtCore, QtGui, QtOpenGL) ?? or not ?? If I am giving this to
> > somebody, I should include them or ask them to install on their machine ?
> >
> > Also, what is the preferred path or tree for installing package? When
> RPM is
> > installed, will it automatically be included in the $PATH or I have to
> do it
> > someway?
> >
> > Thanks once again.
> >
> > --
> > regards,
> > Manoj
> >
> > On Fri, Nov 9, 2012 at 2:24 PM, Eric Noulard 
> wrote:
> >>
> >> 2012/11/9 Manoj Vaghela :
> >> > Dear Eric,
> >> >
> >> > Thanks for your reply.
> >> >
> >> > When I am using INSTALL (FILES... ) for adding external executable to
> my
> >> > CMakeLists.txt file, it shows the executable file in the RPM archive.
> >> > But
> >> > it's execute permission is lost. What should I have to do for that?
> >> >
> >> > Also, ADD_EXECUTABLE( ... IMPORTED) did not work for me. I added this
> >> > line
> >> > but when archive is created, it did not include my executable in it.
> >>
> >> See my comment below:
> >>
> >> >
> >> > This is sample of my CMakeLists.txt
> >> > ---
> >> >
> >> > SET( CPACK_GENERATOR "RPM" )
> >> >
> >> > # MAIN EXE
> >> > SET( MAIN_EXE myExe)
> >> > ADD_EXECUTABLE(${MAIN_EXE} SOME_SOURCE_FILES )
> >> > SET( INSTALL_DIR "$ENV{HOME}/MANOJ" )
> >> > INSTALL( TARGETS ${MAIN_EXEC} DESTINATION ${INSTALL_DIR} )
> >> >
> >> > # EXTERNAL EXE
> >> > SET( EXTERNAL_EXE "/home/manoj/EXTERNAL/a.out.exe" )
> >> > SET( IMPORTED_LOCATION ${EXTERNAL_EXE} )
> >> > ADD_EXECUTABLE( ${EXTERNAL_EXE} IMPORTED) // This does not pack the
> >> > executable
> >>
> >> Once the external executable is imported as a TARGET
> >> you have to install it:
> >> INSTALL( TARGETS  ${EXTERNAL_EXE}  DESTINATION ${INSTALL_DIR} )
> >>
> >> >
> >> > #INSTALL( FILES ${EXTERNAL_EXE} DESTINATION ${INSTALL_DIR}) // This
> >> > packs,
> >> > but permissions lost
> >>
> >> My mistake for executable you should be using
> >> install(PROGRAMS files... DESTINATION 
> >>  [PERMISSIONS permissions...]
> >>  [CONFIGURATIONS [Debug|Release|...]]
> >>  [COMPONENT ]
> >>  [RENAME ] [OPTIONAL])
> >>
> >> signature.
> >> --
> >> Erk
> >> Le gouvernement représentatif n'est pas la démocratie --
> >> http://www.le-message.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] cpack source RPM not setting install path

2012-11-09 Thread Ben Levine

It presents a make package_source option.  And using this does create a
(mostly) reasonable spec file.  I'm actually just looking to deploy
source code via this method rather then create a "true" source RPM.

Ben

Ben Levine
Belvedere Trading
(312)893-3760 #253

On 11/09/2012 05:05 PM, Eric Noulard wrote:

2012/11/9 Ben Levine :

I'm trying to create a source RPM that will install source to a given
path.  Regardless of what parameters I set for CPACK I  end up with an
RPM that installs the source in "/".  If I create a binary RPM it
respects the path set in the CPACK_PACKAGING_INSTALL_PREFIX variable.
It seems that no
  combination of settings will cause the source RPM to install into any
path other then /.  If I look at the spec file it looks like the Prefix:
is set, but the entire files section appears to have been set with
absolute paths.

How do you build a Source RPM with CPack?
CPack RPM is not meant to build source RPM.

In fact CPack does not really knows about "Source" at all.


How can I tell cpack to use a specific prefix for a source RPM?  (It
would be fine if it built the RPM as non-relocatable as long as the path
was set).

The baseline is CPack is not meant to build Source RPM, it can build
source "bare archive" like TGZ, ZIP and the like by "packaging" the source
directory but it cannot build source RPM nor DEB.

How do you do to build source RPM with CPack?





Confidentiality Notice
The information transmitted in this electronic mail (e-mail) is the property of 
Belvedere Trading LLC. This e-mail is intended only for the person or entity to 
which it is addressed and may contain material that is confidential, privileged 
or otherwise protected by law. Any review, retention, retransmission, 
dissemination or other use of, or taking any action in reliance upon, this 
information by persons or entities other than the intended recipient is 
STRICTLY PROHIBITED. If you received this e-mail in error, please alert the 
sender by reply e-mail and then delete this e-mail and any attachments in their 
entirety, whether in electronic or hard copy format.

All messages sent to and from this e-mail address may be monitored as permitted 
by applicable law and regulations to ensure compliance with our internal 
policies and to protect our business. Emails are not secure and cannot be 
guaranteed to be error free as they can be intercepted, amended, lost or 
destroyed, or contain viruses. You are deemed to have accepted these risks if 
you communicate with us by email.
--

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] cpack source RPM not setting install path

2012-11-09 Thread Eric Noulard
2012/11/9 Ben Levine :
> I'm trying to create a source RPM that will install source to a given
> path.  Regardless of what parameters I set for CPACK I  end up with an
> RPM that installs the source in "/".  If I create a binary RPM it
> respects the path set in the CPACK_PACKAGING_INSTALL_PREFIX variable.
> It seems that no
>  combination of settings will cause the source RPM to install into any
> path other then /.  If I look at the spec file it looks like the Prefix:
> is set, but the entire files section appears to have been set with
> absolute paths.

How do you build a Source RPM with CPack?
CPack RPM is not meant to build source RPM.

In fact CPack does not really knows about "Source" at all.

> How can I tell cpack to use a specific prefix for a source RPM?  (It
> would be fine if it built the RPM as non-relocatable as long as the path
> was set).

The baseline is CPack is not meant to build Source RPM, it can build
source "bare archive" like TGZ, ZIP and the like by "packaging" the source
directory but it cannot build source RPM nor DEB.

How do you do to build source RPM with CPack?
-- 
Erk
Le gouvernement représentatif n'est pas la démocratie --
http://www.le-message.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


[CMake] cpack source RPM not setting install path

2012-11-09 Thread Ben Levine

I'm trying to create a source RPM that will install source to a given
path.  Regardless of what parameters I set for CPACK I  end up with an
RPM that installs the source in "/".  If I create a binary RPM it
respects the path set in the CPACK_PACKAGING_INSTALL_PREFIX variable.
It seems that no
 combination of settings will cause the source RPM to install into any
path other then /.  If I look at the spec file it looks like the Prefix:
is set, but the entire files section appears to have been set with
absolute paths.

How can I tell cpack to use a specific prefix for a source RPM?  (It
would be fine if it built the RPM as non-relocatable as long as the path
was set).

Any help would be appreciated,

Ben


--
Ben Levine
Belvedere Trading




Confidentiality Notice
The information transmitted in this electronic mail (e-mail) is the property of 
Belvedere Trading LLC. This e-mail is intended only for the person or entity to 
which it is addressed and may contain material that is confidential, privileged 
or otherwise protected by law. Any review, retention, retransmission, 
dissemination or other use of, or taking any action in reliance upon, this 
information by persons or entities other than the intended recipient is 
STRICTLY PROHIBITED. If you received this e-mail in error, please alert the 
sender by reply e-mail and then delete this e-mail and any attachments in their 
entirety, whether in electronic or hard copy format.

All messages sent to and from this e-mail address may be monitored as permitted 
by applicable law and regulations to ensure compliance with our internal 
policies and to protect our business. Emails are not secure and cannot be 
guaranteed to be error free as they can be intercepted, amended, lost or 
destroyed, or contain viruses. You are deemed to have accepted these risks if 
you communicate with us by email.
--

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] [PATCH] Optionally skip link dependencies on shared library files

2012-11-09 Thread Leif Walsh
D'oh!  Sorry I dropped this ball, thanks again, this is the most helpful
patch ever.

Brad King  writes:

> On 10/26/2012 11:22 AM, Leif Walsh wrote:
>> On Oct 26, 2012, at 11:13, Brad King  wrote:
>> 
>>> On 10/26/2012 10:39 AM, Leif Walsh wrote:
 Sure thing. Can you let me know where to find an example test? I'll 
 pattern match one over the weekend.
>>>
>>> Most CMake tests just verify that binaries build correctly.
>>> The "Tests/BuildDepends" test is the only one that actually
>>> tests rebuild behavior.  It has custom commands to build a
>>> sub-project in its Project subdirectory multiple times while
>>> making modifications in between.
>>>
>>> You'll have to modify the inner test project to add a shared
>>> library and an executable that links to it.  Set the new
>>> property on the executable only.  After the first build,
>>> verify that the executable's time is newer than the library
>>> time.  Between builds, modify a the shared library source
>>> (which of course will have to be in the build tree to avoid
>>> modifying CMake's source tree).  After the second build
>>> verify that the library is newer than the executable.
>>>
>>> Checking the file times is probably most easily done as a
>>> custom target on the inner project that depends on the
>>> executable.  Its COMMAND should run a cmake script and
>>> pass -Dexe=$ -Dlib=$ to
>>> it.  The script can compare the ${lib} and ${exe} file
>>> times with if(... FILE_IS_NEWER ...).
>>
>> Sounds good, I'll send a patch soon. 
>
> I finally had time to add this test myself:
>
>  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=306796e8
>
> -Brad


-- 
Cheers,
Leif
--

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] [PATCH] Optionally skip link dependencies on shared library files

2012-11-09 Thread Brad King
On 10/26/2012 11:22 AM, Leif Walsh wrote:
> On Oct 26, 2012, at 11:13, Brad King  wrote:
> 
>> On 10/26/2012 10:39 AM, Leif Walsh wrote:
>>> Sure thing. Can you let me know where to find an example test? I'll pattern 
>>> match one over the weekend.
>>
>> Most CMake tests just verify that binaries build correctly.
>> The "Tests/BuildDepends" test is the only one that actually
>> tests rebuild behavior.  It has custom commands to build a
>> sub-project in its Project subdirectory multiple times while
>> making modifications in between.
>>
>> You'll have to modify the inner test project to add a shared
>> library and an executable that links to it.  Set the new
>> property on the executable only.  After the first build,
>> verify that the executable's time is newer than the library
>> time.  Between builds, modify a the shared library source
>> (which of course will have to be in the build tree to avoid
>> modifying CMake's source tree).  After the second build
>> verify that the library is newer than the executable.
>>
>> Checking the file times is probably most easily done as a
>> custom target on the inner project that depends on the
>> executable.  Its COMMAND should run a cmake script and
>> pass -Dexe=$ -Dlib=$ to
>> it.  The script can compare the ${lib} and ${exe} file
>> times with if(... FILE_IS_NEWER ...).
>
> Sounds good, I'll send a patch soon. 

I finally had time to add this test myself:

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

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

2012-11-09 Thread Glenn Coombs
http://www.cmake.org/Bug/view.php?id=12437 (do not set default stacksize of
10MB for Visual Studio)

--
Glenn
--

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] Adding external executable

2012-11-09 Thread David Cole
You should really take Eric's previous advice if you're building a Qt
application:

"A good starting point may be Mike's blog entry on DeployQt4 as well:
http://mikemcquaid.com/2012/01/04/deploying-qt-applications-with-deployqt4/";


On Fri, Nov 9, 2012 at 4:25 AM, Manoj Vaghela  wrote:
> Dear Eric,
>
> Thank you very much for your quick reply.
>
> INSTALL( PROGRAMS ... ) worked fine.
> If I am using this, I also do not need to specify any IMPORTED related
> stuff.
>
> As my understanding now, the following lines are sufficient for creating
> pack.
>
> INSTALL( TARGETS ${EXECUTABLE_NAME} DESTINATION ${INSTALL_DIR} ) // For
> Executable from the current CMakeLists.txt
>
> INSTALL( PROGRAMS ${EXTERNAL_EXE} DESTINATION ${INSTALL_DIR} ) // For
> including external executable in the archive
>
> INSTALL( FILES LIB1 LIB2 DESTINATION ${INSTALL_DIR} ) // For libraries
> (current or external) or any other files
>
> A few clarifications required:
>
> For an application using Qt libraries, should I pack the related Qt
> libraries (QtCore, QtGui, QtOpenGL) ?? or not ?? If I am giving this to
> somebody, I should include them or ask them to install on their machine ?
>
> Also, what is the preferred path or tree for installing package? When RPM is
> installed, will it automatically be included in the $PATH or I have to do it
> someway?
>
> Thanks once again.
>
> --
> regards,
> Manoj
>
> On Fri, Nov 9, 2012 at 2:24 PM, Eric Noulard  wrote:
>>
>> 2012/11/9 Manoj Vaghela :
>> > Dear Eric,
>> >
>> > Thanks for your reply.
>> >
>> > When I am using INSTALL (FILES... ) for adding external executable to my
>> > CMakeLists.txt file, it shows the executable file in the RPM archive.
>> > But
>> > it's execute permission is lost. What should I have to do for that?
>> >
>> > Also, ADD_EXECUTABLE( ... IMPORTED) did not work for me. I added this
>> > line
>> > but when archive is created, it did not include my executable in it.
>>
>> See my comment below:
>>
>> >
>> > This is sample of my CMakeLists.txt
>> > ---
>> >
>> > SET( CPACK_GENERATOR "RPM" )
>> >
>> > # MAIN EXE
>> > SET( MAIN_EXE myExe)
>> > ADD_EXECUTABLE(${MAIN_EXE} SOME_SOURCE_FILES )
>> > SET( INSTALL_DIR "$ENV{HOME}/MANOJ" )
>> > INSTALL( TARGETS ${MAIN_EXEC} DESTINATION ${INSTALL_DIR} )
>> >
>> > # EXTERNAL EXE
>> > SET( EXTERNAL_EXE "/home/manoj/EXTERNAL/a.out.exe" )
>> > SET( IMPORTED_LOCATION ${EXTERNAL_EXE} )
>> > ADD_EXECUTABLE( ${EXTERNAL_EXE} IMPORTED) // This does not pack the
>> > executable
>>
>> Once the external executable is imported as a TARGET
>> you have to install it:
>> INSTALL( TARGETS  ${EXTERNAL_EXE}  DESTINATION ${INSTALL_DIR} )
>>
>> >
>> > #INSTALL( FILES ${EXTERNAL_EXE} DESTINATION ${INSTALL_DIR}) // This
>> > packs,
>> > but permissions lost
>>
>> My mistake for executable you should be using
>> install(PROGRAMS files... DESTINATION 
>>  [PERMISSIONS permissions...]
>>  [CONFIGURATIONS [Debug|Release|...]]
>>  [COMPONENT ]
>>  [RENAME ] [OPTIONAL])
>>
>> signature.
>> --
>> Erk
>> Le gouvernement représentatif n'est pas la démocratie --
>> http://www.le-message.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] Adding external executable

2012-11-09 Thread Manoj Vaghela
Dear Eric,

Thank you very much for your quick reply.

INSTALL( PROGRAMS ... ) worked fine.
If I am using this, I also do not need to specify any IMPORTED related
stuff.

As my understanding now, the following lines are sufficient for creating
pack.

INSTALL( TARGETS ${EXECUTABLE_NAME} DESTINATION ${INSTALL_DIR} ) // For
Executable from the current CMakeLists.txt

INSTALL( PROGRAMS ${EXTERNAL_EXE} DESTINATION ${INSTALL_DIR} ) // For
including external executable in the archive

INSTALL( FILES LIB1 LIB2 DESTINATION ${INSTALL_DIR} ) // For libraries
(current or external) or any other files

A few clarifications required:

For an application using Qt libraries, should I pack the related Qt
libraries (QtCore, QtGui, QtOpenGL) ?? or not ?? If I am giving this to
somebody, I should include them or ask them to install on their machine ?

Also, what is the preferred path or tree for installing package? When RPM
is installed, will it automatically be included in the $PATH or I have to
do it someway?

Thanks once again.

--
regards,
Manoj

On Fri, Nov 9, 2012 at 2:24 PM, Eric Noulard  wrote:

> 2012/11/9 Manoj Vaghela :
> > Dear Eric,
> >
> > Thanks for your reply.
> >
> > When I am using INSTALL (FILES... ) for adding external executable to my
> > CMakeLists.txt file, it shows the executable file in the RPM archive. But
> > it's execute permission is lost. What should I have to do for that?
> >
> > Also, ADD_EXECUTABLE( ... IMPORTED) did not work for me. I added this
> line
> > but when archive is created, it did not include my executable in it.
>
> See my comment below:
>
> >
> > This is sample of my CMakeLists.txt
> > ---
> >
> > SET( CPACK_GENERATOR "RPM" )
> >
> > # MAIN EXE
> > SET( MAIN_EXE myExe)
> > ADD_EXECUTABLE(${MAIN_EXE} SOME_SOURCE_FILES )
> > SET( INSTALL_DIR "$ENV{HOME}/MANOJ" )
> > INSTALL( TARGETS ${MAIN_EXEC} DESTINATION ${INSTALL_DIR} )
> >
> > # EXTERNAL EXE
> > SET( EXTERNAL_EXE "/home/manoj/EXTERNAL/a.out.exe" )
> > SET( IMPORTED_LOCATION ${EXTERNAL_EXE} )
> > ADD_EXECUTABLE( ${EXTERNAL_EXE} IMPORTED) // This does not pack the
> > executable
>
> Once the external executable is imported as a TARGET
> you have to install it:
> INSTALL( TARGETS  ${EXTERNAL_EXE}  DESTINATION ${INSTALL_DIR} )
>
> >
> > #INSTALL( FILES ${EXTERNAL_EXE} DESTINATION ${INSTALL_DIR}) // This
> packs,
> > but permissions lost
>
> My mistake for executable you should be using
> install(PROGRAMS files... DESTINATION 
>  [PERMISSIONS permissions...]
>  [CONFIGURATIONS [Debug|Release|...]]
>  [COMPONENT ]
>  [RENAME ] [OPTIONAL])
>
> signature.
> --
> Erk
> Le gouvernement représentatif n'est pas la démocratie --
> http://www.le-message.org
>
--

Powered by www.kitware.com

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

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

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

Re: [CMake] Adding external executable

2012-11-09 Thread Eric Noulard
2012/11/9 Manoj Vaghela :
> Dear Eric,
>
> Thanks for your reply.
>
> When I am using INSTALL (FILES... ) for adding external executable to my
> CMakeLists.txt file, it shows the executable file in the RPM archive. But
> it's execute permission is lost. What should I have to do for that?
>
> Also, ADD_EXECUTABLE( ... IMPORTED) did not work for me. I added this line
> but when archive is created, it did not include my executable in it.

See my comment below:

>
> This is sample of my CMakeLists.txt
> ---
>
> SET( CPACK_GENERATOR "RPM" )
>
> # MAIN EXE
> SET( MAIN_EXE myExe)
> ADD_EXECUTABLE(${MAIN_EXE} SOME_SOURCE_FILES )
> SET( INSTALL_DIR "$ENV{HOME}/MANOJ" )
> INSTALL( TARGETS ${MAIN_EXEC} DESTINATION ${INSTALL_DIR} )
>
> # EXTERNAL EXE
> SET( EXTERNAL_EXE "/home/manoj/EXTERNAL/a.out.exe" )
> SET( IMPORTED_LOCATION ${EXTERNAL_EXE} )
> ADD_EXECUTABLE( ${EXTERNAL_EXE} IMPORTED) // This does not pack the
> executable

Once the external executable is imported as a TARGET
you have to install it:
INSTALL( TARGETS  ${EXTERNAL_EXE}  DESTINATION ${INSTALL_DIR} )

>
> #INSTALL( FILES ${EXTERNAL_EXE} DESTINATION ${INSTALL_DIR}) // This packs,
> but permissions lost

My mistake for executable you should be using
install(PROGRAMS files... DESTINATION 
 [PERMISSIONS permissions...]
 [CONFIGURATIONS [Debug|Release|...]]
 [COMPONENT ]
 [RENAME ] [OPTIONAL])

signature.
-- 
Erk
Le gouvernement représentatif n'est pas la démocratie --
http://www.le-message.org
--

Powered by www.kitware.com

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

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

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


Re: [CMake] Adding external executable

2012-11-09 Thread Manoj Vaghela
Dear Eric,

Thanks for your reply.

When I am using INSTALL (FILES... ) for adding external executable to my
CMakeLists.txt file, it shows the executable file in the RPM archive. But
it's execute permission is lost. What should I have to do for that?

Also, ADD_EXECUTABLE( ... IMPORTED) did not work for me. I added this line
but when archive is created, it did not include my executable in it.

This is sample of my CMakeLists.txt
---

SET( CPACK_GENERATOR "RPM" )

# MAIN EXE
SET( MAIN_EXE myExe)
ADD_EXECUTABLE(${MAIN_EXE} SOME_SOURCE_FILES )
SET( INSTALL_DIR "$ENV{HOME}/MANOJ" )
INSTALL( TARGETS ${MAIN_EXEC} DESTINATION ${INSTALL_DIR} )

# EXTERNAL EXE
SET( EXTERNAL_EXE "/home/manoj/EXTERNAL/a.out.exe" )
SET( IMPORTED_LOCATION ${EXTERNAL_EXE} )
ADD_EXECUTABLE( ${EXTERNAL_EXE} IMPORTED) // This does not pack the
executable

#INSTALL( FILES ${EXTERNAL_EXE} DESTINATION ${INSTALL_DIR}) // This packs,
but permissions lost

# EXTERNAL LIB
INSTALL( FILES EXTERNAL_LIB DESTINATION ${INSTALL_DIR} )

INCLUDE(CPack)

Can you please tell me what is the error in this file?
Thanks..

--
regards,
Manoj


On Fri, Nov 9, 2012 at 1:18 PM, Eric Noulard  wrote:

> 2012/11/9 Manoj Vaghela :
> > Hi cmake,
> >
> > I have just started learning use of CPack for my application.
> >
> > I have an application which uses Qt and other third party libraries.
> >
> > In CMakeLists.txt,
> >
> > For adding libraries of external package, I used
> > INSTALL( FILES Lib1 lib2 DESTINATION ${INSTALL_DIR} )
> >
> > For installing target generated from this CMakeLists.txt,
> > INSTALL( TARGETS ${EXECUTABLE_NAME} DESTINATION ${INSTALL_DIR} )
> >
> > Here, while installing TARGETS, I want to add an executable of external
> > package.
> > When I included it with the above INSTALL, it says that "install TARGETS
> > given target "some/path/exe" which does not  exist in this directory."
>
> INSTALL(TARGETS ...)
> signature is only for *targets* which are build or imported by your
> current project.
> IMPORTED target may be defined using
>
> add_executable(... IMPORTED)
> or
> add_library(... IMPORTED)
>
> If you want to install other file/executable you can use:
> INSTALL(FILE ...)
>
> reading the builtin doc will certainly help you
>
> cmake --help-command add_library
> cmake --help-command add_executable
> cmake --help-command install
>
>
> > I want to do it without copying in to the CMakeLists.txt folder. Is there
> > any other way?
>
> see above.
>
> > Also, can somebody throw some light on while making package, which type
> of
> > libraries should I include ?? SHARED or STATIC ??
>
> This is not really a packaging choice.
> If your executable use shared lib then you should include those.
> Putting STATIC libs in your package usually means your package is offering
> the use of those libs to the user.
>
> Concerning including Qt libs in your installer you shoud find many
> reference of this
> on the ML list archive.
>
> A good starting point may be Mike's blog entry on DeployQt4 as well:
> http://mikemcquaid.com/2012/01/04/deploying-qt-applications-with-deployqt4/
> --
> Erk
> Le gouvernement représentatif n'est pas la démocratie --
> http://www.le-message.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