add the ENABLE_OPENMP build flag
This commit is contained in:
parent
06ff0b682b
commit
2b27b8881e
1 changed files with 20 additions and 13 deletions
|
|
@ -5,21 +5,28 @@
|
|||
#####################################################################################
|
||||
|
||||
# For eo::mpi
|
||||
ENABLE_LANGUAGE(C)
|
||||
enable_language(C)
|
||||
|
||||
# For openmp parallel
|
||||
FIND_PACKAGE(OpenMP)
|
||||
IF(OPENMP_FOUND)
|
||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
|
||||
ENDIF()
|
||||
if(ENABLE_OPENMP)
|
||||
find_package(OpenMP)
|
||||
if(OPENMP_FOUND)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
|
||||
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)
|
||||
IF (WIN32)
|
||||
ADD_DEFINITIONS(-D_WINDOWS=1)
|
||||
ENDIF (WIN32)
|
||||
# set a special flag if the environment is windows (should do the same in a config.g file)
|
||||
if (WIN32)
|
||||
add_definitions(-D_WINDOWS=1)
|
||||
endif (WIN32)
|
||||
|
||||
|
||||
|
||||
|
|
@ -28,10 +35,10 @@ ENDIF (WIN32)
|
|||
#####################################################################################
|
||||
|
||||
# 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
|
||||
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)
|
||||
|
||||
|
||||
######################################################################################
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue