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

Reply via email to