[CMake] Problems with LIBRARY_OUTPUT_PATH

William A. Hoffman billlist at nycap.rr.com
Mon Jan 10 10:24:28 EST 2005


No, that is a bug.  Please report the bug.   The problem is that
you are using LIBRARY_OUTPUT_PATH slightly different than expected.
CMake assumes that LIBRARY_OUTPUT_PATH is either empty or set to the
same directory for the entire project.  So, cmake assumes that mylib
has the same LIBRARY_OUTPUT_PATH as mod and puts a depend line in
the makefile like this:

mod_DEPEND_LIBS = c:\hoffman\gal\build\plugin\mylib.lib 

Of course that file never exists.


-Bill

At 05:08 AM 1/10/2005, Filipe Sousa wrote:
>Hi!
>
>When I set LIBRARY_OUTPUT_PATH in sub directories, cmake is always building 
>the libraries. To a better understanding of my problem I show you my 
>CMakeLists.txt files
>
>In my project root I have this CMakeList.txt
>PROJECT(gal)
>SUBDIRS(mylib modules)
>
>CMakeLists.txt to build "mylib". I want to put all libraries in the same 
>directory
>
>ADD_LIBRARY(mylib mylib.cc)
>SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
>
>CMakeLists.txt to build a simple plug-in that links with "mylib". All plugins 
>should go ${PROJECT_BINARY_DIR}/plugin
>
>ADD_LIBRARY(mod MODULE m.cc)
>SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/plugin)
>LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/lib)
>TARGET_LINK_LIBRARIES(mod mylib)
>
>Everytime I run make, the plugin is always built as you can see by the output:
>
>fsousa at localhost ~/tmp/cmakebug/Build $ make
>cmake.depends is up-to-date
>/home/fsousa/tmp/cmakebug/Build/mylib: building default_target
>cmake.depends is up-to-date
>/home/fsousa/tmp/cmakebug/Build/modules: building default_target
>cmake.depends is up-to-date
>cmake.depends is up-to-date
>Building shared module /home/fsousa/tmp/cmakebug/Build/plugin/libmod.so...
>
>fsousa at localhost ~/tmp/cmakebug/Build $ make
>cmake.depends is up-to-date
>/home/fsousa/tmp/cmakebug/Build/mylib: building default_target
>cmake.depends is up-to-date
>/home/fsousa/tmp/cmakebug/Build/modules: building default_target
>cmake.depends is up-to-date
>cmake.depends is up-to-date
>Building shared module /home/fsousa/tmp/cmakebug/Build/plugin/libmod.so...
>
>Is this a bug or am I doing something wrong?
>
>--
>Filipe Sousa
>
>
>_______________________________________________
>CMake mailing list
>CMake at www.cmake.org
>http://www.cmake.org/mailman/listinfo/cmake



More information about the CMake mailing list