noloader / cryptopp-cmake

CMake files for Crypto++ project
BSD 3-Clause "New" or "Revised" License
92 stars 67 forks source link

Doesn't install cmake files #34

Closed yurivict closed 3 years ago

yurivict commented 6 years ago

In the FreeBSD port (security/cryptopp) I expected that the cmake-based build would install cmake files, so that other projects would be able to find it through cmake scripts.

But the list of files that it installs is identical.

Please install cmake files.

abdes commented 6 years ago

Can you please elaborate a bit more on what files you were looking for and where you were expecting them to be?

Currently we do install the following files in 'CMAKE_INSTALL_PREFIX/lib/cmake/cryptopp' :

noloader commented 6 years ago

Forgive my ignorance... Is this a CMake find question? I don't think we have a CMake find.

It came up several years ago but we did quite understand what we were supposed to provide. I think some people have made attempts to provide one but I don't believe we had the expertise to determine if it was correct.

yurivict commented 6 years ago

No, it didn't install any .cmake files at all. The plist was the same as with gnu make build. Do .cmake files require some option to be enabled?

abdes commented 6 years ago

Which version of cmake are you using? Required > 2.8.8

# CMake Package
if (NOT CMAKE_VERSION VERSION_LESS 2.8.8)
  include(CMakePackageConfigHelpers)
  write_basic_package_version_file("${PROJECT_BINARY_DIR}/cryptopp-config-version.cmake" VERSION ${cryptopp_VERSION_MAJOR}.${cryptopp_VERSION_MINOR}.${cryptopp_VERSION_PATCH} COMPATIBILITY SameMajorVersion)
  install(FILES cryptopp-config.cmake ${PROJECT_BINARY_DIR}/cryptopp-config-version.cmake DESTINATION "lib/cmake/cryptopp")
  install(EXPORT ${export_name} DESTINATION "lib/cmake/cryptopp")
endif ()
mouse07410 commented 6 years ago

I believe this is about having/creating and installing file FindCryptoPP.cmake that would tell other CMake-based projects where to find CryptoPP header files and libraries.

Currently we do not create this file, though it would be great if the build process could do that.

yurivict commented 6 years ago

I believe this is about having/creating and installing file FindCryptoPP.cmake

Yes, this was the whole point I tried to build with cmake.

jcfr commented 6 years ago

believe this is about having/creating and installing file FindCryptoPP.cmake

Since the project already generates a cryptopp-config.cmake, there is no need for a FindCryptoPP.cmake.

The Find* are only useful when the upstream project doesn't generate a config file.

Here are some resources:

Here is a post providing more details:

abdes commented 6 years ago

If I may also add to what @jcfr already mentioned above:

Excerpt from the cmake documentation:

Typically, a find module is needed when the upstream is not built with CMake, or is not CMake-aware enough to otherwise provide a package configuration file. Unlike a package configuration file, it is not shipped with upstream, but is used by downstream to find the files by guessing locations of files with platform-specific hints.

SylvainCorlay commented 5 years ago

I believe this is about having/creating and installing file FindCryptoPP.cmake

Yes, this was the whole point I tried to build with cmake.

This should not generate a FindCryptoPP.cmake as soon as the project-config.cmake is generated and installed.