RESOLVED FIXED Bug 77928
[CMAKE] Use *bin* and *lib* directories for executable and libraries
https://bugs.webkit.org/show_bug.cgi?id=77928
Summary [CMAKE] Use *bin* and *lib* directories for executable and libraries
Gyuyoung Kim
Reported 2012-02-06 20:04:07 PST
In cmake build system, shared libraries are being built in source directory. It is better to set a common place to maintain built libraries. In addition, test bot uploads libraries with test result. Thus, I need a common place for all libraries in order to upload all libraries.
Attachments
Patch (1.72 KB, patch)
2012-02-06 20:05 PST, Gyuyoung Kim
no flags
Patch (1.72 KB, patch)
2012-02-06 21:45 PST, Gyuyoung Kim
no flags
Patch (10.56 KB, patch)
2012-02-07 02:47 PST, Gyuyoung Kim
no flags
Patch (10.58 KB, patch)
2012-02-07 04:27 PST, Gyuyoung Kim
no flags
Gyuyoung Kim
Comment 1 2012-02-06 20:05:38 PST
Gyuyoung Kim
Comment 2 2012-02-06 20:06:39 PST
CC'ing Daniel, Patrick and Kubo.
Gyuyoung Kim
Comment 3 2012-02-06 21:45:29 PST
Patrick R. Gansterer
Comment 4 2012-02-07 00:42:43 PST
Comment on attachment 125765 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=125765&action=review > Source/cmake/WebKitFS.cmake:4 > +FILE(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/libs) AFAIK this isn't necessary. CMake takes care of creating directories when needed. > CMakeLists.txt:45 > +SET(LIBRARY_OUTPUT_PATH "${CMAKE_BINARY_DIR}/libs") Why "libs", isn't "lib" more common for such a directory (like "bin" is more common than "Programs")?
Gyuyoung Kim
Comment 5 2012-02-07 00:51:12 PST
(In reply to comment #4) > (From update of attachment 125765 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=125765&action=review > > > Source/cmake/WebKitFS.cmake:4 > > +FILE(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/libs) > > AFAIK this isn't necessary. CMake takes care of creating directories when needed. Ok, I fix it. Frankly, above code is not necessary. I added it to create directory more correctly as *Programs*. > > CMakeLists.txt:45 > > +SET(LIBRARY_OUTPUT_PATH "${CMAKE_BINARY_DIR}/libs") > > Why "libs", isn't "lib" more common for such a directory (like "bin" is more common than "Programs")? QT port is using *bin* and *lib*. By comparison, GTK port is using *Programs* and *.libs*. I think we have to get agreement from port maintainers(Wince, Blackberry and EFL). I agree. :-)
Patrick R. Gansterer
Comment 6 2012-02-07 01:43:08 PST
(In reply to comment #5) > (In reply to comment #4) > > Why "libs", isn't "lib" more common for such a directory (like "bin" is more common than "Programs")? > > QT port is using *bin* and *lib*. By comparison, GTK port is using *Programs* and *.libs*. I think we have to get agreement from port maintainers(Wince, Blackberry and EFL). I agree. :-) There is also the common "/usr/bin" and "/usr/lib".
Gyuyoung Kim
Comment 7 2012-02-07 02:47:48 PST
Gyuyoung Kim
Comment 8 2012-02-07 02:49:43 PST
New patch is submitted. I set bin and lib directory for executable and library. Daniel reviews this patch, I think blackberry port also agrees with this change.
Patrick R. Gansterer
Comment 9 2012-02-07 03:35:24 PST
Comment on attachment 125798 [details] Patch IMHO you should use sth. like: SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) in the root CMakeLists.txt, instead of adding this to the different executeable names.
Gyuyoung Kim
Comment 10 2012-02-07 04:21:57 PST
(In reply to comment #9) > (From update of attachment 125798 [details]) > IMHO you should use sth. like: > SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) > SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) > SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) > in the root CMakeLists.txt, instead of adding this to the different executeable names. When we set CMAKE_ARCHIVE_OUTPUT_DIRECTORY, static libraries are also moved to lib directory. I think it is better to move shared libraries to lib directory only. Why don't we use below setting ? SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
Gyuyoung Kim
Comment 11 2012-02-07 04:27:35 PST
Patrick R. Gansterer
Comment 12 2012-02-07 04:28:31 PST
(In reply to comment #10) > (In reply to comment #9) > > (From update of attachment 125798 [details] [details]) > > IMHO you should use sth. like: > > SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) > > SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) > > SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) > > in the root CMakeLists.txt, instead of adding this to the different executeable names. > > > When we set CMAKE_ARCHIVE_OUTPUT_DIRECTORY, static libraries are also moved to lib directory. I think it is better to move shared libraries to lib directory only. > > Why don't we use below setting ? > > SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) > SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) It's ok for me too. I only want to avoid the "'Programs/' prefix" on the different targets. ;-)
Daniel Bates
Comment 13 2012-02-07 10:03:08 PST
Comment on attachment 125813 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=125813&action=review > CMakeLists.txt:46 > +SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) > +SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) I don't have a CMake build at the moment. I assume that these directories are created by CMake in the directory CMAKE_BINARY_DIR.
Gyuyoung Kim
Comment 14 2012-02-07 16:57:20 PST
(In reply to comment #13) > (From update of attachment 125813 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=125813&action=review > > > CMakeLists.txt:46 > > +SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) > > +SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) > > I don't have a CMake build at the moment. I assume that these directories are created by CMake in the directory CMAKE_BINARY_DIR. Yes, right. *.so files are created in CMAKE_BINARY_DIR/lib and excutables are created in CMAKE_BINARY_DIR/bin.
WebKit Review Bot
Comment 15 2012-02-07 17:51:28 PST
Comment on attachment 125813 [details] Patch Clearing flags on attachment: 125813 Committed r107020: <http://trac.webkit.org/changeset/107020>
WebKit Review Bot
Comment 16 2012-02-07 17:51:37 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.