Coder Social home page Coder Social logo

Comments (11)

dsieger avatar dsieger commented on May 18, 2024 1

Merged into master, closing.

from pmp-library.

petrasvestartas avatar petrasvestartas commented on May 18, 2024

I would like to use PMP for my research in CAD environment for PInvoke with .NET libraries. But for this I need to know how to compile PMP to C++ .dll. While the PInvoke I can do myself.

Is it possible to do this any time soon?
Or is it somehow possible to configure cmakelists so that I could compile via cmake?

from pmp-library.

petrasvestartas avatar petrasvestartas commented on May 18, 2024

Anyone?

from pmp-library.

dsieger avatar dsieger commented on May 18, 2024

I'm looking into this. The thing is: I'd like to avoid the classic approach of sprinkling dllexport macros all over the code. There is some support in newer CMake versions to automatically export the symbols. This seems to work, but I have not tested it beyond compiling our code. I also need to implement a solution for our test runner to find the dlls.

I pushed my current state to the dllexport branch, maybe that's already good enough to get you started.

from pmp-library.

petrasvestartas avatar petrasvestartas commented on May 18, 2024

Thank you for the reply

Is it enough to write two lines in windows bash/terminal from repo of dllexport?

git clone --recursive https://github.com/pmp-library/pmp-library.git

cd pmp-library && mkdir build && cd build && cmake .. && make

Do I need to download additional libraries or specially configure cmake?

from pmp-library.

dsieger avatar dsieger commented on May 18, 2024

You'll need to switch to the dllexport branch after checkout:

git checkout dllexport

The build command probably is not make on Windows. You could use something like

cmake --build .

No additional libraries required, shared libraries are enabled by default. This might become a CMake option before merging to master.

from pmp-library.

petrasvestartas avatar petrasvestartas commented on May 18, 2024

I did this which allows to get the "pmp-library.sln" project:

$ git clone --single-branch --branch dllexport --recursive https://github.com/pmp-library/pmp-library.git
cd pmp-library && mkdir build && cd build && cmake .. && make

After which I have following:
Make

And after opening "pmp-library.sln" in Visual Studio and building all projects, I see some .dll files :
image

When you replied:
cmake --build .

Does it mean that in Bash I can directly write this to build projects even without Visual Studio:
cd pmp-library && mkdir build && cd build && cmake --build .
instead of:
cd pmp-library && mkdir build && cd build && cmake .. && make

What minimal example shall I test to minimally know that I can load a file (without UI) ?

The reason for asking about UI is that there is quite a lot of references and I do not know which ones are responsible for executing mesh methods and which ones are for display:
image

from pmp-library.

dsieger avatar dsieger commented on May 18, 2024

And after opening "pmp-library.sln" in Visual Studio and building all projects, I see some .dll files :

That looks OK.

Does it mean that in Bash I can directly write this to build projects even without Visual Studio:

Yes, cmake --build will invoke MSBuild to build the solution.

What minimal example shall I test to minimally know that I can load a file (without UI) ?

You can pick any of the examples from the examples directory. They only link against the core library containing the data structure and algorithms, no UI involved. You can build the examples by configuring CMake with

cmake -DWITH_EXAMPLES=ON ..

from pmp-library.

petrasvestartas avatar petrasvestartas commented on May 18, 2024

Sorry, I am not very familiar with CMake, should I modify this file:
https://github.com/pmp-library/pmp-library/blob/dllexport/CMakeLists.txt

If yes, which line?

Or I should add this line
cmake -DWITH_EXAMPLES=ON ..
To this:

cd pmp-library && mkdir build && cd build && cmake --build .

from pmp-library.

dsieger avatar dsieger commented on May 18, 2024
cd pmp-library && mkdir build && cd build && cmake -DWITH_EXAMPLES=ON .. && cmake --build .

should do the trick. However, I'd suggest to get more familiar with CMake. This type of question / support usually is beyond the scope of our project.

from pmp-library.

petrasvestartas avatar petrasvestartas commented on May 18, 2024

Yay... Thank you very much for all your patience. It runs:

image

image

from pmp-library.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.