message: CMakeLists optimization: find OpenMP package only for relevant examples (texture3d)
diff: @@ -11,27 +11,6 @@ function(buildExample EXAMPLE_NAME)
  if(EXISTS ${EXAMPLE_FOLDER}/${EXAMPLE_NAME}.h)
  SET(MAIN_HEADER ${EXAMPLE_FOLDER}/${EXAMPLE_NAME}.h)
  ENDIF()
  - if(APPLE)
  - # SRS - Use MacPorts paths as default since the same on x86 and Apple Silicon, can override for homebrew on cmake command line
  - if(NOT OpenMP_omp_LIBRARY AND EXISTS /opt/local/lib/libomp/libomp.dylib)
  - set(OpenMP_omp_LIBRARY /opt/local/lib/libomp/libomp.dylib)
  - endif()
  - if(CMAKE_C_COMPILER_ID MATCHES "Clang\$")
  - set(OpenMP_C_FLAGS "-Xclang -fopenmp")
  - set(OpenMP_C_LIB_NAMES "omp")
  - if(NOT OpenMP_C_INCLUDE_DIR AND EXISTS /opt/local/include/libomp)
  - set(OpenMP_C_INCLUDE_DIR /opt/local/include/libomp)
  - endif()
  - endif()
  - if(CMAKE_CXX_COMPILER_ID MATCHES "Clang\$")
  - set(OpenMP_CXX_FLAGS "-Xclang -fopenmp")
  - set(OpenMP_CXX_LIB_NAMES "omp")
  - if(NOT OpenMP_CXX_INCLUDE_DIR AND EXISTS /opt/local/include/libomp)
  - set(OpenMP_CXX_INCLUDE_DIR /opt/local/include/libomp)
  - endif()
  - endif()
  - endif()
  - find_package(OpenMP)
  # imgui example requires additional source files
  IF(${EXAMPLE_NAME} STREQUAL "imgui")
  file(GLOB ADD_SOURCE "../external/imgui/*.cpp")
  @@ -60,6 +39,27 @@ function(buildExample EXAMPLE_NAME)
  set_target_properties(${EXAMPLE_NAME} PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
  if(${EXAMPLE_NAME} STREQUAL "texture3d")
  + if(APPLE)
  + # SRS - Use MacPorts paths as default since the same on x86 and Apple Silicon, can override for homebrew on cmake command line
  + if(NOT OpenMP_omp_LIBRARY AND EXISTS /opt/local/lib/libomp/libomp.dylib)
  + set(OpenMP_omp_LIBRARY /opt/local/lib/libomp/libomp.dylib)
  + endif()
  + if(CMAKE_C_COMPILER_ID MATCHES "Clang\$")
  + set(OpenMP_C_FLAGS "-Xclang -fopenmp")
  + set(OpenMP_C_LIB_NAMES "omp")
  + if(NOT OpenMP_C_INCLUDE_DIR AND EXISTS /opt/local/include/libomp)
  + set(OpenMP_C_INCLUDE_DIR /opt/local/include/libomp)
  + endif()
  + endif()
  + if(CMAKE_CXX_COMPILER_ID MATCHES "Clang\$")
  + set(OpenMP_CXX_FLAGS "-Xclang -fopenmp")
  + set(OpenMP_CXX_LIB_NAMES "omp")
  + if(NOT OpenMP_CXX_INCLUDE_DIR AND EXISTS /opt/local/include/libomp)
  + set(OpenMP_CXX_INCLUDE_DIR /opt/local/include/libomp)
  + endif()
  + endif()
  + endif()
  + find_package(OpenMP)
  if(OpenMP_CXX_FOUND)
  target_link_libraries(${EXAMPLE_NAME} OpenMP::OpenMP_CXX)
  endif()
  