Clemapfel / jluna

Julia Wrapper for C++ with Focus on Safety, Elegance, and Ease of Use
https://clemens-cords.com/jluna
MIT License
246 stars 14 forks source link

C-Adapter shared library may not be installed in exactly `CMAKE_INSTALL_PREFIX` in VS2022 #16

Closed Clemapfel closed 2 years ago

Clemapfel commented 2 years ago

In VS 2022, despite specifying

# in jluna/build
cmake .. -DCMAKE_INSTALL_PREFIX=C:/path/to/folder`

During cmake, after make install

jluna_c_adapter.dll may be installed into C:/path/to/folder/Debug or C:/path/to/folder/Release instead. This causes State::initialize() to fail, as it expects jluna_c_adapter.dll to be located in C:/path/to/folder.

Clemapfel commented 2 years ago

Most likely caused by: https://github.com/Clemapfel/jluna/blob/master/CMakeLists.txt#L44

For now, before calling jluna::initialize, use jluna::set_c_adapter_path like so:

int main()
{
   jluna::set_c_adapter_path("C:/path/to/folder/c_adapter.dll")
   jluna::initialize();
   (...)

Where C:/path/to/folder/c_adapter.dll is the full location and name of the shared library outputted by any specific IDE or make. This overrides the path set during via configure_file during make.

Clemapfel commented 2 years ago

solved with 0.9.1