最終更新:2017-05-23 (火) 00:46:39 (422d)  

CHECK_MODULE はてなブックマークを見る
Top / CHECK_MODULE

OpenCV

  • OpenCV/ソースコード/cmake/OpenCVUtils.cmake?
    # Macros that checks if module have been installed.
    # After it adds module to build and define
    # constants passed as second arg
    macro(CHECK_MODULE module_name define)
      set(${define} 0)
      if(PKG_CONFIG_FOUND)
        set(ALIAS               ALIASOF_${module_name})
        set(ALIAS_FOUND                 ${ALIAS}_FOUND)
        set(ALIAS_INCLUDE_DIRS   ${ALIAS}_INCLUDE_DIRS)
        set(ALIAS_LIBRARY_DIRS   ${ALIAS}_LIBRARY_DIRS)
        set(ALIAS_LIBRARIES         ${ALIAS}_LIBRARIES)
    
        PKG_CHECK_MODULES(${ALIAS} ${module_name})
    
        if(${ALIAS_FOUND})
          set(${define} 1)
          foreach(P "${ALIAS_INCLUDE_DIRS}")
            if(${P})
              list(APPEND HIGHGUI_INCLUDE_DIRS ${${P} })
            endif()
          endforeach()
    
          foreach(P "${ALIAS_LIBRARY_DIRS}")
            if(${P})
              list(APPEND HIGHGUI_LIBRARY_DIRS ${${P} })
            endif()
          endforeach()
    
          list(APPEND HIGHGUI_LIBRARIES ${${ALIAS_LIBRARIES} })
        endif()
      endif()
    endmacro()

関連