4 ms·
But even with cmake there's no standard place for third-party libraries to be installed on Windows. There's no /usr/lib and /usr/include analogue. So if I'm w
by phs2501 11y ago
But even with cmake there's no standard place for third-party libraries to be installed on Windows. There's no /usr/lib and /usr/include analogue. So if I'm writing software that uses a third-party library I either have to bundle it into my source tree or hope there's an installer for it, burn the default installation location into the build system, and hope the user compiling my code has not overridden the default location. (I know some installers like Qt will make a system environment variable to say where their libraries are, but that's not particularly nice if everything did that.)
In my case I needed libapr, and as far as I can tell there is no installer for it, so I wound up just saying "drop a compiled copy of libapr into this location in the source tree" into the build instructions since I did not want to redistribute it with my source.
So yes, I dearly wish for something like a working pkgconfig on Windows.
- pmelendez 11y ago> There's no /usr/lib and /usr/include analogue I would argue that it is a good thing to not rely on /usr/lib or /usr/include even on Unix. It is a pain for when a dev who is jumping on the team specially when the dependencies are not documented. The make-dependency error-install-make cycle is very annoying.
- flohofwoe 11y agoI usually try hard to not link against 'installed' libs but instead directly compile external dependencies from source as part of my project. That way I don't need to have different libs for different build configs or VStudio versions. CMake can import sources from locations outside your source tree, and these source locations can be relative to your project (e.g. on the same directory level). That way you don't need any global system settings, or centralized locations, everything can be relative to your project. I actually prefer this also on OSX or Linux.