Skip to content
Permalink
Browse files
More perl bindings wanking.
  • Loading branch information
icculus committed Feb 2, 2010
1 parent bdd4d3e commit 282bf1b3ec69e2efd53657e907e9df13f0be4fdd
Showing with 16 additions and 7 deletions.
  1. +16 −7 CMakeLists.txt
@@ -452,15 +452,24 @@ IF(PHYSFS_BUILD_PERL)
GET_PERL_CONFIG("archlibexp" PERL_INCLUDE_PATH)
GET_PERL_CONFIG("ccflags" PERL_CCFLAGS)
GET_PERL_CONFIG("ldflags" PERL_LDFLAGS)
GET_PERL_CONFIG("libperl" PERL_LIBPERL)
GET_PERL_CONFIG("installsitearch" PERL_INSTALL_PATH)

STRING(REGEX REPLACE "^lib" "" PERL_LIBPERL "${PERL_LIBPERL}")
STRING(REGEX REPLACE "\.so$" "" PERL_LIBPERL "${PERL_LIBPERL}")
STRING(REGEX REPLACE "\.dylib$" "" PERL_LIBPERL "${PERL_LIBPERL}")
STRING(REGEX REPLACE "\.dll$" "" PERL_LIBPERL "${PERL_LIBPERL}")

CONFIGURE_SWIG_BINDING(Perl "${PERL_INSTALL_PATH}" "${CMAKE_CURRENT_BINARY_DIR}/physfs.pm" "\"-I${PERL_INCLUDE_PATH}/CORE\" ${PERL_CCFLAGS} -w" "\"-L${PERL_INCLUDE_PATH}/CORE\" -l${PERL_LIBPERL} ${PERL_LDFLAGS}")
# !!! FIXME: this test for Mac OS X is wrong.
IF(MACOSX)
GET_PERL_CONFIG("libperl" PERL_LIBPERL)
SET(TMPLIBPERL "${PERL_LIBPERL}")
STRING(REGEX REPLACE "^lib" "" TMPLIBPERL "${TMPLIBPERL}")
STRING(REGEX REPLACE "\\.so$" "" TMPLIBPERL "${TMPLIBPERL}")
STRING(REGEX REPLACE "\\.dylib$" "" TMPLIBPERL "${TMPLIBPERL}")
STRING(REGEX REPLACE "\\.dll$" "" TMPLIBPERL "${TMPLIBPERL}")
IF(NOT "${TMPLIBPERL}" STREQUAL "${PERL_LIBPERL}")
MESSAGE(STATUS "Stripped '${PERL_LIBPERL}' down to '${TMPLIBPERL}'.")
SET(PERL_LIBPERL "${TMPLIBPERL}")
ENDIF(NOT "${TMPLIBPERL}" STREQUAL "${PERL_LIBPERL}")
SET(PERL_LIBPERL "-l${PERL_LIBPERL}")
ENDIF(MACOSX)

CONFIGURE_SWIG_BINDING(Perl "${PERL_INSTALL_PATH}" "${CMAKE_CURRENT_BINARY_DIR}/physfs.pm" "\"-I${PERL_INCLUDE_PATH}/CORE\" ${PERL_CCFLAGS} -w" "\"-L${PERL_INCLUDE_PATH}/CORE\" ${PERL_LIBPERL} ${PERL_LDFLAGS}")
INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/physfs.pm" DESTINATION "${PERL_INSTALL_PATH}")
ENDIF(PHYSFS_BUILD_PERL)

0 comments on commit 282bf1b

Please sign in to comment.