James Bigler wrote:
There are a couple of things that either you have done wrong or I don't understand. This is how I would implement things:

core/CMakeLists.txt

SET(SRC_LIST ConfigHolder.cpp DictItem.cpp Reciter.cpp ForgetCurve.cpp Task.cpp Dict.cpp Manager.cpp WordList.cpp)
ADD_LIBRARY(core ${SRC_LIST})

ui/CMakeLists.txt

# You can also use CMAKE_SOURCE_DIR if FREERECITE_SOURCE_DIR is the top of your CMake tree
ADD_DIRECTORIES(${CMAKE_SOURCE_DIR}/core)

ADD_LIBRARY(ui Cui.cpp)
# Tell CMake that ui needs to link agains core
TARGET_LINK_LIBRARIES(ui core)

CMakeLists.txt
ADD_EXECUTABLE(myprogram main.cpp)
# myprogram depends on ui library
TARGET_LINK_LIBRARIES(myprogram ui)

You don't need to use LINK_DIRECTORIES, because CMake knows where core was built and how to link it against ui.

James

Thanks for your help. I see;p

_______________________________________________
CMake mailing list
[email protected]
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to