Hi, Can you please give an example for install(SCRIPT ...)
So I can install a init-script with rpm ? On 12/9/11, Eric Noulard <[email protected]> wrote: > 2011/12/9 vivek goel <[email protected]>: >> I want to generate two package type . >> >> So I am using following syntax in my CMakeLists.txt >> SET(CPACK_GENERATOR "TGZ;RPM") >> >> Now problem is that I want to install some extra files in Generator RPM. >> And I want to set different Install RPM prefix. >> How can I do that ? > > When you want to do CPack generator specific things you'd better > off using CPACK_PROJECT_CONFIG_FILE > http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#Overall_usage_.28common_to_all_generators.29 > > this file is loaded **at CPack time** before the CPack generator runs. > in this file you can do something like; > > if(CPACK_GENERATOR MATCHES "TGZ") > set(CPACK_ARCHIVE_COMPONENT_INSTALL "OFF") > endif(CPACK_GENERATOR MATCHES "ZIP") > > if(CPACK_GENERATOR MATCHES "RPM") > set(CPACK_RPM_COMPONENT_INSTALL "ON") > # change the default install prefix > set(CPACK_PACKAGING_INSTALL_PREFIX "/opt") > endif(CPACK_GENERATOR MATCHES "RPM") > > The problem with the "install extra file for RPM" is that install command > are prepared at **CMake time** and launched at **CPack time** > so may be you can use the > > install(SCRIPT ...) signature with a cmake script which will check > (at CPack time) the value of CPACK_GENERATOR in the same way > CPACK_PROJECT_CONFIG_FILE does. > > > > -- > Erk > Membre de l'April - « promouvoir et défendre le logiciel libre » - > http://www.april.org > -- regards Vivek Goel -- 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
