Skip to content

Commit

Permalink
Use FIND_PROGRAM(perl) instead of FindPerl.
Browse files Browse the repository at this point in the history
I don't see the value in using FindPerl at the moment.
  • Loading branch information
icculus committed Feb 2, 2010
1 parent 319ff77 commit 8415f29
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions CMakeLists.txt
Expand Up @@ -416,26 +416,26 @@ ENDIF(NOT SWIG)

IF(PHYSFS_BUILD_PERL)
MESSAGE(STATUS "Configuring Perl bindings...")
INCLUDE(FindPerl)
IF(NOT PERL_FOUND)
FIND_PROGRAM(PERL perl DOC "Path to perl command line app: http://perl.org/")
IF(NOT PERL)
MESSAGE(STATUS "Perl not found. You won't be able to build perl bindings.")
SET(PHYSFS_BUILD_PERL FALSE)
ENDIF(NOT PERL_FOUND)
ENDIF(NOT PERL)

MACRO(GET_PERL_CONFIG _KEY _VALUE)
IF(PHYSFS_BUILD_PERL)
MESSAGE(STATUS "Figuring out perl config value '${_KEY}' ...")
EXECUTE_PROCESS(
COMMAND ${PERL_EXECUTABLE} -w -e "use Config; print \$Config{${_KEY}};"
COMMAND ${PERL} -w -e "use Config; print \$Config{${_KEY}};"
RESULT_VARIABLE GET_PERL_CONFIG_RC
OUTPUT_VARIABLE ${_VALUE}
)
IF(NOT GET_PERL_CONFIG_RC EQUAL 0)
MESSAGE(STATUS "Perl executable ('${PERL_EXECUTABLE}') reported failure: ${GET_PERL_CONFIG_RC}")
MESSAGE(STATUS "Perl executable ('${PERL}') reported failure: ${GET_PERL_CONFIG_RC}")
SET(PHYSFS_BUILD_PERL FALSE)
ENDIF(NOT GET_PERL_CONFIG_RC EQUAL 0)
IF(NOT ${_VALUE})
MESSAGE(STATUS "Perl executable ('${PERL_EXECUTABLE}') didn't have a value for '${_KEY}'")
MESSAGE(STATUS "Perl executable ('${PERL}') didn't have a value for '${_KEY}'")
SET(PHYSFS_BUILD_PERL FALSE)
ENDIF(NOT ${_VALUE})

Expand All @@ -445,6 +445,8 @@ IF(PHYSFS_BUILD_PERL)
ENDIF(PHYSFS_BUILD_PERL)
ENDMACRO(GET_PERL_CONFIG)

MARK_AS_ADVANCED(PERL)

# !!! FIXME: installsitearch might be the wrong location.
GET_PERL_CONFIG("installarchlib" PERL_INCLUDE_PATH)
GET_PERL_CONFIG("ccflags" PERL_CCFLAGS)
Expand Down

0 comments on commit 8415f29

Please sign in to comment.