![]() |
Building on Windows - CMake Error Could NOT find hdhomerun (missing: HDHOMERUN_LI ... - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26) +---- Forum: PVR (https://forum.kodi.tv/forumdisplay.php?fid=136) +---- Thread: Building on Windows - CMake Error Could NOT find hdhomerun (missing: HDHOMERUN_LI ... (/showthread.php?tid=311892) |
Building on Windows - CMake Error Could NOT find hdhomerun (missing: HDHOMERUN_LI ... - MatthewLundberg - 2017-04-09 What's required to build this add-on on Windows, and then integrate it into a Kodi instance? I'd like to take a stab at fixing a few issues, but I haven't gotten it to build. I have cloned the repo from https://github.com/kodi-pvr/pvr.hdhomerun.git and attempted to follow the instructions. I have VS2015 Professional installed (14.0.25431.01 Update 3) and cmake 3.7.2. In the output from the command-line build is the following text, then report of the error at the very end of the run. Code: Building Custom Rule D:/Kodi-Dev/xbmc/cmake/addons/CMakeLists.txt Using the "ALL_BUILD" target in the IDE shows some errors that may be meaningful: Code: 8> -- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE) There aren't any errors in that log file. Any clues as to what I have missed? RE: Building on Windows - CMake Error Could NOT find hdhomerun (missing: HDHOMERUN_LI ... - MatthewLundberg - 2017-04-20 I had a thought that perhaps I should build Kodi first. Kodi built and runs just fine. However, I still get the same error when attempting to build the pvr.hdhomerun. RE: Building on Windows - CMake Error Could NOT find hdhomerun (missing: HDHOMERUN_LI ... - rpcameron - 2017-04-20 I think you might need the libhdhomerun sources, or at least the Windows binaries. I'm not sure if the Windows app includes the libraries, but on SD's website you can download the library sources under the Linux downloads; don't worry, it might say they're the Linux libraries, they build on Windows, too. Or, you can get more recent versions on SD's GitHub repo. RE: Building on Windows - CMake Error Could NOT find hdhomerun (missing: HDHOMERUN_LI ... - rpcameron - 2017-04-20 Yep, after looking at the pvr.hdhomerun sources, they're looking for hdhomerun.h which is the blanket include file for libhdhomerun. Grab the sources as I mentioned above. You may need to build them first. RE: Building on Windows - CMake Error Could NOT find hdhomerun (missing: HDHOMERUN_LI ... - MatthewLundberg - 2017-04-21 Ok, that's helpful. I downloaded the sources, and they have a makefile for gcc. I need to use mingw to compile this with gcc? What isn't helpful is that the mingw installed by the XBMC build did not include the compiler. I'm going to try to install gcc within this mingw instance. Is that a useful path, or am I going about it all wrong? RE: Building on Windows - CMake Error Could NOT find hdhomerun (missing: HDHOMERUN_LI ... - MatthewLundberg - 2017-04-21 Well, installing the compiler in the XMBC MinGW tree didn't happen. The mingw-get.exe program is not installed, so I attempted to apply the (horrible enough) manual process shown at http://www.mingw.org/wiki/howto_install_the_mingw_gcc_compiler_suite The second and third "Files to Get" are 404's. Then I see that the page is from 2008. Doh! So I downloaded MinGW again and installed it at the preferred location C:\MinGW. I'm missing a bunch of headers, headers that are at <path to>\xbmc\project\BuildDependencies\msys64\mingw32\i686-w64-mingw32\include I figured why not try a complete hack, and copy the contents of the XBMC MinGW include directory to C:\MinGW\include. And the compilation does get much further, and fails trying to read <net/if.h>. Of course the fix for the hack and for the if.h file is to find the proper MinGW packages to install... This is the first time that I've tried to use MinGW for anything. I understand wanting to use it for GUI work like Kodi, as the APIs on Windows are really very different from Linux. But it's kicking my butt here. RE: Building on Windows - CMake Error Could NOT find hdhomerun (missing: HDHOMERUN_LI ... - rpcameron - 2017-04-21 Um, why do you need a Makefile of any sort. You can easily compile each source file (excepting the "config" one, which is the hdhomerun_config source file), and then just link them all into a shared library. Or modify the Makefile to point to your compiler. Or manually execute each part of the Makefile by yourself, substituting msvc for gcc. Or ... There are many many ways to do this without mingw/gcc. RE: Building on Windows - CMake Error Could NOT find hdhomerun (missing: HDHOMERUN_LI ... - MatthewLundberg - 2017-04-22 Thank you. I think you're absolutely correct. The problem is that I assumed that the makefile should specify the proper files to compile for Windows, since it explicitly checks for Windows. Well, it does not. There are two source files that are Windows-specific, and are named *_windows.c instead of *_posix.c. Invoking the MS compiler CL.EXE on each of them not named hdhomerun_config.c or *_posix.c does in fact work. And CL can link them, given the proper additional libraries needed (ws2_32.lib iphlpapi.lib Advapi32.lib User32.lib), and will then produce a DLL. I write above, "I think" because I still have not attempted to load this DLL into any executable so I am not sure that I have what I need, but I'm definitely further along than before. I need to figure out how to tell cmake where they are (the hdhomerun header files and this DLL), but that's a completely different problem. I'm not a complete cmake novice, but I'm far from an expert. RE: Building on Windows - CMake Error Could NOT find hdhomerun (missing: HDHOMER - MatthewLundberg - 2017-04-23 In addition to the above, of course I needed to specify the 32-bit object format, and define the symbol LIBHDHOMERUN_DLLEXPORT which here adorns the API functions with __declspec(dllexport). That causes the linker to emit a .lib file in addition to the .dll. Here's the build script that I used: Code: pushd "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC" The next problem was the Findhdhomerun.cmake, to find the headers and library. I added PATHS statements to point to where I put the hdhomerun source and DLL, which did find it. I am not sure how it's supposed to find them, as an environment variable doesn't seem to be used. Then cmake decided that I wanted to find a .DLL file instead of a .LIB file as you need for MSVC. I included a "set" for Windows, as it does not find the settings. This works for both Windows and Linux. For Windows, the libhdhomerun directory should be beside the pvr.hdhomerun and xbmc directories, and it is found with a relative path. Code: find_package(PkgConfig) Edited to change the cmake file, for one that works on both Linux and Windows. RE: Building on Windows - CMake Error Could NOT find hdhomerun (missing: HDHOMERUN_LI ... - MatthewLundberg - 2017-06-03 The last piece of getting the PVR to build on Windows is to fix the build instructions. There's a typo, a missing space. From the instructions: Code: cmake -G "Visual Studio 14" -DADDONS_TO_BUILD=pvr.hdhomerun -DCMAKE_BUILD_TYPE=Debug-DADDON_SRC_PREFIX=%ROOT% I didn't notice the missing space before, after the CMAKE_BULD_TYPE=Debug. Adding this lets cmake find the code. Prior to adding this, it was downloading the pvr.hdhomerun from git again, within the build tree. It's a complete mystery to me as to why this download happens, rather than emitting an error. Building on Windows - Cannot load DLL - MatthewLundberg - 2017-06-03 Unfortunately, even after the DLL is built and copied to the Kodi tree by the PVR build, it will not load. I will create a new thread. RE: Building on Windows - CMake Error Could NOT find hdhomerun (missing: HDHOMERUN_LI ... - MatthewLundberg - 2017-07-28 There's a bit deep in the tree that needs fixing, then cmake will download the code and build it. The depends/common/hdhomerun/hdhomerun.txt points to the code to download. Pointing it a valid ZIP file from github fixes the build, for both Windows and Linux, using the original Findhdhomerun.cmake file. The original had what looked like a SHA1, I put a tag name, neither was working. https://github.com/MatthewLundberg/pvr.hdhomerun/commit/9a898f3bc2e0459dc75c3e5cd6a5ae109a23664e |