<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:1040013439;
        mso-list-type:hybrid;
        mso-list-template-ids:-273230522 67698705 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
        {mso-level-text:"%1\)";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></style>
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt">AIX supports two types of shared libraries, AIX-style, and System 5 (SYSV) compatibility libraries.  CMake is currently set up to exclusively work with SYSV-style (read the ld man pages for -brtl).<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">To do this I’m attempting to set the commands to override linking shared libraries.  The default setup forces generating an exports list, which also gives me problems because I explicitly provide one (that
 is then overridden by the generated list, which comes out empty in my case).  The set commands below almost work, one of the problems is that I can’t see any way to pass flags to commands like “/bin/ar”.  Under AIX, tools like ar, nm, etc. have a strict “object
 file mode” that can be altered with the -X command line argument.  I couldn’t find any place to pass -X64 or -X32 to /bin/ar, and setting CMAKE_AR with a space in it results in CMAKE_AR==”/bin/ar;-X64” which is not what I want.  Adding double quotes fails
 because they aren’t escaped, so the command ends up being  sent with argv[0]==”/bin/ar -X64” which fails.  Escaping the space like you see below results in the same behavior.   I don’t have any static archives in the project, but I’m pretty sure there would
 be problems with them.   I want to create the output of the first command to look like the target filename but with a file extension of “so” rather than “a” but I don’t see any way to do that.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">    elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "AIX")<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">        if(${CMAKE_CXX_COMPILER_ID} STREQUAL "XL")<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">            if(CMAKE_SIZEOF_VOID_P MATCHES "8")<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">                set(CMAKE_AR /bin/ar\ -X64)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">            else()<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">                set(CMAKE_AR /bin/ar\ -X32)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">            endif()<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">            # override the broken commands cmake uses to build shared libs on AIX with XLC<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">            set(CMAKE_SHARED_LIBRARY_SUFFIX ".a")<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">            set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">            set(CMAKE_SHARED_LINKER_FLAGS_INIT "")<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">            set(CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES ".so")<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">            set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-bM:SRE -bnoentry")<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">            set(CMAKE_CXX_CREATE_SHARED_LIBRARY<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">                "<CMAKE_CXX_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS>  <SONAME_FLAG><TARGET_SONAME> -o <OBJECT_DIR>/shr.so <OBJECTS>
 <LINK_LIBRARIES>;<CMAKE_AR> -cru <TARGET> <OBJECT_DIR>/shr.so"<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">                 )<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="392" style="width:293.8pt;margin-left:-5.4pt;border-collapse:collapse">
<tbody>
<tr style="height:66.75pt">
<td width="101" style="width:76.0pt;padding:0in 5.4pt 0in 5.4pt;height:66.75pt">
<p class="MsoNormal" align="center" style="text-align:center;text-autospace:none">
<span style="font-size:11.0pt"><img width="87" height="87" style="width:.9062in;height:.9062in" id="Picture_x0020_1" src="cid:image001.png@01D49622.98B4FEC0" alt="cid:image002.png@01D3D0E3.DCFE6710"><o:p></o:p></span></p>
</td>
<td width="290" style="width:217.8pt;padding:0in 5.4pt 0in 5.4pt;height:66.75pt">
<p class="MsoNormal" style="text-autospace:none"><b><span style="font-size:11.0pt;font-family:"Arial",sans-serif;color:#E83C21">Rob Boehne</span></b><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Arial",sans-serif">Senior Software Architect | Datalogics, Inc.</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:11.0pt"><a href="tel:(312)%20853-8351"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#0B4CB4">+1.312.853.8351</span></a></span><span style="font-size:10.0pt;font-family:"Arial",sans-serif"> | <a href="mailto:robb@datalogics.com"><span style="color:#0B4CB4">robb@datalogics.com</span></a></span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:11.0pt"><a href="http://www.datalogics.com/"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#0B4CB4">datalogics.com</span></a></span><span style="font-size:10.0pt;font-family:"Arial",sans-serif"> | <a href="http://blogs.datalogics.com/"><span style="color:#0B4CB4">blogs.datalogics.com</span></a></span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Arial",sans-serif">Connect with us: <a href="https://www.facebook.com/DatalogicsInc"><span style="color:#0B4CB4">Facebook</span></a> | <a href="https://twitter.com/DatalogicsInc"><span style="color:#0B4CB4">Twitter</span></a> | <a href="https://www.linkedin.com/company/datalogics?actionToken=p=p%3Dbiz-company-login%26c%3D3217e65a-bdc2-4b38-8f9c-13c982e8c529%26m%3Dcompany_feed%26n%3D0&t=a%3DisFolloweeOfPoster%253Dfalse%2526distanceFromActor%253D-1%2526actorType%253D%2526likedByUser%253Dfalse%2526targetId%253D%2526recentCommentUrns%253D%2526targetType%253D%2526sponsoredFlag%253DORGANIC%2526verbType%253Dlinkedin%25253Ashare%2526objectType%253Dlinkedin%25253Aarticle%2526totalShares%253D0%2526activityId%253Durn%25253Ali%25253Aactivity%25253A6263731876121362433%2526recentLikerUrns%253D%2526actorId%253Durn%25253Ali%25253Acompany%25253A14000%2526totalComments%253D0%2526relevanceScore%253D0.0%2526recentCommenterUrns%253D%2526isPublic%253Dtrue%2526time%253D-1%2526totalLikes%253D0%2526objectId%253Durn%25253Ali%25253Aarticle%25253A7793179909183391510%2526distanceFromNestedActor%253D-1%26s%3DORG"><span style="color:#0B4CB4">LinkedIn</span></a> | <a href="https://www.youtube.com/user/Datalogics"><span style="color:#0B4CB4">YouTube</span></a></span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> </span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>