karastojko / mailio

mailio is a cross platform C++ library for MIME format and SMTP, POP3 and IMAP protocols. It is based on standard C++ 17 and Boost library.
Other
372 stars 98 forks source link

Missing version.hpp during installation #126

Closed RosenGeorgiev closed 11 months ago

RosenGeorgiev commented 1 year ago

Description

So this happens during make install:

CMake Error at _deps/mailio-build/cmake_install.cmake:50 (file):
  file INSTALL cannot find "/drone/src/build_package/version.hpp": No such
  file or directory.
Call Stack (most recent call first):
  cmake_install.cmake:72 (include)

make: *** [Makefile:120: install] Error 1

I guess it's because of the usage of ${CMAKE_BINARY_DIR} here:

install(FILES ${CMAKE_BINARY_DIR}/version.hpp DESTINATION ${INCLUDE_INSTALL_DIR}/${PROJECT_NAME})

Using ${CMAKE_CURRENT_BINARY_DIR} instead seems to fix it.

NOTE

I'm adding mailio to my project via:

FetchContent_Declare(                                                                                                                                                                                                                                    
     mailio                                                                                                                         
     URL https://github.com/karastojko/mailio/archive/version_0-22-0.tar.gz                          
     GIT_REPOSITORY git@gitea.lan:external/mailio.git                                                                               
     GIT_TAG 0.22.0                                                                                                                 
)
FetchContent_MakeAvailable(mailio)

I guess that's what causes the problem with ${CMAKE_BINARY_DIR}.

karastojko commented 1 year ago

Does it also happen when you clone it from the master? I do not have the problem. Which operating system is being used?

RosenGeorgiev commented 1 year ago

It happens on master too. I reproduce it on arch, ubuntu 22.04 and fedora 38. I'll try to assemble a small example that reproduces it when I can.

tsurumi-yizhou commented 1 year ago

It happens to me too, on macOS 13.4, llvm clang 16.0.5.

It works when I delete all the lines start with "install". I guess something changed with vcpkg.

RosenGeorgiev commented 1 year ago

I'll really try to assemble an example this weekend :grin:

RosenGeorgiev commented 1 year ago

So, this small example reproduces the problem for me. I Hope it helps.

karastojko commented 1 year ago

The slightly changed script

project(external)

include(FetchContent)

FetchContent_Declare(
    mailio
    GIT_REPOSITORY https://github.com/karastojko/mailio.git
    GIT_TAG 0.22.0
)

FetchContent_MakeAvailable(mailio)

works for me. I guess there is a way to make it work with the zip archive, but does this solve your problem?

karastojko commented 11 months ago

I do not see it as the mailio problem, thus closing the issue.