[CMake] CMAKE_SIZEOF_VOID_P question

Chuck Atkins chuck.atkins at kitware.com
Fri Apr 14 15:27:06 EDT 2017


Hi Thomas,

According to the documentation CMAKE_SIZEOF_VOID_P it is determined by
> running the compiler. However it seems that it is not using pertinent flags
> from the configuration, in particular CMAKE_C_FLAGS and CMAKE_CXX_FLAGS.
>

It is but the results from type size checking get saved in cache variables
so when run a second time, even though specifying extra CMAKE_CXX_FLAGS,
the CMAKE_SIZEOF_VOID_P variable already exists in cache so it's not
checked again.  If you clear your build directory before each invocation of
CMake then you should see it switch between 4 and 8 as expected.

----------
Chuck Atkins
Staff R&D Engineer, Scientific Computing
Kitware, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20170414/a0fe5f5e/attachment.html>


More information about the CMake mailing list