add the ENABLE_OPENMP build flag

This commit is contained in:
Johann Dreo 2012-10-07 21:05:47 +02:00
commit 2b27b8881e

View file

@ -5,21 +5,28 @@
##################################################################################### #####################################################################################
# For eo::mpi # For eo::mpi
ENABLE_LANGUAGE(C) enable_language(C)
# For openmp parallel # For openmp parallel
FIND_PACKAGE(OpenMP) if(ENABLE_OPENMP)
IF(OPENMP_FOUND) find_package(OpenMP)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") if(OPENMP_FOUND)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
ENDIF() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
else()
message( "ERROR: You asked for OpenMP but it has not been found." )
set(IS_FATAL 1)
endif(OPENMP_FOUND)
endif(ENABLE_OPENMP)
INCLUDE(FindGnuplot) if(ENABLE_GNUPLOT)
include(FindGnuplot)
endif(ENABLE_GNUPLOT)
# Set a special flag if the environment is windows (should do the same in a config.g file) # set a special flag if the environment is windows (should do the same in a config.g file)
IF (WIN32) if (WIN32)
ADD_DEFINITIONS(-D_WINDOWS=1) add_definitions(-D_WINDOWS=1)
ENDIF (WIN32) endif (WIN32)
@ -28,10 +35,10 @@ ENDIF (WIN32)
##################################################################################### #####################################################################################
# now create config headers # now create config headers
CONFIGURE_FILE(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
# now create config install_symlink script file # now create config install_symlink script file
CONFIGURE_FILE(install_symlink.py.cmake ${CMAKE_CURRENT_BINARY_DIR}/install_symlink.py) configure_file(install_symlink.py.cmake ${CMAKE_CURRENT_BINARY_DIR}/install_symlink.py)
###################################################################################### ######################################################################################