[Cmake] How to change the default output file name for libraries
in Linux
Raghavendra Chandrashekara
rc3 at doc.ic.ac.uk
Fri, 09 Apr 2004 11:16:48 +0100
William A. Hoffman wrote:
>I have created cmake files for swig, you can find them here:
>
>ftp:/public.kitware.com/pub/cmake/contrib/SwigCMake.6.tar.gz.
>It requires cvs cmake to run the swig tests, but you should
>be able to use most of the basic swig stuff from cmake if you look
>at the CMake directory in that tar file.
>
>For creating a library from swig I use this macro:
>
>
>MACRO(ADD_SWIG_LIBRARY LANGUAGE LIBNAME SOURCES)
> SET(SWIG_LIB_PREFIX "")
> IF("${LANGUAGE}" MATCHES "^python$")
> SET(SWIG_LIB_PREFIX "_")
> ENDIF("${LANGUAGE}" MATCHES "^python$")
> # tcl does not use MODULES
> IF("${LANGUAGE}" MATCHES "^tcl$")
> ADD_LIBRARY("${SWIG_LIB_PREFIX}${LIBNAME}" SHARED ${SOURCES})
> ELSE("${LANGUAGE}" MATCHES "^tcl$")
> ADD_LIBRARY("${SWIG_LIB_PREFIX}${LIBNAME}" MODULE ${SOURCES})
> ENDIF("${LANGUAGE}" MATCHES "^tcl$")
> IF(${LANGUAGE} MATCHES "java")
> ELSE(${LANGUAGE} MATCHES "java")
> SET_TARGET_PROPERTIES("${SWIG_LIB_PREFIX}${LIBNAME}" PROPERTIES PREFIX "")
> ENDIF(${LANGUAGE} MATCHES "java")
> IF(SWIG_SOURCE_DIR)
> IF(CMAKE_CONFIGURATION_TYPES)
> ADD_DEPENDENCIES("${SWIG_LIB_PREFIX}${LIBNAME}" swig)
> ENDIF(CMAKE_CONFIGURATION_TYPES)
> ENDIF(SWIG_SOURCE_DIR)
>ENDMACRO(ADD_SWIG_LIBRARY)
>
>
Thanks, this is just what I need. Will these files be included in the
next version of CMake?
Raghavendra