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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:21:42+00:00 2026-06-14T07:21:42+00:00

How to configure/hack cmake to build particular executable added with add_executable() but do not

  • 0

How to configure/hack cmake to build particular executable added with add_executable() but do not install it?

The executable is a unit test and will eventually be handled with add_test but for now I just want to strip test binaries off the release touching as little as possible.

Thanks

  • 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-06-14T07:21:43+00:00Added an answer on June 14, 2026 at 7:21 am

    CMake will only install an executable target if you apply the install function to it, i.e.:

     install(TARGETS ExecutableTest RUNTIME DESTINATION "bin")
    

    To prevent the installation of the ExecutableTest for a Release build, add a CONFIGURATIONS restriction:

     install(TARGETS ExecutableTest RUNTIME DESTINATION "bin" CONFIGURATIONS Debug)
    

    Alternatively, you can make ExecutableTest an optional target, which is not built by default:

    add_executable(ExecutableTest EXCLUDE_FROM_ALL ${ExecutableTestFiles})
    

    and then optionally only install the ExecutableTest if it has been built explicitly:

     install(TARGETS ExecutableTest RUNTIME DESTINATION "bin" OPTIONAL)
    

    All optional test targets can be pooled in a super target to allow for building them in one step:

    add_custom_target(MyTests DEPENDS ExecutableTest ExecutableTest2 ExecutableTest3)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Module::Build to perform build, test, testpod, html, & install actions on my
Is it possible to configure nginx to query a service (not DNS) to determine
I configure the DomainDataSource to execute a particular server side method by setting the
I'm new to SignalR and have done a simple test hack. I wish to
./configure \ --with-apxs2=/usr/local/apache/bin/apxs \ --prefix=/usr/local/apache/php \ --with-config-file-path=/usr/local/apache/php make && make install I see no
The configure file test.conf is as below: <ocsigen> <server> <port>*:8000</port> <logdir>/home/zaxis/tmp/log/</logdir> <datadir>/home/zaxis/tmp/data</datadir> <user>zaxis</user> <group>wheel</group>
# configure for i386 build ./configure \ --cc=/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc \ --as='gas-preprocessor.pl /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc' \ --sysroot=/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk \
I configure eclipse Helios Service Release 2 , eclipse properly download and configure ADT
I configure Drupal to log in with CAS. After login in CAS, When I
My configuration: app.configure(function(){ app.set('views', __dirname + '/views'); app.set('view engine', 'jade'); app.use(express.bodyParser()); app.use(express.cookieParser()); app.use(express.session({ secret:

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.