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 7398831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T03:55:14+00:00 2026-05-29T03:55:14+00:00

I wrote a cmake command like this: add_custom_target(testar COMMAND clearmake -C gnu ${CMD_ARGS}) the

  • 0

I wrote a cmake command like this:

add_custom_target(testar
              COMMAND clearmake -C gnu ${CMD_ARGS})

the CMD_ARGS is defined on the command line like:

cmake -DCMD_ARGS="-d -w" 

But in the generated makefile, the -d -w is changed into -d\ -w; it added a slash before all spaces, resulting in:

clearmake -C gnu -d\ -w 

If I use VERBATIM option in add_custom_target, cmake doesn’t add a slash, but it quotes the argument like

clearmake -C gnu "-d -w"

which is incorrect, I would like:

clearmake -C gnu -d -w

What is the syntax needed to generate the above target?

  • 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-29T03:55:15+00:00Added an answer on May 29, 2026 at 3:55 am

    The arguments are expected to be a list, which "-d -w" is not (it’s just a string). You can do two things:

    1. Pass in the arguments as -DCMD_ARGS="-d;-w" (the space is a semicolon)
    2. Use the separate_arguments command on CMD_ARGS before you pass it into add_custom_target (which makes spaces semi-colons to generate a proper list).

    Nothing in the add_custom_target command needs to change, the input to CMake is incorrect which can be fixed with 1 or handled by 2.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This might seem like a dump question, but my complete ignorance with VbScript is
How does unbindModel happen in cake? $this->User->unbindModel(array('hasAndBelongsToMany' => array('Friend'))); I wrote this in the
I know it has great out-of-the-box features but is it easy to customize? Like
Sorry for the long post, but this forum always asks for use cases :-).
I am trying to build a big project with CMake but I struggle on
When I start the Python interpreter in command line mode I get a message
This seems simple and I think I know the answer but I've searched and
Wrote the following in PowersHell as a quick iTunes demonstration: $iTunes = New-Object -ComObject
Wrote a quick Java proggy to spawn 10 threads with each priority and calculate
I wrote a simple batch file as a PowerShell script, and I am getting

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.