open-simulation-platform / cosim-cli

Command-line interface for libcosim
https://open-simulation-platform.github.io/cosim
Mozilla Public License 2.0
10 stars 4 forks source link

Copy .exe and .dlls to bin folder #21

Closed markaren closed 5 years ago

markaren commented 5 years ago

I kinda need this in order to run the .exe (without copying it anywhere after compilation). Not sure how you go about this?

kyllingstad commented 5 years ago

I'd rather not mess with CMake defaults unless we absolutely have to. (I kinda regret that we did that for cse-core.)

You can achieve what you want by using Conan's virtualrunenv generator. Just add -g virtualrunenv to your conan install command, and conan will generate scripts that will set/unset the appropriate environment variables for you, so that libraries are found at runtime.

On Linux, run (in the build folder):

source ./activate_run.sh

On Windows, run:

activate_run.bat

And then you should be able to run the CSE CLI executable no problem.

markaren commented 5 years ago

Indeed, that did work. But making a distribution to end users will involve manually copying files from .conan?

kyllingstad commented 5 years ago

@markaren:

Indeed, that did work. But making a distribution to end users will involve manually copying files from .conan?

I'd prefer it if we handle that via standard CMake mechanisms, to the extent possible. I'm pretty sure I have some code lying around in Coral's CMake scripts that we can use with minimal modifications. If you like, I can take a look at it.

markaren commented 5 years ago

I'm not in a hurry/don't need it. Mostly curious how you'd go about it.

kyllingstad commented 5 years ago

@markaren:

I'm not in a hurry/don't need it. Mostly curious how you'd go about it.

It needs to be in place before the 0.5.0 release of CSE, I guess, so there's a slight hurry. ;) Here is the code I referred to: https://github.com/viproma/coral/blob/master/cmake/InstallPrerequisites.cmake

It has the advantage that it also works for non-Conan builds.

kyllingstad commented 5 years ago

@kyllingstad:

It has the advantage that it also works for non-Conan builds.

BTW, I'm aware that cse-cli doesn't build at all without Conan now. ;) But that's just because I haven't gotten around to setting it up with a _USING_CONAN option like cse-core yet.