<div>I have a build that depends on the output from another build. We can't combine the code into one build due to other issues.</div><div> </div><div>I need to get cmake to pass the values of the libraries I want to link against. I have worked out a find script for my second build that allows me to use the find_library command to pull the .lib file that I'm looking for. However, I must force the user to specify the specific name of the library and I need to avoid this and just be able to pick up the value if the name passes validation and the version is any number since ultimately this whole process will be automated and I don't want to have to worry about specifying version numbers.</div>
<div> </div><div>My first build creates a directory</div><ul><li>build</li><ul><li>win64</li><li>VC10</li><li>bin</li><li>Release</li><ul><li>filea1231.1.1.1.lib</li><li>fileb2341.1.1.1.lib</li><li>filec3451.1.1.1.lib</li>
</ul></ul></ul><p> </p><div>For the second build I force the user to tell me the path of the build directory (i.e. C:\build\win64\VC10\bin\Release and assign this to a value of first_build_dir)</div><div> </div><div>I then have a find script where I am trying to find the library (i.e. filea1231.1.1.1)</div>
<div> </div><div>set (file_name filea1231.1.1.1)</div><blockquote style="margin-right:0px" dir="ltr"><div>find_library(my_library</div><blockquote style="margin-right:0px" dir="ltr"><div>name ${file_name}</div><div>PATHS ${first_build_dir}</div>
<div>)</div><div> </div></blockquote></blockquote><div dir="ltr">The problem I have is that the filea1231.1.1.1 might change for the next build (i.e filea1231.1.1.2). There is only one file named filea so I'd like to be able to search for filea*.lib no matter what the versioning information contains.</div>
<div dir="ltr"> </div><div dir="ltr">I thought I needed to go down the path of using a string(regex match([filea0-9]+\\.[0-9]\\.[0-9]\\.[0-9] file_name) however I can't figure out how to make this work in my current situation. </div>
<div dir="ltr"> </div><div dir="ltr">I then went down the path of trying the file(strings filea*.lib file_name) option but it returned my ${first_build_dir} path</div><div dir="ltr"> </div><div dir="ltr">I'm looking for suggestions on how to handle pulling the changing file name within cmake for use at anytime.</div>
<div dir="ltr"> </div><div dir="ltr">Thanks</div><div dir="ltr"> </div><div dir="ltr"> </div><div dir="ltr"> </div>