Provide a define for having OpenMP

This commit is contained in:
Roland Kaufmann 2013-08-05 21:54:31 +02:00
parent 8cb420bb7f
commit 354158207d

View File

@ -23,6 +23,12 @@
include (AddOptions)
macro (find_openmp opm)
# default is that OpenMP is not considered to be there; if we set this
# to a blank definition, it may be added but it cannot be removed if
# it propagates to other projects (someone declares it to be part of
# _CONFIG_VARS)
set (HAVE_OPENMP)
# user code can be conservative by setting USE_OPENMP_DEFAULT
if (NOT DEFINED USE_OPENMP_DEFAULT)
set (USE_OPENMP_DEFAULT ON)
@ -37,6 +43,7 @@ macro (find_openmp opm)
if (OPENMP_FOUND)
add_options (C ALL_BUILDS "${OpenMP_C_FLAGS}")
add_options (CXX ALL_BUILDS "${OpenMP_CXX_FLAGS}")
set (HAVE_OPENMP 1)
endif (OPENMP_FOUND)
# threading library (search for this *after* OpenMP