mirror of
https://github.moeyy.xyz/https://github.com/TheAlgorithms/C.git
synced 2023-10-11 15:56:24 +08:00
added option to enable or disable use of openmp
This commit is contained in:
parent
1e7fc84c3a
commit
d24b6ea344
@ -5,6 +5,8 @@ project(Algorithms_in_C
|
||||
DESCRIPTION "Set of algorithms implemented in C."
|
||||
)
|
||||
|
||||
option(USE_OPENMP "flag to use OpenMP for multithreading" ON)
|
||||
|
||||
add_subdirectory(function_timer EXCLUDE_FROM_ALL)
|
||||
include_directories(function_timer/include)
|
||||
# link_libraries(function_timer)
|
||||
@ -13,8 +15,11 @@ include_directories(function_timer/include)
|
||||
|
||||
add_subdirectory(conversions)
|
||||
add_subdirectory(misc)
|
||||
add_subdirectory(project_euler)
|
||||
|
||||
find_package(OpenMP)
|
||||
if(USE_OPENMP)
|
||||
find_package(OpenMP)
|
||||
endif()
|
||||
|
||||
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
|
||||
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
|
||||
|
@ -1,3 +1,7 @@
|
||||
if(USE_OPENMP)
|
||||
find_package(OpenMP)
|
||||
endif()
|
||||
|
||||
# If necessary, use the RELATIVE flag, otherwise each source file may be listed
|
||||
# with full pathname. RELATIVE may makes it easier to extract an executable name
|
||||
# automatically.
|
||||
|
Loading…
Reference in New Issue
Block a user