This forum has been archived. All content is frozen. Please use KDE Discuss instead.

cmake output directory

Tags: None
(comma "," separated)
User avatar
mio
Registered Member
Posts
25
Karma
0
OS

cmake output directory

Wed Oct 14, 2009 7:03 pm
I am linking my plugin to qqmp qt-based multimedia player. Why cmake puts result in the projects top directory/libs? Her is a part of my makefile:
SET( LIBRARY_OUTPUT_DIRECTORY
${CMAKE_CURRENT_SOURCE_DIR}
)

SET( RUNTIME_OUTPUT_DIRECTORY
${CMAKE_CURRENT_SOURCE_DIR}
)

SET( ARCHIVE_OUTPUT_DIRECTORY
${CMAKE_CURRENT_SOURCE_DIR}
)


MESSAGE("LIBRARY OUTPUT DIRECTORY ${LIBRARY_OUTPUT_DIRECTORY}")
MESSAGE("ARCHIVE OUTPUT DIRECTORY ${ARCHIVE_OUTPUT_DIRECTORY}")
MESSAGE("RUNTIME OUTPUT DIRECTORY ${RUNTIME_OUTPUT_DIRECTORY}")

ADD_LIBRARY(qmmpkde4filedialog SHARED ${libqmmpkde4filedialog_SRCS} ${libqmmpkde4filedialog_MOC_SRCS} )
add_dependencies(qmmpkde4filedialog qmmpui)
target_link_libraries( qmmpkde4filedialog ${QT_LIBRARIES} -lqmmpui ${KDE4_KIO_LIBS} -lkio )
install(TARGETS qmmpkde4filedialog DESTINATION ${LIB_DIR}/qmmp/FileDialogs)

Well MESSAGE( ... prints my current source directory, and I wont the resulting lib to be placed there, but why it goes elsewhere? Thanks in advance.


People are the power
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: cmake output directory

Thu Oct 15, 2009 6:33 am
All libraries are placed in BUILD_DIR/libs. This is so within project linking can be done easily by CMake. You should only be concerned with the location where libraries are installed.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
CMakeTrey
Registered Member
Posts
1
Karma
0
OS

Re: cmake output directory

Sun May 23, 2010 7:36 pm
While the reply likely was fully correct, it didn't quite tell the whole story:

Your LIBRARY_OUTPUT_DIRECTORY variable has the same _name_ as the _property_ to be set on a target (via set_property()). That, however, doesn't help much (in fact it's completely bogus since this variable isn't hooked up anywhere), since I guess what you really would have wanted is the builtin CMAKE_LIBRARY_OUTPUT_DIRECTORY variable for the _global_ setting, i.e. to affect output directory of _all_ targets.

IOW, _either_ set the LIBRARY_OUTPUT_DIRECTORY target property (_per-target_), such as:
set_property(TARGET ...
PROPERTY LIBRARY_OUTPUT_DIRECTORY ...
)
or some such, or:
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ....)


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell