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

  • Home
  • SEARCH
  • 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 4273910
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T07:46:34+00:00 2026-05-21T07:46:34+00:00

I am changing from plain make to CMake as a build system for a

  • 0

I am changing from plain make to CMake as a build system for a project. The project is supposed to run on different embedded Linux systems each with its own toolchain and also has quite a few different configuration options per target (e.g. different preprocessor definitions and some sources included/excluded). It is also supposed to work on desktop Linux and some GUI modules have to run on Windows.

Now, CMake has its CMAKE_TOOLCHAIN_FILE option that can be used to factor out the toolchain and compiler specific stuff of each embedded platform (desktop Linux and Windows should not need one).

I guess putting stuff other than the one listed on the CMake Wiki inside the toolchain file is not a good idea.

I am thinking about creating some CMake variables that can be edited by the cmake gui tool and then simply using if/elseif to determine the right setup.

Does anyone have a better or more elegant suggestion?

  • 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-21T07:46:35+00:00Added an answer on May 21, 2026 at 7:46 am

    I figured instead of using long if/elseif/else blocks I could simply have

    include(flags-${CONFIGURATION_NAME}.cmake)
    

    in my CMakeLists.txt and the specific flags for each configuration would then simply be listed on the appropriate flags file.

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

Sidebar

Related Questions

The UK VAT system is changing from 17.5% to 15%. What strategies have you
We are changing from vs2003 to vs2005 and use vb as our primary language,
Is anyone aware of any performance implications from changing the _win32_winnt from 0x400 to
I'm changing our application from one set of code & one database to one
Management is thinking of changing out Content Management Systems. What do you use/recommend? What
I'm working a project to replace a Resource Management system (QuickTime Resource Manager on
I'm currently working on a migration project, to migrate data from the old db
Currently I have two different queries that return exactly the same results however, changing
This is taken from John Resig`s Learning Advanced Javascript #25, called changing the context
I am thinking of changing my web site's homegrown search engine. Before I break

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.