Open Huy-Ngo opened 4 years ago
It looks like Alure is installed with Release mode, so it should have the IMPORTED_LOCATION_RELEASE
property, rather than IMPORTED_LOCATION_NOCONFIG
.
From what I can see, the target should have the property IMPORTED_CONFIGURATIONS
, which contains a list of configurations the found package has available. You can instead get the IMPORTED_LOCATION
property to get any configuration, however this doesn't guarantee which configuration you'll get if there's more than one. So, at least if it's possible to have more than one build configuration installed at a time, it would probably be better to get the IMPORTED_CONFIGURATIONS
property and search for a desired one (RELEASE
, MINSIZEREL
, RELWITHDEBINFO
, DEBUG
, etc), then get the specific imported location you want, or fall back to the generic IMPORTED_LOCATION
if you don't find a desired config listed.
@kcat, thanks for the pointer to our problem! I can't get IMPORTED_LOCATION
to work on my GNU/Linux system, so I look it up and turns out
Projects may skip
IMPORTED_LOCATION
if the configuration-specific propertyIMPORTED_LOCATION_<CONFIG>
is set. To get the location of an imported target read one of theLOCATION
orLOCATION_<CONFIG>
properties.
@Huy-Ngo, I think using just LOCATION
may work for our case.
Thanks. I will try that.
@kcat, as seen in the linked palace's PR, both IMPORTED_LOCATION_RELEASE
and LOCATION
gives DLLs. I'm not familiar with the build system on Windows but it seems that we need .lib
files instead for linkage. I am wondering if it's safe to substitude bin/*.dll
with lib/*.lib
or is there any more canonical method to get the .lib
s.
It looks like IMPORTED_IMPLIB
contains the .lib
name for Windows. Though annoyingly, it doesn't seem to be used on other platforms (aside from AIX). I unfortunately don't see a target property that holds the file to link with at link time for any given platform (the .so
on Linux, the .a
or .dll
on MinGW, the .lib
on MSVC, etc).
As far as CMake goes, you're normally supposed to just specify Alure2::alure2
for a target you want to link against, and it automatically applies the proper libs and compile switches and stuff for that target. But I don't know how you'd access or print that information manually.
It looks like
IMPORTED_IMPLIB
contains the.lib
name for Windows.
Thanks, I've just recognized that we made a typo when trying this. I'm looking forward to seeing it working. Edit: IMPORTED_IMPLIB
gives libalure2-NOTFOUND
:disappointed:
I unfortunately don't see a target property that holds the file to link with at link time for any given platform
I don't think that's a problem, since CMake's output it parsed by Python build tools, so we can apply some simple conditional to get what we want. We couldn't found a way to build using CMake target directly because it is really difficult (I'm not sure if it's entirely impossible) to make Python, Cython in CMake to work together and output to a hook where we can continue in Python build procedure to build a wheel.
It is not a good idea to use Cmake directly with Python. Windows users don't like doing these.
All popular python packages have a compiled .whl version. Setting this up is always great.
Alure cannot be compiled with vs2019.
I compiled it with MinGW.
@SeanTolstoyevski, FYI we're trying to build the wheels to distribute to our users :wink: And since python.org provide CPython binaries compiled by VC++, we can't use MinGW. We do expect to have to perform some hacks to get it working, but at the time of writing we haven't figured out what are those yet :smile:
I'm cross-linking McSinyx/palace#99 for the ease of future reference.
When I tried to build Windows wheel for palace, I has successfully installed OpenAL and alure libraries. However, when the wheel is being built, it is as if these libraries are not there.
Please take a look at the full log
Here is the CMakeLists.txt file: