I have been creating packages with conan for all the libraries one of the projects I work on uses. I've created a conanfile.py for each and all is well. I've created a conanfile.txt for a dummy code to make sure all is working as expected. I've run
conan instal .. --build=missing
And that has compiled all the packages. I can use ${CONAN_INCLUDE_DIRS} and ${CONAN_LIBS} in my CMake files. However I would like to have conan as an optional way of doing things, using Find_package(...) as a way to obtain library locations, linking and include details.
So I was intrigued to see
New in Conan 0.6! Now conan provides automatic support for CMake find_package without creating a custom FindXXX.cmake file for each package (conan 0.5).
So I thought it should work. But no FindXXX.cmake file is generated.
Here is one of my conanfile.py as an example for OpenMPI:
from conans import ConanFile
import os
from conans.tools import download
from conans.tools import unzip
from conans import CMake
from conans import ConfigureEnvironment
class OpenMPIConan(ConanFile):
name = "OpenMPI"
version = "2.0.0"
generators = "cmake"
settings = "os", "arch", "compiler", "build_type"
url="https://www.open-mpi.org/software/ompi/v2.0/"
license="https://www.open-mpi.org/community/license.php"
source_url = "https://www.open-mpi.org/software/ompi/v2.0/downloads/openmpi-2.0.0.tar.bz2"
unzipped_path = "openmpi-2.0.0/"
def source(self):
self.zip_name = os.path.basename(self.source_url)
download(self.source_url, self.zip_name)
unzip(self.zip_name)
os.unlink(self.zip_name)
def build(self):
self.run("%s/%s/configure --enable-mpi-thread-multiple --enable-mpi-cxx --prefix=%s CC=clang CXX=clang++" % (self.conanfile_directory, self.unzipped_path, self.package_folder))
self.run("%s make -j 8 install" % env.command_line)
def package(self):
self.copy("*.h", dst="include", src="install/include")
self.copy("*.lib", dst="lib", src="install/lib")
self.copy("*.a", dst="lib", src="install/lib")
def package_info(self):
self.cpp_info.libs = ["mpi", "mpi_cxx"]
Why isn't there a FineOpenMPI.cmake file created? How can I make sure it gets created?
PS: If I understand correctly, there is no need for the package method.