Re: [CMake] Conditional compiling [i.e. OpenMP]

2010-08-31 Thread Raymond Wan
Hi Eric, On Tue, Aug 31, 2010 at 20:59, Eric Noulard wrote: > 2010/8/31 Raymond Wan : >> /* #undef HAVE_OPENMP */ >> I can confirm that OpenMP is being detected because I can see the >> various values being defined in CMakeCache.txt.  HAVE_OPENMP is not in >> this file, though (it should, I pres

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

2010-08-31 Thread Raymond Wan
Hi Ryan and Eric, Thank you both for your replies! On Tue, Aug 31, 2010 at 20:10, Ryan Pavlik 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_OPENM

Re: [CMake] Conditional compiling [i.e. OpenMP]

2010-08-31 Thread Eric Noulard
2010/8/31 Raymond Wan : > > # > FIND_PACKAGE (OpenMP) > > if (OPENMP_FOUND) >  SET (HAVE_OPENMP 1) >  SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") > endif() > # > > and then created a "config.hpp.in" which had this: > > #cmakedefine HAVE_OPENMP 1 > > config.hpp gets genera

Re: [CMake] Conditional compiling [i.e. OpenMP]

2010-08-31 Thread Ryan Pavlik
On 8/31/10 3:40 AM, Raymond Wan wrote: Hi all, I'm still quite new to cmake and am trying to do something I use to do with autotools (took me ages to figure that out :-) ). I guess what I'm trying to do is not specific to OpenMP, though. In my C++ code, I'd like to add: #if HAVE_OPENMP #incl

[CMake] Conditional compiling [i.e. OpenMP]

2010-08-31 Thread Raymond Wan
Hi all, I'm still quite new to cmake and am trying to do something I use to do with autotools (took me ages to figure that out :-) ). I guess what I'm trying to do is not specific to OpenMP, though. In my C++ code, I'd like to add: #if HAVE_OPENMP #include #endif and have this check around ot