Re: [CMake] CPack: Project and independent subproject

2012-10-23 Thread Romain LEGUAY

Thank you Eric,

I succeed to create the package by using CPACK_INSTALL_CMAKE_PROJECTS 
variable.


I have some problem now to put my package in a specific folder. I try to 
set CPACK_TOPLEVEL_TAG variable but there is no change...


Le 22/10/12 20:59, Eric Noulard a écrit :
If you want to have control over what is installed the better to do 
that is to create COMPONENT.

This is a part of my CMakeLists.txt:

install(TARGETS ${PROJECT_NAME}
   DESTINATION Demos
   COMPONENT ${PROJECT_NAME})

like this but I doubt that you can name a COMPONENT with the same
name as the name of your project.

then you must either define:
set(CPACK_INSTALL_CMAKE_PROJECTS
${CMAKE_CURRENT_BINARY_DIR};${PROJECT_NAME};${PROJECT_NAME}:/)

see documentation
cpack --help-variable CPACK_INSTALL_CMAKE_PROJECTS

I searched some methods to put the wanted files inside a package but I only
found how to ignore some files.

Does anyone have those kind of problem?

By the does your Demo/ directory have a project(...) command in its
CMakeLists.txt?


No I didn't put any project(...) in Demo/ or Application/ directories.

Thanks again for your help,
Romain
--

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: Project and independent subproject

2012-10-23 Thread Eric Noulard
2012/10/23 Romain LEGUAY romain.leg...@gmail.com:
 Thank you Eric,

 I succeed to create the package by using CPACK_INSTALL_CMAKE_PROJECTS
 variable.

 I have some problem now to put my package in a specific folder. I try to set
 CPACK_TOPLEVEL_TAG variable but there is no change...

Toplevel won't be included unless you set
CPACK_INCLUDE_TOPLEVEL_DIRECTORY

however..

The variables you may be looking for are either
CPACK_PACKAGE_INSTALL_DIRECTORY
or
CPACK_PACKAGING_INSTALL_PREFIX

depending on the generator used. As usual:

cpack --help-variable CPACK_INCLUDE_TOPLEVEL_DIRECTORY
cpack --help-variable CPACK_PACKAGE_INSTALL_DIRECTORY
cpack --help-variable CPACK_PACKAGING_INSTALL_PREFIX


 By the does your Demo/ directory have a project(...) command in its
 CMakeLists.txt?

 No I didn't put any project(...) in Demo/ or Application/ directories.

 Thanks again for your help,

You are welcome.


-- 
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: Project and independent subproject

2012-10-22 Thread Romain LEGUAY

Hello everyone,

My c++ project contains a Library folder, an Applications folder and a 
Demos folder like this:


Project/
 |- Library/
 |- include/
 |- src/
 |- Applications/
 |- appliA/
|- include/
|- src/
 ...
 |- Demos/
 |- demoA/
|- include/
|- src/
 ...

The applications and demos use the Library (which is a static library).

I can build all the application correctly in different level (directly 
inside demoA/ for example or in Project/).
I create custom target to build my package: demoA-package, 
demoA-package_source 


My problem is when I want to create a package (tar.gz, dmg, nsis or 
others...), I can't figure how to put just the executable of demosA 
inside the package: I have all the executable and the library.


This is a part of my CMakeLists.txt:

   install(TARGETS ${PROJECT_NAME}
  DESTINATION Demos
  COMPONENT ${PROJECT_NAME})

   set(CPACK_PACKAGE_NAME ${PROJECT_NAME})
   set(CPACK_PACKAGE_VENDOR Me)
   set(CPACK_PACKAGE_DESCRIPTION_SUMMARY Example test framework: demos
   ${PROJECT_NAME})
   set(CPACK_PACKAGE_VERSION_MAJOR 1)
   set(CPACK_PACKAGE_VERSION_MINOR 0)
   set(CPACK_PACKAGE_VERSION_PATCH 0)
   set(CPACK_PACKAGE_VERSION
   
${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
   set(CPACK_SOURCE_IGNORE_FILES
   /bin/;/.svn/;/.git/;${CPACK_SOURCE_IGNORE_FILES})

   set(CPACK_OUTPUT_CONFIG_FILE
   ${CMAKE_CURRENT_BINARY_DIR}/CPackConfig.cmake)
   set(CPACK_SOURCE_OUTPUT_CONFIG_FILE
   ${CMAKE_CURRENT_BINARY_DIR}/CPackSourceConfig.cmake)

   add_custom_target(${PROJECT_NAME}-package cpack --config
   ${CPACK_OUTPUT_CONFIG_FILE})
   add_custom_target(${PROJECT_NAME}-package_source cpack --config
   ${CPACK_SOURCE_OUTPUT_CONFIG_FILE})

   include(CPack)

   cpack_add_component(${PROJECT_NAME}
DISPLAY_NAME ${PROJECT_NAME})

I searched some methods to put the wanted files inside a package but I 
only found how to ignore some files.


Does anyone have those kind of problem?

Thanks,
Romain





--

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: Project and independent subproject

2012-10-22 Thread Eric Noulard
2012/10/22 Romain LEGUAY romain.leg...@gmail.com:
 Hello everyone,

 My c++ project contains a Library folder, an Applications folder and a Demos
 folder like this:

 Project/
  |- Library/
  |- include/
  |- src/
  |- Applications/
  |- appliA/
 |- include/
 |- src/
  ...
  |- Demos/
  |- demoA/
 |- include/
 |- src/
  ...

 The applications and demos use the Library (which is a static library).

 I can build all the application correctly in different level (directly
 inside demoA/ for example or in Project/).
 I create custom target to build my package: demoA-package,
 demoA-package_source 

 My problem is when I want to create a package (tar.gz, dmg, nsis or
 others...), I can't figure how to put just the executable of demosA inside
 the package: I have all the executable and the library.

If you want to have control over what is installed the better to do that
is to create COMPONENT.

 This is a part of my CMakeLists.txt:

 install(TARGETS ${PROJECT_NAME}
   DESTINATION Demos
   COMPONENT ${PROJECT_NAME})

like this but I doubt that you can name a COMPONENT with the same
name as the name of your project.

then you must either define:
set(CPACK_INSTALL_CMAKE_PROJECTS
${CMAKE_CURRENT_BINARY_DIR};${PROJECT_NAME};${PROJECT_NAME}:/)

see documentation
cpack --help-variable CPACK_INSTALL_CMAKE_PROJECTS

 set(CPACK_PACKAGE_NAME ${PROJECT_NAME})
 set(CPACK_PACKAGE_VENDOR Me)
 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY Example test framework: demos
 ${PROJECT_NAME})
 set(CPACK_PACKAGE_VERSION_MAJOR 1)
 set(CPACK_PACKAGE_VERSION_MINOR 0)
[]


 I searched some methods to put the wanted files inside a package but I only
 found how to ignore some files.

 Does anyone have those kind of problem?

By the does your Demo/ directory have a project(...) command in its
CMakeLists.txt?


-- 
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