Thread: Cmake file dependancy

  1. #1
    Registered User
    Join Date
    Apr 2006
    Posts
    2,149

    Cmake file dependancy

    I have a cmake project. It has a target which as part of the linker step requires an additional file to be embedded in the "executable". I know how to pass in the linker flags to include the file, but I can't figure out how to make cmake aware of the dependency and relink the target whenever that file changes. Any one know?
    It is too clear and so it is hard to see.
    A dunce once searched for fire with a lighted lantern.
    Had he known what fire was,
    He could have cooked his rice much sooner.

  2. #2
    Registered User
    Join Date
    Dec 2017
    Posts
    1,626
    A little inaccuracy saves tons of explanation. - H.H. Munro

  3. #3
    Registered User
    Join Date
    Apr 2006
    Posts
    2,149
    Nope, that adds targets, not files.
    It is too clear and so it is hard to see.
    A dunce once searched for fire with a lighted lantern.
    Had he known what fire was,
    He could have cooked his rice much sooner.

  4. #4
    Registered User
    Join Date
    Dec 2017
    Posts
    1,626
    The last paragraph of that link mentions OBJECT_DEPENDS, which may be what you're looking for.
    A little inaccuracy saves tons of explanation. - H.H. Munro

  5. #5
    Registered User
    Join Date
    Apr 2006
    Posts
    2,149
    I eventually found the target property LINK_DEPENDS does what I need.
    It is too clear and so it is hard to see.
    A dunce once searched for fire with a lighted lantern.
    Had he known what fire was,
    He could have cooked his rice much sooner.

  6. #6
    Registered User Chris87's Avatar
    Join Date
    Dec 2007
    Posts
    139
    I'm guessing what you're seeking is something similar to Rust's include_bytes! macro?

  7. #7
    Registered User
    Join Date
    Apr 2006
    Posts
    2,149
    Quote Originally Posted by Chris87 View Post
    I'm guessing what you're seeking is something similar to Rust's include_bytes! macro?
    No. This is actually for an emscripten project, and the data is being stored as a virtual file system for a web browser.
    It is too clear and so it is hard to see.
    A dunce once searched for fire with a lighted lantern.
    Had he known what fire was,
    He could have cooked his rice much sooner.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Converting cmake project to qmake
    By Zeeshan in forum Tech Board
    Replies: 1
    Last Post: 07-26-2016, 01:22 AM
  2. Converting cmake project to qmake
    By Zeeshan in forum C++ Programming
    Replies: 0
    Last Post: 07-25-2016, 08:43 PM
  3. i need help with cmake, BISON and FLEX, i am willing to pay
    By Yakir Manor in forum Projects and Job Recruitment
    Replies: 1
    Last Post: 01-17-2012, 04:54 PM
  4. Replies: 2
    Last Post: 11-01-2009, 09:54 AM
  5. Replies: 1
    Last Post: 12-05-2008, 02:51 PM

Tags for this Thread