<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div name="messageBodySection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">Yes, the most efficient way is using conditional setting. For example:
<div><br /></div>
<div>if (CMAKE_SIZEOF_VOID_P EQUAL 4)<br /></div>
<div> set(import_path /to/lib32)</div>
<div>else()</div>
<div> set(import_path /to/lib64)</div>
<div>endif()</div>
<div><br /></div>
<div>set_property(TARGET foo PROPERTY IMPORT_LOCATION "${import_path}/lib.so")</div>
<div><br /></div>
</div>
<div name="messageReplySection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">Le 21 déc. 2018 à 15:14 +0100, Lars <laasunde@hotmail.com>, a écrit :<br />
<blockquote type="cite" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #1abc9c;">
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;">Marc,</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;"><br /></div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;">Appreciate the quick and helpful response.</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;"><br /></div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;">In a config file that supports multiple platforms, do I need to create import_location_path variable and populate it depending on platform and 32/64 etc? Any other options?</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;"><br /></div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;">Thanks.</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;"><br /></div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;">Kind regards, Lars<br /></div>
<div>
<div id="appendonsend"></div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;"><br /></div>
<hr tabindex="-1" style="width: 98%; display: inline-block;" />
<div id="divRplyFwdMsg" dir="ltr"><font color="#000000" face="Calibri, sans-serif" style="font-size: 11pt;"><b>Fra:</b> Marc CHEVRIER <marc.chevrier@gmail.com><br />
<b>Sendt:</b> fredag 21. desember 2018 13.41<br />
<b>Til:</b> cmake@cmake.org; Lars<br />
<b>Emne:</b> Re: [CMake] set_property imported_location_release</font>
<div> </div>
</div>
<div>
<div style="font-size: 14px;" name="x_messageBodySection">Properties IMPORTED_LOCATION* do not support generator expressions.
<div><br /></div>
<div>Generally speaking, if a property supports generator expression, it is explicitly specified in documentation.</div>
</div>
<div style="font-size: 14px;" name="x_messageReplySection">Le 21 déc. 2018 à 13:07 +0100, Lars <laasunde@hotmail.com>, a écrit :<br />
<blockquote style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #e67e22;" type="cite">
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;">Hello,</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;"><br /></div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;">Trying to import an external library but having some issue with setting imported_location_release property.</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;"><br /></div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;">Basically I have config file which does this;</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;">add_library(foo STATIC IMPORTED)</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;">set_property(target foo APPEND PROPERTY</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;"> interface_include_directories</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;"> "$<BUILD_INTERFACE:${foot_root}/path>"</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;"> "$<INSTALL_INTERFACE:${foo_root}/foo>")</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;"><br /></div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;">set_property(TARGET foo APPEND PROPERTY</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;"> IMPORTED_LOCATION_RELEASE</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;"> $<$<CXX_COMPILER_ID:GNU>:${foo_root}/lib/release/foo.a>)</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;"><br /></div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;">The imported target is used in a target_link_libraries method;</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;">target_link_libraries(an_application foo)</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;"><br /></div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;">Running CMake 3.6.1 does not produce any warnings. Running make I get a "target pattern contains no '%'" error message with a reference to a Build.make file.</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;"><br /></div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;">The Build.make contains the string " $<$<CXX_COMPILER_ID:GNU>:/tmp/prototype/foo/lib/release/foo.a". We did not expect to see the generator expression in the Build.make file.</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;"><br /></div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;">Does set_property support generator expression in this context? What are we doing wrong?</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;"><br /></div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;">Appreciate any help :-)</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;"><br /></div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;">king regards, Lars</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;"><br /></div>
--<br />
<br />
Powered by www.kitware.com<br />
<br />
Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ<br />
<br />
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br />
<br />
CMake Support: http://cmake.org/cmake/help/support.html<br />
CMake Consulting: http://cmake.org/cmake/help/consulting.html<br />
CMake Training Courses: http://cmake.org/cmake/help/training.html<br />
<br />
Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html<br />
<br />
Follow this link to subscribe/unsubscribe:<br />
https://cmake.org/mailman/listinfo/cmake<br /></blockquote>
<div></div>
</div>
</div>
</div>
</blockquote>
<div></div>
</div>
</body>
</html>