Skip to content

Commit 6408eab

Browse files
committed
Merge pull request #132 from cchampet/build_fixFindFFmpegOnWindows
Fix build on windows (find ffmpeg)
2 parents 1415a54 + f846b08 commit 6408eab

File tree

4 files changed

+26
-19
lines changed

4 files changed

+26
-19
lines changed

cmake/FindFFmpeg.cmake

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -32,35 +32,39 @@ endmacro()
3232

3333

3434
### Macro: find_component
35-
#
36-
# Check the given component by invoking pkgconfig and
35+
#
36+
# Check the given component by invoking pkgconfig and
3737
# then looking up the libraries and include directories.
38-
# @todo: WIN and MAC OSX.
3938
#
4039
macro(find_component COMPONENT PKGCONFIG LIBRARY HEADER)
4140
if(NOT WIN32)
42-
# use pkg-config to get the directories and then use these values
43-
# in the FIND_PATH() and FIND_LIBRARY() calls
41+
# use pkg-config to get the directories
4442
find_package(PkgConfig)
4543
if(PKG_CONFIG_FOUND)
4644
pkg_check_modules(PC_${COMPONENT} ${PKGCONFIG})
4745
endif()
46+
# find include
47+
find_path(${COMPONENT}_INCLUDE_DIR
48+
${HEADER}
49+
HINTS ${PC_${COMPONENT}_INCLUDEDIR} ${PC_${COMPONENT}_INCLUDE_DIR}
50+
)
51+
# find lib
52+
find_library(${COMPONENT}_LIBRARIES
53+
NAMES ${LIBRARY}
54+
HINTS ${PC_${COMPONENT}_LIBDIR} ${PC_${COMPONENT}_LIBRARY_DIRS}
55+
)
56+
# set definition and version
57+
set(${COMPONENT}_DEFINITIONS ${PC_${COMPONENT}_CFLAGS_OTHER} CACHE STRING "The ${COMPONENT} CFLAGS.")
58+
set(${COMPONENT}_VERSION ${PC_${COMPONENT}_VERSION} CACHE STRING "The ${COMPONENT} version number.")
59+
else()
60+
# find include
61+
find_path(${COMPONENT}_INCLUDE_DIR ${HEADER})
62+
# find lib
63+
file(GLOB_RECURSE ${COMPONENT}_LIBRARIES "${CMAKE_PREFIX_PATH}/*${COMPONENT}.lib")
64+
# @todo: define definition and version
4865
endif()
4966

50-
find_path(${COMPONENT}_INCLUDE_DIR
51-
${HEADER}
52-
HINTS ${PC_${COMPONENT}_INCLUDEDIR} ${PC_${COMPONENT}_INCLUDE_DIR}
53-
)
54-
55-
find_library(${COMPONENT}_LIBRARIES
56-
NAMES ${LIBRARY}
57-
HINTS ${PC_${COMPONENT}_LIBDIR} ${PC_${COMPONENT}_LIBRARY_DIRS}
58-
)
59-
60-
set(${COMPONENT}_DEFINITIONS ${PC_${COMPONENT}_CFLAGS_OTHER} CACHE STRING "The ${COMPONENT} CFLAGS.")
61-
set(${COMPONENT}_VERSION ${PC_${COMPONENT}_VERSION} CACHE STRING "The ${COMPONENT} version number.")
62-
63-
# Marks the given component as found if both *_LIBRARIES AND *_INCLUDE_DIR is present.
67+
# Marks the given component as found if both *_LIBRARIES AND *_INCLUDE_DIR is present.
6468
if(${COMPONENT}_LIBRARIES AND ${COMPONENT}_INCLUDE_DIR)
6569
set(${COMPONENT}_FOUND TRUE)
6670
else()

src/AvTranscoder/decoder/AudioGenerator.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ AudioGenerator& AudioGenerator::operator=( const AudioGenerator& audioGenerator
2222
_inputFrame = NULL;
2323
_silent = NULL;
2424
_frameDesc = audioGenerator.getAudioFrameDesc();
25+
return *this;
2526
}
2627

2728
AudioGenerator::~AudioGenerator()

src/AvTranscoder/decoder/VideoGenerator.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ VideoGenerator& VideoGenerator::operator=( const VideoGenerator& videoGenerator
2424
_inputFrame = NULL;
2525
_blackImage = NULL;
2626
_frameDesc = videoGenerator.getVideoFrameDesc();
27+
return *this;
2728
}
2829

2930
VideoGenerator::~VideoGenerator()

src/AvTranscoder/frame/Frame.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Frame::Frame( const Frame& other )
2828
Frame& Frame::operator=( const Frame& other )
2929
{
3030
copyAVPacket( other.getAVPacket() );
31+
return *this;
3132
}
3233

3334
Frame::~Frame()

0 commit comments

Comments
 (0)