<div>I think you're misunderstanding how to use cmake: when I said set a variable I meant a cmake variable and not a shell variable.</div><div><br></div><div>You set a cmake variable by adding a -DVARIABLE_NAME=VALUE to the command line.</div>
<div><br></div><div>To be more concrete, lets say you have your rabbitmq-c source tree in:</div><div>c:\dev\rabbitmq-c</div><div>And have built the project in-source using MSVC</div><div><br></div><div>You have boost v1.47.0 in, and its built with shared libraries</div>
<div>c:\dev\boost-1.47.0</div><div><br></div><div>The appropriate cmake command might look something like:</div><div>$ cmake -DBOOST_ROOT=c:\dev\boost-1.47.0 -DBoost_ADDITIONAL_VERSIONS="1.47.0" -DRabbitmqc_INCLUDE_DIR=c:\dev\rabbitmq-c\librabbitmq -DRabbitmqc_LIBRARY=c:\dev\rabbitmq-c\librabbitmq\Debug\rabbitmq.lib</div>
<div><br></div><div>You can also use the cmake-gui program to set these variables.</div><div><br></div><div>That said: the FindRabbitmq.cmake module does not expect to find the headers and the libraries in a source, or build tree. It expects to find these in an 'install tree', which basically copies the correct files to a known location and structure: headers in ${PREFIX}/include libraries in ${PREFIX}/lib and executables in ${PREFIX}/bin. On linux/unix ${PREFIX} is usually /usr/local, on windows its in C:\Program Files\${ProjectName} - which I personally don't like.</div>
<div><br></div><div>My recommendation would be to run cmake-gui in your rabbitmq-c build and set the CMAKE_INSTALL_PREFIX to something like c:\dev\install, then build the 'INSTALL' project which will copy the appropriate files to an install tree in c:\dev\install</div>
<div><br></div><div>You can then either add c:\dev\install\include and c:\dev\install\lib paths to the INCLUDE and LIB environment variables or you can set the cmake variable Rabbitmqc_DIR to c:\dev\install when running cmake against SimpleAmqpClient, and save having to specify the Rabbitmqc_INCLUDE_DIR and Rabbitmqc_LIBRARY individually.</div>
<div><br></div><div>Note that since rabbitmq is built as a shared library (DLL on windows) by default, you'll need to have the rabbitmq.dll in a place that windows can find it (putting these in the same directory as the executable or adding the path containing the DLL to the PATH environment variable.</div>
<div><br></div><div>HTH</div><div>-Alan</div><br><div><div class="gmail_quote">On Fri, Mar 2, 2012 at 7:55 AM, Eric J. Holtman <span dir="ltr"><<a href="mailto:eric@holtmans.com">eric@holtmans.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 3/1/2012 10:59 PM, Alan Antonuk wrote:<br>
<br>
><br>
> *For finding Rabbitmq-c* I wrote a FindRabbitmqc.cmake (in the Modules<br>
<div class="im">> directory).<br>
><br>
> It searches for the amqp.h file in:<br>
> ${Rabbitmqc_DIR}/include<br>
> Then your system paths<br>
><br>
> If it doesn't pick it up automatically you set Rabbitmqc_INCLUDE_DIR to the<br>
> directory containing the amqp.h file by hand.<br>
><br>
> It searches for the rabbitmq library (librabbitmq.a/librabbitmq.so on *nix<br>
> rabbitmq.lib/.dll on windows) in:<br>
> ${Rabbitmq_DIR}/lib<br>
> Then your system include paths<br>
><br>
> If it doesn't pick it up automatically, you can set Rabbitmqc_LIBRARY to<br>
> the filename of the library by hand.<br>
><br>
> Hope that helps.<br>
><br>
<br>
<br>
</div>I tried that:<br>
<br>
C:\rabbit-c\simpleamqpclient-build>dir %Rabbitmqc_INCLUDE_DIR%\amqp.h<br>
Volume in drive C has no label.<br>
Volume Serial Number is 60C2-C1FC<br>
<br>
Directory of c:\rabbit-c\rabbitmq-c\librabbitmq<br>
<br>
02/15/2012 03:00 PM 14,097 amqp.h<br>
1 File(s) 14,097 bytes<br>
0 Dir(s) 36,886,913,024 bytes free<br>
<br>
so, amqp.h is in the right place.<br>
<br>
C:\rabbit-c\simpleamqpclient-build>dir %Rabbitmqc_LIBRARY%\rabbitmq.*<br>
Volume in drive C has no label.<br>
Volume Serial Number is 60C2-C1FC<br>
<br>
Directory of c:\rabbit-c\rabbitmq-c-build\librabbitmq\Debug<br>
<br>
02/22/2012 01:15 PM 108,544 rabbitmq.dll<br>
02/15/2012 05:03 PM 9,383 rabbitmq.exp<br>
02/22/2012 01:15 PM 265,216 rabbitmq.idb<br>
02/22/2012 01:15 PM 386,320 rabbitmq.ilk<br>
02/15/2012 05:03 PM 16,132 rabbitmq.lib<br>
02/22/2012 01:15 PM 815,104 rabbitmq.pdb<br>
6 File(s) 1,600,699 bytes<br>
0 Dir(s) 36,886,913,024 bytes free<br>
<br>
.dll/.lib in the right place:<br>
<br>
<br>
C:\rabbit-c\simpleamqpclient-build>cmake ..\SimpleAmqpClient<br>
-- Building for: Visual Studio 9 2008<br>
-- Check for working C compiler using: Visual Studio 9 2008<br>
-- Check for working C compiler using: Visual Studio 9 2008 -- works<br>
-- Detecting C compiler ABI info<br>
-- Detecting C compiler ABI info - done<br>
-- Check for working CXX compiler using: Visual Studio 9 2008<br>
-- Check for working CXX compiler using: Visual Studio 9 2008 -- works<br>
-- Detecting CXX compiler ABI info<br>
-- Detecting CXX compiler ABI info - done<br>
-- Boost version: 1.47.0<br>
-- Found the following Boost libraries:<br>
-- chrono<br>
-- system<br>
Rabbitmqc_INCLUDE_DIR=Rabbitmqc_INCLUDE_DIR-NOTFOUND<br>
Rabbitmqc_LIBRARY=Rabbitmqc_LIBRARY-NOTFOUND<br>
CMake Error at Modules/LibFindMacros.cmake:74 (message):<br>
Required library Rabbitmqc NOT FOUND.<br>
<br>
Install the library (dev version) and try again. If the library is<br>
already<br>
installed, use ccmake to set the missing variables manually.<br>
Call Stack (most recent call first):<br>
Modules/FindRabbitmqc.cmake:19 (LIBFIND_PROCESS)<br>
CMakeLists.txt:12 (FIND_PACKAGE)<br>
<br>
<br>
-- Configuring incomplete, errors occurred!<br>
<br>
<br>
<br>
<br>
<br>
<br>
Still fails.<br>
<br>
I'm wondering if this is even worth the effort. (Not your wrapper,<br>
just the cmake process).<br>
<br>
Once I've gotten the C library itself to build (using python et al<br>
to build the framing files), I'm tempted to just extract the .c and<br>
.h files I need into a new Visual Studio project, and go from there.<br>
<br>
I understand the concept of cmake (trying to get a platform independent<br>
delivery base), but at this point, for a library with only really<br>
10 .c and .h files, I've got at least 4 directories, the .vcproj files<br>
have tons of -I directives, and......<br>
<br>
<br>
Anyway, after seeing the trace above, if you have any clues, I'd<br>
appreciate it.<br>
<div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
rabbitmq-discuss mailing list<br>
<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br>
<a href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br>
</div></div></blockquote></div><br></div>