[CMake] Cannot add library to the static library in Visual Studio 2008

Philip Lowman philip at yhbt.com
Sun Feb 15 21:06:53 EST 2009


On Sat, Feb 14, 2009 at 9:35 AM, Dupi <nefreyu at gmail.com> wrote:

>  Hi all.
>
> I have problem with adding ode library to the static library in Visual
> Studio 2008. My project name is oxygen and it is depend from ODE library
> version 0.9 (
> http://downloads.sourceforge.net/opende/ode-win32-0.9.zip?modtime=1192176753&big_mirror=0). CMakeLists.txt file for oxygen include following lines:
>
> # include all headers of project (.h)
>
> set(oxygen_LIB_HDRS …….. )
>
> #include all source files of project  (.cpp)
>
> set(oxygen_LIB_SRCS ……..)
>
> #include directory of ODE library. Value ODE_INCLUDE_DIR is
> C:/library/ode/include. Also this value is added into VS project (Project
> properties -> Configuration Properties ->C/C++->General->Additional Include
> Directories)
>
> include_directories(${ODE_INCLUDE_DIR})
>
> #create static library oxygen.lib
>
> add_library(oxygen STATIC ${oxygen_LIB_SRCS} ${oxygen_LIB_HDRS})
>
> #add ode.lib to the oxygen. Value ODE_LIBRARY is
> C:/library/ode/lib/releaselib/ode.lib. But this value is not added into VS
> project (Project properties -> Configuration Properties
> ->Librarian->General->Additional Dependencies)
>
> target_link_libraries(oxygen ${ODE_LIBRARY})
>
>
>
> If I change project from static library (lib) to the dynamic library (dll)
> (change values add_library to the (oxygen SHARED ${oxygen_LIB_SRCS}
> ${oxygen_LIB_HDRS})), value ODE_LIBRARY
> (C:/library/ode/lib/releaselib/ode.lib) is added into VS Project. I finding
> solution about one week but still nothing.
>
> Thank you for every advice.
>
This came up on the mailing list very recently.  You might want to have a
look at this thread:
http://www.cmake.org/pipermail/cmake/2009-February/026964.html


-- 
Philip Lowman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090215/ed18cc38/attachment.htm>


More information about the CMake mailing list