I reopen this topic since I have a little issue. The macro given by Denis works very well but my problem is that the "make install" installs by default all the components (it's in the doc). What I want is the "make install" to install all the necessary files but not the components and after, I call the "make component_name" to finish the installation.
To sum up : > make install (install headers...) > make install-en_US (install lang files) Is that possible ? Thanks ! -----Message d'origine----- De : Denis Scherbakov [mailto:[email protected]] Envoyé : vendredi 5 juin 2009 09:51 À : cmake; Pierre-Julien Villoud Objet : RE: [CMake] Trouble with Variable in installation > I tried to > add a target which do the cmake and define the variable like > that : > > add_custom_target(MyInstall COMMAND "cmake -DLANG=%LANG%") > add_dependencies(install MyInstall) > > but I can't add the dependency between the two targets. I think currently it is not possible to force anything to depend on "install" target. > > either: "Use COMPONENT option from INSTALL command" > I will look forward into this since I don't know how it > works. Try MACRO(ADD_INSTALL_TARGET VAR_NAME VAR_COMPONENT VAR_DEPENDS) ADD_CUSTOM_TARGET(${VAR_NAME} COMMAND ${CMAKE_COMMAND} -DCOMPONENT=${VAR_COMPONENT} -P ${CMAKE_BINARY_DIR}/cmake_install.cmake COMMENT "Performing component-specific installation" VERBATIM) IF ( "${VAR_DEPENDS}" MATCHES "^.+$" ) ADD_DEPENDENCIES(${VAR_NAME} "${VAR_DEPENDS}") ENDIF () ENDMACRO () INSTALL( ... COMPONENT COMP_en_US) ADD_INSTALL_TARGET(install-en_US COMP_en_US "Target1 Target2 Target3") _______________________________________________ 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
