On Tue, Apr 13, 2010 at 4:57 PM, J Decker <span dir="ltr"><<a href="mailto:d3ck0r@gmail.com">d3ck0r@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
There's no way to set properties like LANGUAGE on files in a library<br>
seperatly if those files are used in another library also...<br>
<br>
PROJECT( project1 )<br>
ADD_EXECUTABLE( ${PROJECT_NAME} sourcefile.c )<br>
GET_TARGET_PROPERTY(SOURCES ${PROJECT_NAME} SOURCES)<br>
set_source_files_properties( ${SOURCES} PROPERTIES LANGUAGE "CXX" )<br>
<br>
<br>
PROJECT( project2 )<br>
ADD_EXECUTABLE( ${PROJECT_NAME} sourcefile.c )<br>
GET_TARGET_PROPERTY(SOURCES ${PROJECT_NAME} SOURCES)<br>
set_source_files_properties( ${SOURCES} PROPERTIES LANGUAGE "C" )<br>
<br></blockquote><div><br>I think that would work if you ran the two commands from CMakeLists.txt files that were in separate directories (i.e. different directory scopes).<br> <br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
Also, there's no way to just get the list of target outputs that a<br>
executable or library was linked with?<br>
<br>
TARGET_LINK_LIBRARIES( ${PROJECT_NAME} libxyz )<br>
<br>
I tried to use<br>
<br>
<br>
GET_TARGET_PROPERTY(LIBS2 ${proj} IMPORTED_LINK_INTERFACE_LIBRARIES )<br>
message( "libs: ${LIBS2}" )<br>
GET_TARGET_PROPERTY(LIBS ${proj} IMPORTED_LINK_DEPENDENT_LIBRARIES )<br>
message( "libs: ${LIBS}" )<br>
<br>
but the results are LIBS-NOTFOUND and LIBS2-NOTFOUND ....<br>
<br>
This CMAKE installation steps seem to be unix-centric, in expecting to<br>
target a consistant /usr/local/bin or /usr/bin etc for installation<br>
targets. This particular tree that I'm slowly migrating actually has<br>
about a dozen individual targets, and each final installation needs to<br>
include the program itslef, maybe some data associated with it and all<br>
of the libraries it requires to link. Each product needs to be self<br>
contained, and I would think that cmake would have the target names of<br>
all products built available that I could just get that list to copy<br>
all of those into a final installation directory?<br></blockquote><div><br>One thing to keep in mind is that the INSTALL(TARGETS) command needs to be called from the same directory the target is is defined.<br><br>The IMPORTED_* properties don't apply to targets that were built by CMake, but rather targets whose information was imported from another project (see the install(EXPORT) command documentation).<br>
<br>Outside of that, I'm not sure how to get the list of dependent targets from a target.<br><br>James </div></div>