[CMake] lib/dll LINK_LIBRARIES on windows?

Tristan Carel tristan.carel at gmail.com
Wed Dec 13 18:18:48 EST 2006


On 12/13/06, Abe Stephens <abe at sci.utah.edu> wrote:
> Hi,
>
> This might be a pretty easy question. I'm porting some code from my
> usual linux/osx development environment to WindowXP. I have a library
> called "glm" which builds lib/glm.dll.  That appears to work.
>
> If I try to use that library in a SWIG_LINK_LIBRARIES directive, I get
> an error that "glm.lib" can't be found:
>
> ADD_LIBRARY(glm .... )
>
> SWIG_ADD_MODULE(glm python glm.i)
> SWIG_LINK_LIBRARIES( ${PYTHON_LIBRARIES} glm )

The synopsis of `SWIG_LINK_LIBRARIES' macro is:
SWIG_LINK_LIBRARIES(module_name library [library...])

So try this:

SWIG_LINK_LIBRARIES(glm ${PYTHON_LIBRARIES} glm )


However if I were you, to avoid any conflicts / misunderstanding, I
would choose a different module name:

ADD_LIBRARY(glm .... )
[...]
SWIG_ADD_MODULE(glm_swig python glm.i)
SWIG_LINK_LIBRARIES(glm_swig ${PYTHON_LIBRARIES} glm )

-- 
Tristan Carel
http://www.tristan-carel.com
Music with dinner is an insult both to the cook and the violinist.


More information about the CMake mailing list