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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T09:51:54+00:00 2026-05-30T09:51:54+00:00

I am trying to control the flow of my program based on the value

  • 0

I am trying to control the flow of my program based on the value of a cmake variable called CMAKE_SIZEOF_VOID_P.

To start off, I wanted to just see what value this variable took under multiple different configurations, by issuing the following command in my cmakelists.txt file:

message(${CMAKE_SIZEOF_VOID_P})

This works perfectly. However, whenever I try to run the above command on my BuildSetup.cmake file, I get no value returned to me (it just throws an error).

It is important that I am able to access the value of this variable in my BuildSetup.cmake file, as that will help me decide what flags and other parameters to pass in to the compiler.

All I really need is a way to determine whether cmake is running a x64 compile or a 32 bit compile, so if there is any other variable (other than this one, since it is not defined in BuildSetup.cmake file) that will give me this, then that would also work for my purposes.

Any help would greatly be appreciated. 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-05-30T09:51:55+00:00Added an answer on May 30, 2026 at 9:51 am

    You can’t use CMAKE_SIZEOF_VOID_P until after you have invoked the PROJECT() command, (I think it’s set during the TRY_COMPILE phase of the PROJECT execution).

    Since you’re invoking BuildSetup.cmake using cmake -C, the contents of BuildSetup.cmake are parsed before anything in your main CMakeLists.txt.

    However, you probably shouldn’t be using a config file to determine which compiler flags CMake needs, they really belong inside your CMakeLists.txt somewhere after the PROJECT() command.

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

Sidebar

Related Questions

I'm trying to control my code flow whit the Node.JS module called asyncblock, it
I am trying to handle flow control situation on producer end. I have a
I am trying to do an ASP.net custom control for the Flow Player flv
So I'm trying to use the objdump utility to build a Control Flow Graph
I am trying out the great new containerless control flow (new feature number 2)
We are trying to establish an flow Control from android device to Bluetooth Thermal
I'm trying to control the main timeline of my flash application from a MovieClip
I am trying to control some LEDs wired to the parallel port on Windows
I'm trying to control the titles of my xterm windows and my cleverness has
I am trying to control admin item entry where non-super user accounts can't save

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.