From aa98625b45fc493799d0eeae4d100f92924b4ce1 Mon Sep 17 00:00:00 2001 From: Krishna Vedala <7001608+kvedala@users.noreply.github.com> Date: Sun, 31 May 2020 10:49:26 -0400 Subject: [PATCH] find openmp declared required only once added subfolders after finding openmp --- CMakeLists.txt | 14 +++++++------- conversions/CMakeLists.txt | 3 --- misc/CMakeLists.txt | 4 ---- numerical_methods/CMakeLists.txt | 3 --- project_euler/CMakeLists.txt | 4 ---- searching/CMakeLists.txt | 4 ---- 6 files changed, 7 insertions(+), 25 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 20ab85a0..4a9b2b61 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,13 +48,6 @@ endif(MSVC) find_library(MATH_LIBRARY m) -add_subdirectory(conversions) -add_subdirectory(misc) -add_subdirectory(project_euler) -add_subdirectory(sorting) -add_subdirectory(searching) -add_subdirectory(numerical_methods) - if(USE_OPENMP) find_package(OpenMP) if (OpenMP_C_FOUND) @@ -64,6 +57,13 @@ if(USE_OPENMP) endif() endif() +add_subdirectory(conversions) +add_subdirectory(misc) +add_subdirectory(project_euler) +add_subdirectory(sorting) +add_subdirectory(searching) +add_subdirectory(numerical_methods) + set(CPACK_PROJECT_NAME ${PROJECT_NAME}) set(CPACK_PROJECT_VERSION ${PROJECT_VERSION}) include(CPack) diff --git a/conversions/CMakeLists.txt b/conversions/CMakeLists.txt index 6ff51c3f..f25f0549 100644 --- a/conversions/CMakeLists.txt +++ b/conversions/CMakeLists.txt @@ -1,6 +1,3 @@ -if(USE_OPENMP) - find_package(OpenMP) -endif(USE_OPENMP) # 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. diff --git a/misc/CMakeLists.txt b/misc/CMakeLists.txt index 6a7dd981..8245d92b 100644 --- a/misc/CMakeLists.txt +++ b/misc/CMakeLists.txt @@ -1,7 +1,3 @@ -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. diff --git a/numerical_methods/CMakeLists.txt b/numerical_methods/CMakeLists.txt index d9c678c3..4bc4f7af 100644 --- a/numerical_methods/CMakeLists.txt +++ b/numerical_methods/CMakeLists.txt @@ -1,6 +1,3 @@ -if(USE_OPENMP) - find_package(OpenMP) -endif(USE_OPENMP) # 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. diff --git a/project_euler/CMakeLists.txt b/project_euler/CMakeLists.txt index 1e896582..0dbf9c5d 100644 --- a/project_euler/CMakeLists.txt +++ b/project_euler/CMakeLists.txt @@ -1,7 +1,3 @@ -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. diff --git a/searching/CMakeLists.txt b/searching/CMakeLists.txt index f51852b5..9053dbb2 100644 --- a/searching/CMakeLists.txt +++ b/searching/CMakeLists.txt @@ -1,7 +1,3 @@ -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.