<div dir="ltr"><div><div><div><div><div><div><div><div><div>Hi Karel,<br><br></div>I've noticed a few points where you could start looking for a solution:<br><br></div>* You're mentioning that CMake warns about some linking stuff, but the compiler error is one about including a header file. Libraries and headers are fundamentally different objects: header files are used by the compiler, libraries are used by the linker.<br><br></div><div>* Regarding the linking thing:<br></div><div><br><span style="font-family:monospace,monospace">AVRO_LIBRARY            - The Avro C++ libraries<br></span><span style="font-family:arial,helvetica,sans-serif"><br></span></div><span style="font-family:arial,helvetica,sans-serif">Yet you seem to be setting this to a directory: </span><br><span style="font-family:monospace,monospace"><br>set(AVRO_LIBRARY D:/kuleuven/thesis/kaa/kaaBuild/avro_1.8.0/lang/c++/build.win)<br><br></span></div><span style="font-family:monospace,monospace"><font face="arial,helvetica,sans-serif">when you're supposed to set it to a library (.lib file).</font><br><br></span></div><span style="font-family:arial,helvetica,sans-serif">* As for </span><span style="font-family:monospace,monospace"><font face="arial,helvetica,sans-serif">the header issue, you're setting:<br><br></font>set(AVRO_INCLUDE_DIR D:/kuleuven/thesis/kaa/kaaBuild/avro_1.8.0/lang/c++/avro)<font face="arial,helvetica,sans-serif"><br><br></font></span></div><span style="font-family:monospace,monospace"><font face="arial,helvetica,sans-serif">but then using:<br><br></font>include_directories (<br>                     ${AVRO_INCLUDE_DIRS}<br>                     )<br><font face="arial,helvetica,sans-serif"><br></font></span></div><span style="font-family:monospace,monospace"><font face="arial,helvetica,sans-serif">Note the difference in the trailing 'S'.<br><br></font></span></div><span style="font-family:monospace,monospace"><font face="arial,helvetica,sans-serif">* Additionally, variables like AVRO_INCLUDE_DIR and AVRO_LIBRARY look like something the find package should be setting *for* you. It doesn't seem like a package shipped with CMake, so consult its docs to check you're using it as intended.<br><br></font></span></div><span style="font-family:monospace,monospace"><font face="arial,helvetica,sans-serif">Petr<br></font></span></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 30, 2016 at 5:15 PM, Karel Geiregat <span dir="ltr"><<a href="mailto:karelgeiregat@gmail.com" target="_blank">karelgeiregat@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Dear users at Cmake<br><br><br></div>It could be that I don't have understood the linking process when building the project by cmake. The project has three dependencies: (1) Boost, (2) (Apache) Avro and (3) Botan.<br>After issuing the following command to be able to use the nmake command from Visual Studio:<br><br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><span style="font-family:monospace,monospace">D:\...\build>cmake -G "NMake Makefiles" -DKAA_INSTALL_PATH="D:\kaa\kaaSDK" -DKAA_DEBUG_ENABLED=1 ..</span><br></blockquote><br></div><div>It ran without problems, except minor warnings like <br></div><div><br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><span style="font-family:monospace,monospace">WARNING: Target "kaacpp" requests linking to directory "D:/kaa/kaaBuild/avro_1.8.0/lang/c++/build.win".  Targets may link only to libraries.  CMake is dropping the item.</span><br></blockquote></div><div><span style="font-family:arial,helvetica,sans-serif">=> note: full log is at the bottom of this mail (appendix 1).</span><span style="font-family:monospace,monospace"><br><br></span></div><div>but when i call nmake after, it immediately throws up error:<br></div><div><br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><span style="font-family:monospace,monospace">D:\...\build>nmake<br><br>Microsoft (R) Program Maintenance Utility Version 14.00.23506.0<br>Copyright (C) Microsoft Corporation.  All rights reserved.<br><br>Scanning dependencies of target kaacpp_o<br>[  1%] Building CXX object CMakeFiles/kaacpp_o.dir/impl/event/registration/EndpointRegistrationManager.cpp.obj<br>EndpointRegistrationManager.cpp<br>D:\kaa\kaa-cpp-ep-sdk-aXrMkhHEE2BrPBehV_Vbxym2MfU\kaa/gen/EndpointGen.hpp(26): fatal error C1083: Cannot open include file: 'avro/Specific.hh': No such file or directory<br>NMAKE : fatal error U1077: 'C:\PROGRA~2\VISUAL~1.0\VC\bin\cl.exe' : return code '0x2'<br>Stop.<br>NMAKE : fatal error U1077: '"C:\Program Files (x86)\Visual Studio 14.0\VC\BIN\nmake.exe"' : return code '0x2'<br>Stop.</span><br></blockquote><br></div><div>I have checked the file, and there is the following includes<br><br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><span style="font-family:monospace,monospace">#include <sstream><br>#include "boost/any.hpp"<br>#include "avro/Specific.hh" <-------- error line<br>#include "avro/Encoder.hh"<br>#include "avro/Decoder.hh"</span><br></blockquote></div><div><br></div><div>My idea is that the linking of the avro library is not set up correctly since the error got thrown after including a Boost file.<br></div><div>Here is a fragment of my cmakelists.txt file where Avro got added and how the packages got found/added<br><br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><span style="font-family:monospace,monospace">#  AVRO_ROOT_DIR           - Set this variable to the root installation of  Avro C++ if the module has problems finding the proper installation path.<br>#  AVRO_LIBRARY            - The Avro C++ libraries<br>#  AVRO_INCLUDE_DIR        - The location of Avro C++ headers<br>set(AVRO_ROOT_DIR D:/kuleuven/thesis/kaa/kaaBuild/avro_1.8.0/lang/c++)<br>set(AVRO_LIBRARY D:/kuleuven/thesis/kaa/kaaBuild/avro_1.8.0/lang/c++/build.win)<br>set(AVRO_INCLUDE_DIR D:/kuleuven/thesis/kaa/kaaBuild/avro_1.8.0/lang/c++/avro)<br></span></blockquote><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><div> </div></blockquote><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><div>some contents omitte </div></blockquote><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><div> </div></blockquote><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><span style="font-family:monospace,monospace">#<br># Find third-party dependencies<br>#<br>find_package (Boost 1.54 REQUIRED COMPONENTS log system thread)<br>find_package (Avro REQUIRED)<br>find_package (Botan REQUIRED)</span><br></blockquote>=> note: full cmakelist.txt file is added as appendix2<br><br><br></div><div>After that, i have issued the following messaging<br><br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><span style="font-family:monospace,monospace">message("--- AVRO: Found? " ${AVRO_FOUND}) <----- displays "</span><span style="font-family:monospace,monospace">--- AVRO: Found? TRUE"<br>message(${AVRO_LIBRARIES})</span><span style="font-family:monospace,monospace"> <----- displays "</span><span style="font-family:monospace,monospace">D:/kaa/kaaBuild/avro_1.8.0/lang/c++/build.win"</span></blockquote></div><div><br></div><div><br>So, the library can be found. However, it surprises me that the specific file, Specific.hh could not be found while it is in the include directory, AVRO_INCLUDE_DIR (according to the <a href="https://github.com/Produban/log2kafka/blob/master/cmake/FindAvroCPP.cmake#L33" target="_blank">findavrocpp.cmake</a> it's used for headers).<br></div><div><div>I have issued the following PowerShell command to show that the file is in the given directory<br><br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><span style="font-family:monospace,monospace">PS D:\kaa\kaaBuild\avro_1.8.0\lang\c++\avro> Get-childitem Specific.hh</span><br><span style="font-family:monospace,monospace"></span><br><span style="font-family:monospace,monospace">    Directory: D:\kaa\kaaBuild\avro_1.8.0\lang\c++\avro</span><br><span style="font-family:monospace,monospace"></span><br><span style="font-family:monospace,monospace">Mode                LastWriteTime         Length Name</span><br><span style="font-family:monospace,monospace">----                -------------         ------ ----</span><br><span style="font-family:monospace,monospace">-a----         2/9/2012   7:11 PM           7428 Specific.hh</span><br></blockquote><br></div><div><br>So it could be that it is not linking correctly. Is the cmakelist.txt incorrect or is cmake unable to link the right header file without throwing an error ?<br></div><div>Is there a solution for this ? I don't have a clue where to find the cause of the linking problems so i can solve it.<br><br></div><div>If you need more information, please check the appendix 1 & 2 here below. If these isn't sufficient enough, please inform me which information i can provide.<br></div><div><br></div><div>Sincerely <br></div><div>- kg<br></div><br><br><br></div><div><u>APPENDIX 1: output of cmake command</u><br></div><div><br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><font size="1"><span style="font-family:monospace,monospace">D:\kaa\kaa-cpp-ep-sdk-aXrMkhHEE2BrPBehV_Vbxym2MfU\build>cmake -G "NMake Makefiles" -DKAA_INSTALL_PATH="D:\kaa\kaaSDK" -DKAA_DEBUG_ENABLED=1 ..<br>==================================<br>CMake Warning (dev) at CMakeLists.txt:73 (if):<br>  Policy CMP0054 is not set: Only interpret if() arguments as variables or<br>  keywords when unquoted.  Run "cmake --help-policy CMP0054" for policy<br>  details.  Use the cmake_policy command to set the policy and suppress this<br>  warning.<br><br>  Quoted variables like "MSVC" will no longer be dereferenced when the policy<br>  is set to NEW.  Since the policy is not set the OLD behavior will be used.<br>This warning is for project developers.  Use -Wno-dev to suppress it.<br><br>==================================<br>KAA_MAX_LOG_LEVEL=6<br>EVENTS ENABLED<br>NOTIFICATIONS ENABLED<br>CONFIGURATION ENABLED<br>LOGGING ENABLED<br>OPERATION_TCP_CHANNEL ENABLED<br>OPERATION_LONG_POLL_CHANNEL ENABLED<br>OPERATION_HTTP_CHANNEL ENABLED<br>BOOTSTRAP_HTTP_CHANNEL ENABLED<br>CONNECTIVITY_CHECKER ENABLED<br>KAA_THREADSAFE ENABLED<br>==================================<br>-- Boost version: 1.60.0<br>-- Found the following Boost libraries:<br>--   log<br>--   system<br>--   thread<br>--   date_time<br>--   log_setup<br>--   filesystem<br>--   regex<br>--   chrono<br>--   atomic<br><br>Looking for Avro C++ headers and libraries<br>-- Root dir: D:/kaa/kaaBuild/avro_1.8.0/lang/c++<br>-- Include directories: D:/kaa/kaaBuild/avro_1.8.0/lang/c++/avro<br>-- Libraries: D:/kaa/kaaBuild/avro_1.8.0/lang/c++/build.win<br>-- FindBotan check<br>-- BOTAN_HOME is not empty: "D:/kaa/kaaBuild/botan-1.11.29"<br>-- Looking for botan in D:/kaa/kaaBuild/botan-1.11.29<br>-- Include directory: D:/kaa/kaaBuild/botan-1.11.29/build/include<br>-- Library: D:/kaa/kaaBuild/botan-1.11.29/botan.lib<br><br>checking libraries<br>--- BOTAN: Found? YES<br>D:/kaa/kaaBuild/botan-1.11.29/botan.lib<br>--- AVRO: Found? TRUE<br>D:/kaa/kaaBuild/avro_1.8.0/lang/c++/build.win<br>--- BOOST: Found?<br>optimizedD:/software/boost_1_60_32/lib32-msvc-14.0/boost_log-vc140-mt-1_60.libdebugD:/software/boost_1_60_32/lib32-msvc-14.0/boost_log-vc140-mt-gd-1_60.liboptimizedD:/software/boost_1_60_32/lib32-msvc-14.0/boost_system-vc140-mt-1_60.libdebugD:/software/boost_1_60_32/lib32-msvc-14.0/boost_system-vc140-mt-gd-1_60.liboptimizedD:/software/boost_1_60_32/lib32-msvc-14.0/boost_thread-vc140-mt-1_60.libdebugD:/software/boost_1_60_32/lib32-msvc-14.0/boost_thread-vc140-mt-gd-1_60.liboptimizedD:/software/boost_1_60_32/lib32-msvc-14.0/boost_date_time-vc140-mt-1_60.libdebugD:/software/boost_1_60_32/lib32-msvc-14.0/boost_date_time-vc140-mt-gd-1_60.liboptimizedD:/software/boost_1_60_32/lib32-msvc-14.0/boost_log_setup-vc140-mt-1_60.libdebugD:/software/boost_1_60_32/lib32-msvc-14.0/boost_log_setup-vc140-mt-gd-1_60.liboptimizedD:/software/boost_1_60_32/lib32-msvc-14.0/boost_filesystem-vc140-mt-1_60.libdebugD:/software/boost_1_60_32/lib32-msvc-14.0/boost_filesystem-vc140-mt-gd-1_60.liboptimizedD:/software/boost_1_60_32/lib32-msvc-14.0/boost_regex-vc140-mt-1_60.libdebugD:/software/boost_1_60_32/lib32-msvc-14.0/boost_regex-vc140-mt-gd-1_60.liboptimizedD:/software/boost_1_60_32/lib32-msvc-14.0/boost_chrono-vc140-mt-1_60.libdebugD:/software/boost_1_60_32/lib32-msvc-14.0/boost_chrono-vc140-mt-gd-1_60.liboptimizedD:/software/boost_1_60_32/lib32-msvc-14.0/boost_atomic-vc140-mt-1_60.libdebugD:/software/boost_1_60_32/lib32-msvc-14.0/boost_atomic-vc140-mt-gd-1_60.lib<br>done checking libraries<br><br>-- KAA WILL BE INSTALLED TO C:/Program Files (x86)/Kaa-cpp<br>-- Configuring done<br>WARNING: Target "kaacpp" requests linking to directory "D:/kaa/kaaBuild/avro_1.8.0/lang/c++/build.win".  Targets may link only to libraries.  CMake is dropping the item.<br>-- Generating done<br>-- Build files have been written to: D:/kaa/kaa-cpp-ep-sdk-aXrMkhHEE2BrPBehV_Vbxym2MfU/build</span></font><br></blockquote><br><br><br></div><div><u>APPENDIX 2: cmakelists.txt file</u><br></div><div><br></div><div>File consists of 300+ lines, so uploaded it. See upload on my google drive: <a href="https://drive.google.com/open?id=0B-1WvUfrCC3MUHR5dGZmVUdhY0U" target="_blank">https://drive.google.com/open?id=0B-1WvUfrCC3MUHR5dGZmVUdhY0U</a><br></div><div><br><br></div><div><br></div><div>// EOF<br></div></div>
<br>--<br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/cmake" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/cmake</a><br></blockquote></div><br></div>