install(EXPORT ...)

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

install(EXPORT ...)

Biddiscombe, John A.
The command

INSTALL(
  TARGETS ${PROJ_LIB_NAME}
  EXPORT  proj-targets
  LIBRARY DESTINATION lib
  ARCHIVE DESTINATION lib
  RUNTIME DESTINATION bin
)  


Works very nicely, when 'make install' is invoked, is there a way of achieving a similar result which is generated in the build directory - i.e. without doing a make install, just after a normal configure and generate.

Thanks

JB

--
John Biddiscombe,                            email:biddisco @ cscs.ch
http://www.cscs.ch/
CSCS, Swiss National Supercomputing Centre  | Tel:  +41 (91) 610.82.07
Via Cantonale, 6928 Manno, Switzerland      | Fax:  +41 (91) 610.82.82


_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: install(EXPORT ...)

Michael Wild

On 2. Dec, 2009, at 10:09 , Biddiscombe, John A. wrote:

> The command
>
> INSTALL(
>  TARGETS ${PROJ_LIB_NAME}
>  EXPORT  proj-targets
>  LIBRARY DESTINATION lib
>  ARCHIVE DESTINATION lib
>  RUNTIME DESTINATION bin
> )
>
>
> Works very nicely, when 'make install' is invoked, is there a way of  
> achieving a similar result which is generated in the build directory  
> - i.e. without doing a make install, just after a normal configure  
> and generate.
>
> Thanks
>
> JB
>
> --
> John Biddiscombe,                            email:biddisco @ cscs.ch
> http://www.cscs.ch/
> CSCS, Swiss National Supercomputing Centre  | Tel:  +41 (91) 610.82.07
> Via Cantonale, 6928 Manno, Switzerland      | Fax:  +41 (91) 610.82.82


You can use

export(TARGETS target ...
   [NAMESPACE namespace]
   [APPEND]
   FILE output_file
   )

which you can then include() in your dependent project.

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
Reply | Threaded
Open this post in threaded view
|

Re: install(EXPORT ...)

Biddiscombe, John A.
Michael

Thank you. That seems to do what I need.

JB
 

> You can use
>
> export(TARGETS target ...
>    [NAMESPACE namespace]
>    [APPEND]
>    FILE output_file
>    )
>
> which you can then include() in your dependent project.
>
> 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
Reply | Threaded
Open this post in threaded view
|

Re: install(EXPORT ...)

Michael Wild
I just found out that in the new CMake-2.8 there is also

export(PACKAGE package_name)

which adds your build-tree to the user's package database and helps  
CMake finding build-trees when using find_package(package_name) from  
another project. However, this still requires that you create an  
export-file in the build tree and you need a valid package_name-
config.cmake in the build-tree. Very useful, IMHO.

Michael

On 2. Dec, 2009, at 11:06 , Biddiscombe, John A. wrote:

> Michael
>
> Thank you. That seems to do what I need.
>
> JB
>
>> You can use
>>
>> export(TARGETS target ...
>>   [NAMESPACE namespace]
>>   [APPEND]
>>   FILE output_file
>>   )
>>
>> which you can then include() in your dependent project.
>>
>> 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