summaryrefslogtreecommitdiffstats
path: root/Modules/FindMPEG2.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/FindMPEG2.cmake')
-rw-r--r--Modules/FindMPEG2.cmake40
1 files changed, 18 insertions, 22 deletions
diff --git a/Modules/FindMPEG2.cmake b/Modules/FindMPEG2.cmake
index 4b54fe3..06dd137 100644
--- a/Modules/FindMPEG2.cmake
+++ b/Modules/FindMPEG2.cmake
@@ -8,36 +8,32 @@
# MPEG2_vo_LIBRARY, where to find the vo library.
FIND_PATH(MPEG2_INCLUDE_DIR mpeg2.h
- /usr/local/include
- /usr/include
/usr/local/livid
)
FIND_LIBRARY(MPEG2_mpeg2_LIBRARY mpeg2
- /usr/local/lib
- /usr/lib
/usr/local/livid/mpeg2dec/libmpeg2/.libs
)
FIND_LIBRARY( MPEG2_vo_LIBRARY vo
- /usr/local/lib
- /usr/lib
/usr/local/livid/mpeg2dec/libvo/.libs
)
-SET( MPEG2_FOUND "NO" )
-IF(MPEG2_INCLUDE_DIR)
- IF(MPEG2_mpeg2_LIBRARY)
- SET( MPEG2_FOUND "YES" )
- SET( MPEG2_LIBRARIES ${MPEG2_mpeg2_LIBRARY}
- ${MPEG2_vo_LIBRARY})
-
- #some native mpeg2 installations will depend
- #on libSDL, if found, add it in.
- INCLUDE( ${MODULE_PATH}/NewCMake/FindSDL.cmake )
- IF(SDL_FOUND)
- SET( MPEG2_LIBRARIES ${MPEG2_LIBRARIES} ${SDL_LIBRARY})
- ENDIF(SDL_FOUND)
-
- ENDIF(MPEG2_mpeg2_LIBRARY)
-ENDIF(MPEG2_INCLUDE_DIR)
+
+# handle the QUIETLY and REQUIRED arguments and set MPEG2_FOUND to TRUE if
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(MPEG2 MPEG2_mpeg2_LIBRARY MPEG2_INCLUDE_DIR)
+
+IF(MPEG2_FOUND)
+ SET( MPEG2_LIBRARIES ${MPEG2_mpeg2_LIBRARY}
+ ${MPEG2_vo_LIBRARY})
+
+ #some native mpeg2 installations will depend
+ #on libSDL, if found, add it in.
+ INCLUDE( FindSDL.cmake )
+ IF(SDL_FOUND)
+ SET( MPEG2_LIBRARIES ${MPEG2_LIBRARIES} ${SDL_LIBRARY})
+ ENDIF(SDL_FOUND)
+ENDIF(MPEG2_FOUND)
+