CMakeLists.txt
changeset 1033 c846b83628f4
parent 1032 ea6aaadcfa04
child 1034 a20aae42114b
--- a/CMakeLists.txt	Mon Feb 01 04:22:05 2010 -0500
+++ b/CMakeLists.txt	Mon Feb 01 21:32:38 2010 -0500
@@ -416,26 +416,26 @@
 
 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})
 
@@ -445,6 +445,8 @@
         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)