[CMake] Conditional compiling [i.e. OpenMP] -- solved!

Raymond Wan r.wan at aist.go.jp
Tue Aug 31 12:14:51 EDT 2010


Hi Ryan and Eric,

Thank you both for your replies!


On Tue, Aug 31, 2010 at 20:10, Ryan Pavlik <rpavlik at iastate.edu> wrote:
>  On 8/31/10 3:40 AM, Raymond Wan wrote:
>> I think "SET (HAVE_OPENMP 1)" is wrong, but I don't know what should
>> it be.  If it is correct, do I need to initialize it with "SET
>> (HAVE_OPENMP 0)" before?
>>
>> Thank you!
>>
>> Ray
>
> My guess is that you're generating your config.h before (earlier in the
> file) you are setting the HAVE_OPENMP variable, because everything else
> you've mentioned sounds OK.


*argh*  I feel so silly now -- yes, that was exactly my problem!  I
didn't realize that the location of CONFIGURE_FILE was important -- I
naively thought that the actual generation of the configuration file
is done after processing the entire CMakeLists.txt.  i.e., the file
lists the things that need to be done and nothing is done until after
the file is read.  I was wrong and why I thought that is odd since
that's how scripts work...

I guess I was too focused on how I was using the SET command; thinking
that I must have got that wrong...

Thank you both for your help!

Ray


More information about the CMake mailing list