On 06.02.19 19:46, Joachim Wuttke wrote:
>
>
> Works under Linux, stable since many years. Under Windows10 though, a
> message window
> pops up, entitled "mytest.exe - System error": "The code execution
> cannot proceed
> because mylib.dll was not found. Reinstalling the program may fix this
>
The library `mylib` consists of the library proper, in directory `lib/`, and a
test suite, in directory `test/`. It is completely under CMake control:
mylib/CMakeLists.txt:
...
add_subdirectory(lib)
add_subdirectory(test)
...
mylib/lib/CMakeLists.txt:
...
On 2/6/19 1:46 PM, Joachim Wuttke wrote:
> What is the minimally invasive adjustment
> to make the above build steps work under Windows?
Windows has no RPATH to help executables locate their shared
libraries. The simplest solution is to put the .exe and .dll
files in the same directory (which
On 2/6/19 2:40 PM, Joachim Wuttke wrote:
> And combine it with
>
> ```
> link_directories(BEFORE ${PROJECT_BINARY_DIR}/bin)
> ```
>
> so that tests find the libraries?
No. CMAKE_RUNTIME_OUTPUT_DIRECTORY only affects the locations of
the .dll files, not .a/.so/.lib. Also CMake already knows
Add code like this at the top of your project:
```
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
```
And combine it with
```
link_directories(BEFORE ${PROJECT_BINARY_DIR}/bin)
```
so that tests find the libraries?
Anyway, my problem is not at link time, but when _executing_
On Thu, Feb 7, 2019 at 7:11 AM Brad King via cmake-developers <
cmake-developers@cmake.org> wrote:
> On 2/6/19 2:40 PM, Joachim Wuttke wrote:
> > And combine it with
> >
> > ```
> > link_directories(BEFORE ${PROJECT_BINARY_DIR}/bin)
> > ```
> >
> > so that tests find the libraries?
>
> No.