Commit ac38f5cc authored by Ghislain MARY's avatar Ghislain MARY

Improve build with CMake.

parent 1159bc08
......@@ -38,6 +38,11 @@ set(VERSION "${PACKAGE_VERSION}")
set(WITH_OPENH264 "${CMAKE_INSTALL_PREFIX}" CACHE STRING "Set prefix where libopenh264 can be found (ex:/usr or /usr/local)")
if(MSVC)
include_directories(${CMAKE_INSTALL_PREFIX}/include/MSVC)
endif()
include(CheckIncludeFile)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
......@@ -68,6 +73,8 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY
include_directories(
${MS2_INCLUDE_DIR}
${OPENH264_INCLUDE_DIR}
src
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}/src
......
......@@ -23,7 +23,7 @@
# - Find the mediastreamer2 include file and library
#
# MS2_FOUND - system has mediastreamer2
# MS2_INCLUDE_DIRS - the mediastreamer2 include directory
# MS2_INCLUDE_DIR - the mediastreamer2 include directory
# MS2_LIBRARIES - The libraries needed to use mediastreamer2
if(UNIX)
......
......@@ -20,9 +20,10 @@
#
############################################################################
set(INCLUDES ${OPENH264_INCLUDE_DIR})
set(LIBS ${OPENH264_LIBRARIES})
set(LIBS
${MS2_LIBRARIES}
${OPENH264_LIBRARIES}
)
if(WIN32)
list(APPEND LIBS ws2_32)
endif()
......@@ -44,11 +45,6 @@ if(MSVC)
endif()
endif()
set_target_properties(msopenh264 PROPERTIES LINKER_LANGUAGE CXX LINK_FLAGS "${LINK_FLAGS}")
if("${CMAKE_VERSION}" VERSION_GREATER "2.8.10")
target_include_directories(msopenh264 PUBLIC ${INCLUDES})
else()
include_directories(${INCLUDES})
endif()
target_link_libraries(msopenh264 ${LIBS})
install(TARGETS msopenh264
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment