Should OpenCVConfig.cmake be part of dev debian package?

asked 2018-02-11 21:49:33 -0500

Romanzo gravatar image

Hi,

I am building my own OpenCV debian packages and when I want to create the dev one, I see OpenCVConfig.cmake file is added to the package. I would think that the dev package only contains header files, not a file which has been generated during compilation to tell me which libraries are used.

This is happening when adding those cmake files to the COMPONENT dev for CPAK in OpenCVGenConfig.cmake

if(UNIX) # ANDROID configuration is created here also
      #http://www.vtk.org/Wiki/CMake/Tutorials/Packaging reference
      # For a command "find_package(<name> [major[.minor]] [EXACT] [REQUIRED|QUIET])"
      # cmake will look in the following dir on unix:
      #                <prefix>/(share|lib)/cmake/<name>*/                     (U)
      #                <prefix>/(share|lib)/<name>*/                           (U)
      #          <prefix>/(share|lib)/<name>*/(cmake|CMake)/             (U)
      if(INSTALL_TO_MANGLED_PATHS)
        install(FILES ${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig.cmake DESTINATION ${OPENCV_CONFIG_INSTALL_PATH}-${OPENCV_VERSION}/ COMPONENT dev)
        install(FILES ${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig-version.cmake DESTINATION ${OPENCV_CONFIG_INSTALL_PATH}-${OPENCV_VERSION}/ COMPONENT dev)
        install(EXPORT OpenCVModules DESTINATION ${OPENCV_CONFIG_INSTALL_PATH}-${OPENCV_VERSION}/ FILE OpenCVModules${modules_file_suffix}.cmake COMPONENT dev)
      else()
        install(FILES "${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig.cmake" DESTINATION ${OPENCV_CONFIG_INSTALL_PATH}/ COMPONENT dev)
        install(FILES ${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig-version.cmake DESTINATION ${OPENCV_CONFIG_INSTALL_PATH}/ COMPONENT dev)
        install(EXPORT OpenCVModules DESTINATION ${OPENCV_CONFIG_INSTALL_PATH}/ FILE OpenCVModules${modules_file_suffix}.cmake COMPONENT dev)
      endif()
    endif()

This is annoying because when I have an other application which can be build with or without CUDA. And this application download my OpenCV debian packages. When using the find_package (OpenCV), the OpenCVConfig.cmake will be look for. Which means I need to build two dev packages, a cuda-dev and a dev. Shouldn't this OpenCVConfig.cmake be moved to the libs component?

Thanks

edit retag flag offensive close merge delete