On 10/08/2012 05:30 PM, Matthew Woehlke wrote: > When I write a simple program using OpenMP, with a CMakeLists.txt like: > > find_package(OpenMP REQUIRED) > add_definitions(${OpenMP_CXX_FLAGS}) > add_executable(foo foo.cpp)
The value of OpenMP_CXX_FLAGS is CXX flags, not definitions. Try: set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") CMake adds CXX flags on the link line when using the C++ compiler to drive the link. This is because flags like -m64 get used by the front-end to choose implicit flags to pass to the linker. In order to do it per-target, add it to the COMPILE_FLAGS and LINK_FLAGS properties explicitly. -Brad -- 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