Skip to content

minor question about cmake on ubuntu 20.04 #11

@VisualFox

Description

@VisualFox

Hi, First thank you so much for this great library, I am really thankful for your hard work.

I encountering some minor issue when I try to compile and install the static library. I am following this installation guide: http://tatsy.github.io/lime/install.html
disclaimer: I am not familiar at all with cmake so I may have over looked something really obvious

a) in CMakeLists.txt find package is requiring version 3.x of OpenCV but I was trying to compile it against 4.x. Changing it to find_package(OpenCV 4.0 REQUIRED) resolve the issue but it's not ideal. Maybe it will be better to don't specify the OpenCV version? and just use find_package(OpenCV REQUIRED) instead?

b) This one is more odd but when running make install, the installation was falling due to 'EXPORT' and 'LimeTargets' being handled as file. It turn out that inside the cmake install files directive 'EXPORT LimeTargets' is interpreted as two files on my system.

CMake Error at sources/cmake_install.cmake:41 (file): file INSTALL cannot find "/home/xxx/xxx/lime/sources/EXPORT": No such file or directory.

I was able to resolve the issue by removing 'EXPORT LimeTargets' in these two places:

  • cmake/Macros.cmake in function(add_folder SOURCES FOLDER_NAME)

from

if (add_folder_INSTALL) message(STATUS "Install \"${FOLDER_NAME}\"") install(FILES ${LOCAL_FILES} EXPORT LimeTargets DESTINATION "include/${FOLDER_NAME}") endif()

to

if (add_folder_INSTALL) message(STATUS "Install \"${FOLDER_NAME}\"") install(FILES ${LOCAL_FILES} DESTINATION "include/${FOLDER_NAME}") endif()

  • sources/CMakeList.txt

from

install(FILES lime.hpp EXPORT LimeTargets DESTINATION include)

to

install(FILES lime.hpp DESTINATION include)

Let me know if you want a pull request for these two changes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions