2

I have a hello tool which contains only exe files (without source).
Hello tool structure:

bin
   helloBin.exe
helloRoot.exe
conanfile.py

conanfile.py content:

class ToolHelloConan(ConanFile):
   name = "ToolHello"
   version = "0.1"
   settings = "os", "compiler", "build_type", "arch"

def package(self):
   self.copy("*")

def package_info(self):
   self.cpp_info.libs = self.collect_libs()

I've exported the hello tool to local cache: conan export-pkg . ToolHello/0.1@user/testing. This copied all exe in local_cache/ToolHello/0.1/user/testing/package/hash/bin. The bin in local cache looks like this:

bin
   helloBin.exe
helloRoot.exe

I've defined a tool integration project which contains only the conanfile.txt

[requires]
   ToolHello/0.1@user/testing

[generators]
   virtualrunenv

After running conan install . in tool integration project and activating the virtual run environment, I am able to call only the helloRoot.exe because it's located right in the bin directory, but I'm not able to execute the bin/bin/helloBin.exe

Question: How do I run exe files which are not located directly in the local_cache/ToolHello/0.1/user/testing/package/hash/bin, but in local_cache/ToolHello/0.1/user/testing/package/hash/bin/directory?

nicole
  • 91
  • 10

1 Answers1

1

You need to define the bindirs that are not the default one (bin). Add this to your conanfile.py:

def package_info(self):
   self.cpp_info.bindirs = ["bin", "bin/directory"]

If you need to also include the root of the package folder, you might need to use:

def package_info(self):
   self.cpp_info.bindirs = ["", "bin", "bin/directory"]
drodri
  • 5,157
  • 15
  • 21
  • With your solution I am able to execute bin/helloBin.exe, but I can't execute helloRoot.exe anymore. Why so? I'm confused now... – nicole Jul 11 '18 at 13:15
  • Maybe I misunderstood the layout, you might need to add the package root folder too. Updating the answer. – drodri Jul 11 '18 at 14:07