Search code examples
cmakeenvironment-variablespoint-cloud-librarybin

setting external library /bin folder in cmake in windows


My question is related to PCL installation and here it goes:

I compiled PCL using MSVC2013 and I updated manually my PCLConfig.cmake to point to all its dependences (3rdParty libs). The problem is that I want also to set its binaries /bin folders in the same cmake file (instead of adding /bin to environment variables). Is there a way to do that ?

What makes this question pertinent is that I'am testing different versions of PCL (1.6, 1.7, 1.8...), so won't adding the /bin folders to path of all these versions will create some kind of confict between them afterwards (in the retreive step) ?

*To be clear, what i succeded to do is that, using cmake, I can choose the PCLConfig of the PCL version I want, but when running my program (succefully compiled), it throws a missing pcl_****.dll missing, which is logic because the PCL/bin folder is not added to the system environement. so, my question is "can I add the PCL/bin floder to the project environment using the CMakeLists of my project? (instead of adding it to system environment)"

Thanks in advance.


Solution

  • A temporary fix i found is generating my project with the specified PCL version wanted and then Adding the bin folders manually in MSVC 2013 :

    Debugging->Environment << PATH=path_to_lib\lib;%PATH%

    Tsyvarev, I'm looking for your proposition and I'll let you know if it worked. Looks like a cleaner way... Cheers,