Hi Eric,

On Tue, Aug 31, 2010 at 20:59, Eric Noulard <[email protected]> wrote:
> 2010/8/31 Raymond Wan <[email protected]>:
>> /* #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 presume?).
>
> HAVE_OPENMP is not in CMakeCache.txt because you did not defined
> it to be a cache var.
>
> However, I don't think HAVE_OPENMP have to be a cache var for this to work.


I see.  I didn't realize that I had to make variables into cache-able
and that they aren't be default.  I'll read more about it; I thought
it was by default and that I could use CMakeCache.txt to see where the
problem was.


> We are missing your CONFIGURE_FILE statement how does it look like?
> May be you can try a simple test:
>
> set(OPENMP_FOUND 1)
>
> if (OPENMP_FOUND)
>   SET (HAVE_OPENMP 1)
>   SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
> endif()
>
> configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.hpp.in
>                            ${CMAKE_CURRENT_BINARY_DIR}/config.hpp)


Thank you for this!  As I just said in my previous message to the
list, that was exactly my problem.  I didn't realize the importance of
the location of "configure_file" and placed it at the top of
CMakeLists.txt.  In hindsight, that was such a terrible idea!

I've been looking at the cmake docs for individual commands and
somewhat ignoring their order (since some, like the compiler flags,
just append to what it is so far).  This thinking got me in
trouble...and I'll be careful about this -- thank you!

Ray
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to