Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4611470
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:16:20+00:00 2026-05-22T01:16:20+00:00

actual I’m struggling with CMAKE_CUSTOM_COMMAND. Actually I try to define a separated make target

  • 0

actual I’m struggling with CMAKE_CUSTOM_COMMAND. Actually I try to define a separated make target for my demo sources while i got dependencies i could only solve after “regular” build, when any file is generated. This target should perform some steps after any regular build:

  1. Compile sources
  2. Create executables

Up to this point anything works fine using add_subdirectory command with separated CMakeLists files, but this fails when I try to solve dependencies which have not
created yet (i.e. copy dll on windows platform to demo executable dir)

  1. Copy dependencies (dlls ect.)

I’ve tried to use the CMAKE_CUSTOM_TARGET and CMAKE_CUSTOM_COMMAND commands. But I fail. How I could invoke a build of my demo sources using a separeted target?

Thanks for any help.
Best regards.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T01:16:20+00:00Added an answer on May 22, 2026 at 1:16 am

    To build one target after another you can use cmake add_dependencies command, specialy designed for this purpose.

    set (MY_LIB_DEPS
     target1
     target2
     #...
     targetn)
    
    add_library(MY_LIB source.cpp)
    target_link_libraries(MY_LIB ${MY_LIB_DEPS} 3rd_party_lib)
    add_dependencies(MY_LIB ${MY_LIB_DEPS})
    

    Also copying dlls and executables typically is done during installation, not building (Using make – while running command make install just after make). To achieve this use install command. For installing executable, for example, it can be used like this:

    add_executable(my_exec my_exec_source.cpp)
    target_link_libraries(my_exec ${MY_EXEC_DEPS})
    #...
    install(TARGETS my_exec RUNTIME
     DESTINATION ${MY_PROJECT_EXEC_INSTALL_PATH}
     RENAME "${MY_PROJECT_PREFIX}-main_exec")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My actual iPad Application causes an Exception. I try to run it on a
While Mahjong (the actual game, not Mahjong solitare) is fairly simple in terms of
Google limits the actual API calls one can make to their servers. I know
Link to my actual flash demo: http://nside-elite.techiedesign.net/redbox/flashtest.html I created this navigation using Adobe Flash
The actual app is actually a web app but since my first impression is
I'm interested in actual examples of using fixed point combinators (such as the y-combinator
What is the actual use of TempData collection in asp.net MVC, I need pros
There is an actual running Java ServerPages (JSP) application within a *NIX box which
How I can get actual folder path where my program is without my exe
I know in an actual query, you can use auto_increment=1 but how is this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.