<div dir="ltr">Possible easier to spot if you post the whole CMakeLists.txt file. </div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Jul 27, 2013 at 7:29 AM, Zack Perry <span dir="ltr"><<a href="mailto:zack.perry@sbcglobal.net" target="_blank">zack.perry@sbcglobal.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I have been trying to build RPM packages for libc++ 3.3 on a RHEL 6.4 box. I need both static and shared libraries. So, I learned some basics of cmake and then modified the bundled CMakeList.txt. Got that part to work.<br>
<br>
But since in RHEL 6.x, all 64-bit libraries should go to /usr/lib64 instead of /usr/lib, I have been attempting to use the following to get the job done:<br>
<br>
(A) During building, I use<br>
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib${LIB_SUFFIX})<br>
to have all library files (*.so* and *.a) located in lib64 rather than lib.<br>
<br>
(B) Using a ADD_LIBRARY... command as shown below<br>
ADD_LIBRARY(c++ STATIC ...<br>
together with<br>
set_target_properties(c++ PROPERTIES ARCHIVE_OUTPUT_DIRECTORY${PROJECT_BINARY_DIR}/lib${LIB_SUFFIX}) INSTALL(TARGETS c++ ARCHIVE DESTINATION lib${LIB_SUFFIX})<br>
to get the static library installed in /usr/lib64.<br>
<br>
(C) In addition, with<br>
INSTALL(FILES ${PROJECT_BINARY_DIR}/lib${LIB_SUFFIX}/libc++.so DESTINATION lib${LIB_SUFFIX})<br>
INSTALL(FILES ${PROJECT_BINARY_DIR}/lib${LIB_SUFFIX}/libc++.so.1 DESTINATION lib${LIB_SUFFIX})<br>
INSTALL(FILES ${PROJECT_BINARY_DIR}/lib${LIB_SUFFIX}/libc++.so.1.0 DESTINATION lib${LIB_SUFFIX})<br>
to have shared libary also installed in /usr/lib64 too.<br>
<br>
But a copy of the shared library is still installed in /usr/lib in the resulting RPM; see below:<br>
<br>
$ rpm -qlp libcxx-3-3-0.el6.x86_64.rpm<br>
[...]<br>
/usr/lib<br>
/usr/lib/libc++.so<br>
/usr/lib/libc++.so.1<br>
/usr/lib/libc++.so.1.0<br>
/usr/lib64<br>
/usr/lib64/libc++.a<br>
<br>
/usr/lib64/libc++.so<br>
/usr/lib64/libc++.so.1<br>
/usr/lib64/libc++.so.1.0<br>
<br>
<br>
<br>
If I were to write a RPM spec file, the _libdir macro automatically handles this. With cmake, given the fact that I am still new to it, I would appreciate a hint/pointer as to the right directive to use. <br>
<br>
-- Zack<br>
<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><br>David Irvine<div><div>twitter: @metaquestions</div><div>blog: <a href="http://metaquestions.me" target="_blank">http://metaquestions.me</a></div>
</div></div>
</div>