2010/8/31 Raymond Wan <r....@aist.go.jp>: > > ##### > 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 generated fine, but it ends up having this: > > /* #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. 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) with your current config.hpp.in. If this does not generate the appropriate config.hpp file then send this minimal project (CMakeLists.txt + config.hpp.in) on the list. Which version of CMake are you using? What is your platform (Linux, Windows, MacOS...) -- Erk Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org _______________________________________________ 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