I was using it as a variable ${LibName} that was my problem.  Thanks.

On 10/4/06, Brad King <[EMAIL PROTECTED]> wrote:
Peter Kahn wrote:
> What is the standard way of having cmake access libaries built on the
> same subdir level?
>
> I have a project with two subdirs: Util and App.   Util builds a
> library called 'utillib'.  Ap builds a
> library and an exe (aplib, and ap.exe).
> Main\
>    CMakeLists.tst
>    Util\CMakeLists.txt
>    App\CmakeLists.txt
>
> If I define the utillib in Main\Util\CMakeLists.txt  how can the
> Main\App\CMakeLists.txt use it?  Should I define something in
> Main\CMakeLists.txt first and then populate it when Main\Util builds?

Just reference targets by their logical name (given to ADD_EXECUTABLE or
ADD_LIBRARY commands).

# CMakeLists.txt
ADD_SUBDIRECTORY(Util)
ADD_SUBDIRECTORY(App)

# Util/CMakeLists.txt
ADD_LIBRARY(mylib ...)

# App/CMakeLists.txt
ADD_EXECUTABLE(myexe ...)
TARGET_LINK_LIBRARIES(myexe mylib)

-Brad




--
Peter Kahn
[EMAIL PROTECTED]
[EMAIL PROTECTED], [EMAIL PROTECTED], skype: citizenkahn
http://kahnstipation.blogspot.com | http://analogoustendencies.blogspot.com/
Awareness - Intention - Action
_______________________________________________
CMake mailing list
[email protected]
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to