Coder Social home page Coder Social logo

Comments (4)

sakra avatar sakra commented on August 24, 2024

cotire cannot set up a install_unity target automatically, because CMake does not provide the necessary information about the existing install(TARGETS target) programmatically. You can however set one up manually. First add an install rule for each unity target, e.g.:

install(TARGETS example_unity RUNTIME DESTINATION "bin" OPTIONAL COMPONENT "unity")

This installs the example executable built by the unity target to the bin folder. The install rules for unity targets must use a custom install component. You can then add a global unity_install target that performs the installation of all unity targets:

add_custom_target(unity_install
        COMMAND ${CMAKE_COMMAND} -DCOMPONENT=unity -P cmake_install.cmake
        COMMENT "Install the unity-built project..."
        WORKING_DIRECTORY "${CMAKE_BINARY_DIR}")
add_dependencies(unity_install example_unity)

The global unity_install target must depend on all unity targets that should be installed.

from cotire.

peterhuene avatar peterhuene commented on August 24, 2024

We ran into a similar problem for our CI that uses unity to speed up builds. We elected to run the install/fast target after the all_unity target as two discrete steps; the install/fast target performs the install target without dependencies.

This allowed us to not have to define a different install target for unity builds.

from cotire.

sakra avatar sakra commented on August 24, 2024

Section has been added to the manual in cotire 1.6.7.

from cotire.

jcelerier avatar jcelerier commented on August 24, 2024

Another possibility that @ngladitz taught me was to remove the dependency on the all target to the install target :

set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY True)

The big advantage is that this allows running cpack easily with the unity targets (else cpack calls make install which just rebuilds everything).

from cotire.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.