achille-roussel / nanomsgxx

Nanomsg binding for C++11
MIT License
114 stars 35 forks source link

nanomsg header files not found when building #1

Open vguerra opened 10 years ago

vguerra commented 10 years ago

hi @achille-roussel,

I saw your post on the nanomsg mailing list about your binding and wanted to give it a try. Unfortunately the build process brakes on my system b/c the nanomsg header files are not found. I was able to go through trough the 'waf configuration' by simply setting the LINKFLAGS to the location where my nanomsg library file resides; so the configuration script can report that nanomsg was found. But when building waf seems to ignore some enviroment variables I could set to tell it where to find the nanomsg headers ( https://code.google.com/p/waf/wiki/EnvironmentVariables#Variables_that_affect_waf_configure ).

I am missing something here? Is there another way I can tell waf to include those directories when building ?.

While reading a bit about waf, I saw that there is support to query info about installed libraries using pkg-config. Nanomsg installation process provides already such file, so I modified the wscript to query the flags needed when compiling and path of the library file:

https://gist.github.com/vguerra/83e38ed0a9275af08d7c

What do you think about that approach? .. The only down-side that I see is that pkg-config would be required to build the binding.

Have a great one.. and thank you!

vguerra commented 10 years ago

waf seems pretty cool =) and easy to understand ( so far ) .... I injected a couple of lines to the waf script so that a pkg-config file is generated for nanomsgxx: https://github.com/vguerra/nanomsgxx/commit/99b3d1b5935f0b880e39f661a5c5cc1323ee320b

Not sure if this is the right way of doing things, but I can create a pull request if that is ok with you.

achille-roussel commented 10 years ago

Hello, I'm sorry I had my email settings misconfigured on github and I missed that issue you opened, just saw it now. Thanks for giving it a try and for submitting this patch. The changes look good, can you tell me what system did you try it on? I'm concerned about windows support (unsure how waf is going to behave if it depends on pkg-config). I've just setup a windows box to work on it so I'll give your patch a try at the same time and see how it goes.

Cheers!

vguerra commented 10 years ago

Hi @achille-roussel!

No worries... thank you for responding =).

Sorry that I forgot to mention that I am running on mac os x:

➜ ~ uname -a Darwin tlf32.wu-wien.ac.at 13.2.0 Darwin Kernel Version 13.2.0: Thu Apr 17 23:03:13 PDT 2014; root:xnu-2422.100.13~1/RELEASE_X86_64 x86_64

pkg-confg should work as well on win but no clue how waf would behave, let me know how the test goes.

Cheers,