[CMake] Accessing Variables from within a *.cmake file

John Drescher drescherjm at gmail.com
Thu Feb 23 10:48:29 EST 2012


On Thu, Feb 23, 2012 at 10:39 AM, Hashim Mir <hmir at rim.com> wrote:
> Hi,
>
>
> 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
> *.cmake file, I get no value returned to me (it just throws an error).
>

Is there a PROJECT()

before you include your .cmake

John


More information about the CMake mailing list