Thanks. But it still means that I have to construct the .lib file name sort of manually. And possibly put some IF(WIN32)'s in my CMakeLists.txt. I would much prefer to have a list of all files that were produced by given target. -- Regards, Tomasz Grobelny
On Mon, 07 Nov 2011 08:27:08 -0500 (EST), Tim Gallagher <[email protected]> wrote: > I think the CMAKE_SHARED_LIBRARY_PREFIX/CMAKE_SHARED_LIBRARY_SUFFIX > variables would tell you what you want. We use them to determine the output > name as: > > ${CMAKE_SHARED_LIBRARY_PREFX}<library target > name>${CMAKE_SHARED_LIBRARY_SUFFIX} > > We also have an if statement in case STATIC libraries are built, in which > case you just replace SHARED with STATIC in the variable names. > > These came from: > > http://cmake.org/Wiki/CMake_Useful_Variables > > Tim > > ----- Original Message ----- > From: "Tomasz Grobelny" <[email protected]> > To: [email protected] > Sent: Monday, November 7, 2011 8:23:10 AM > Subject: [CMake] get name of .lib file > > I have a library created like this: > add_library(mylib SHARED ${SOURCES} ${PRIVATE_HEADERS} > ${PUBLIC_HEADERS}) > Now I want to get names of all output files for mylib target (on Unix this > would be .so file, but on Windows it would be .dll, .lib and possibly .pdb > files). Is there any better way to get those names without constructing > them manually eg. using get_filename_component from main file? I get the > main file as follows: > get_property(location TARGET mylib PROPERTY LOCATION) > Are there any other properties that would give me the other names? -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
