Commit 9900f392 authored by jerem's avatar jerem Committed by jeremad

remove "external_deps" mode for LINUX

LINUX_PKG is now the only option
parent dc5d24e0
......@@ -212,8 +212,8 @@ endif(NOT CMAKE_EXTERNAL_DEPS)
set(CMAKE_EXTERNAL_LIB "${CMAKE_EXTERNAL_DEPS}/lib")
set(CMAKE_EXTERNAL_INCLUDE "${CMAKE_EXTERNAL_DEPS}/include")
if(NOT EXISTS ${CMAKE_EXTERNAL_DEPS} AND NOT APPLE_MACPORTS AND NOT APPLE_BREW AND NOT LINUX_PKG)
message(FATAL_ERROR "external_deps folder not found and no system package manager set")
if(NOT EXISTS ${CMAKE_EXTERNAL_DEPS} AND WINDOWS)
message(FATAL_ERROR "external_deps folder not found")
endif()
# ----------------------------------------------------------------------------
......
......@@ -41,17 +41,15 @@ function(setup_format BACKEND_NAME USE_CUDA)
target_compile_options(${LIST_NAME} PRIVATE -Wno-deprecated-declarations)
endif(LINUX OR APPLE)
if(LINUX OR ANDROID)
if(LINUX_PKG)
if(LINUX)
find_library(FFMPEG_avcodec avcodec REQUIRED)
find_library(FFMPEG_avformat avformat REQUIRED)
find_library(FFMPEG_avutil avutil REQUIRED)
else(LINUX_PKG)
elseif(ANDROID)
find_library(FFMPEG_avcodec avcodec PATHS ${CMAKE_EXTERNAL_DEPS}/lib REQUIRED NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
find_library(FFMPEG_avformat avformat PATHS ${CMAKE_EXTERNAL_DEPS}/lib REQUIRED NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
find_library(FFMPEG_avutil avutil PATHS ${CMAKE_EXTERNAL_DEPS}/lib REQUIRED NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
endif(LINUX_PKG)
endif(LINUX OR ANDROID)
endif()
if(WINDOWS)
set(FFMPEG_LIB_PATH ${CMAKE_EXTERNAL_DEPS}/lib/ffmpeg)
......
......@@ -29,12 +29,7 @@ target_include_directories(${PLUGIN_NAME} PRIVATE ../common/include)
set_property(TARGET ${PLUGIN_NAME} PROPERTY CXX_STANDARD 14)
if(LINUX)
if(LINUX_PKG)
find_library(JPEG NAMES "jpeg")
else()
find_library(TURBO_JPEG NAMES "turbojpeg" PATHS "${CMAKE_EXTERNAL_DEPS}/lib" NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
find_library(JPEG NAMES "jpeg" PATHS "${CMAKE_EXTERNAL_DEPS}/lib" NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
endif()
elseif(APPLE_MACPORTS)
find_library(JPEG NAMES jpeg PATHS /opt/local/lib)
elseif(APPLE_BREW)
......@@ -52,7 +47,7 @@ else()
target_include_directories(${PLUGIN_NAME} SYSTEM PRIVATE "${CMAKE_EXTERNAL_DEPS}/include/libjpeg-turbo")
endif()
if(APPLE_MACPORTS OR LINUX_PKG OR APPLE_BREW)
if(APPLE_MACPORTS OR LINUX OR APPLE_BREW)
target_link_libraries(${PLUGIN_NAME} PRIVATE ${JPEG} ${VS_DISCOVERY})
else()
target_link_libraries(${PLUGIN_NAME} PRIVATE ${TURBO_JPEG} ${JPEG} ${VS_DISCOVERY})
......
......@@ -14,9 +14,9 @@ set(HEADER_FILES
if(WINDOWS)
set(PLUGIN_NAME portaudio)
else(WINDOWS)
else()
set(PLUGIN_NAME portaudioPlugin)
endif(WINDOWS)
endif()
vs_add_IO_library(${PLUGIN_NAME} SHARED ${SOURCE_FILES} ${HEADER_FILES} $<TARGET_OBJECTS:common>)
......@@ -28,15 +28,11 @@ target_include_directories(${PLUGIN_NAME} PRIVATE ../common/include)
target_include_directories(${PLUGIN_NAME} PRIVATE ${CMAKE_EXTERNAL_DEPS}/include/portaudio)
set_property(TARGET ${PLUGIN_NAME} PROPERTY CXX_STANDARD 14)
if (WINDOWS)
if(WINDOWS)
find_library(PORTAUDIO NAMES "portaudio_x64" PATHS ${CMAKE_EXTERNAL_DEPS}/lib/portaudio REQUIRED)
else(WINDOWS)
if(LINUX_PKG)
else()
find_library(PORTAUDIO NAMES "portaudio" REQUIRED)
else(LINUX_PKG)
find_library(PORTAUDIO NAMES "portaudio" PATHS ${CMAKE_EXTERNAL_DEPS}/lib REQUIRED NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
endif(LINUX_PKG)
endif(WINDOWS)
endif()
# FIXME: portAudioReader.cpp
if(COMPILER_GCC)
......
......@@ -7,7 +7,7 @@ option(RTMP_NVENC "RTMP NVidia Encode/Decode support" ON)
option(RTMP_NVENC_M "RTMP NVidia Encode/Decode support on Mobile Platform (TEGRA)" OFF)
option(USE_AVFORMAT "USE avformat to record RTMP" OFF)
if(APPLE OR TEGRA_DEMO OR LINUX_PKG)
if(APPLE OR TEGRA_DEMO OR LINUX)
set(RTMP_QUICKSYNC OFF CACHE BOOL "" FORCE)
endif()
......@@ -223,16 +223,16 @@ if(WINDOWS)
Winmm)
target_link_libraries(${PLUGIN_NAME} PRIVATE ${librtmp} ${libx264} ${libmp3lame} ${libfaac} ${libmfxhw64} ${libvfaad} ${libmpghip} ${DirectX_LIB})
set_property(TARGET ${PLUGIN_NAME} APPEND_STRING PROPERTY LINK_FLAGS "/NODEFAULTLIB:libcmt /NODEFAULTLIB:libcmtd")
endif(WINDOWS)
endif()
if(LINUX OR ANDROID)
if(LINUX_PKG)
if(LINUX)
find_library(libx264 x264 REQUIRED)
find_library(librtmp rtmp REQUIRED)
else(LINUX_PKG)
else()
find_library(librtmp rtmp HINTS ${CMAKE_EXTERNAL_LIB} REQUIRED NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
find_library(libx264 x264 HINTS ${CMAKE_EXTERNAL_LIB} REQUIRED NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
endif(LINUX_PKG)
endif()
if(CMAKE_CROSSCOMPILING)
# needed to include x264.h
target_include_directories(${PLUGIN_NAME} PRIVATE ${CMAKE_EXTERNAL_DEPS}/include/x264)
......@@ -241,19 +241,19 @@ if(LINUX OR ANDROID)
find_library(libmp3lame mp3lame HINTS ${CMAKE_EXTERNAL_LIB} REQUIRED NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
find_library(libfaac faac HINTS ${CMAKE_EXTERNAL_LIB} REQUIRED NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
find_library(libvfaad faad HINTS ${CMAKE_EXTERNAL_LIB} REQUIRED NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
else(CMAKE_CROSSCOMPILING)
else()
find_library(libmp3lame mp3lame)
find_library(libfaac faac)
find_library(libvfaad faad)
endif(CMAKE_CROSSCOMPILING)
endif()
target_link_libraries(${PLUGIN_NAME} PRIVATE ${librtmp} ${libx264} ${libmp3lame} ${libfaac} ${libvfaad})
if(RTMP_QUICKSYNC)
find_library(libmfxhw64 mfxhw64 HINTS ${CMAKE_EXTERNAL_LIB} REQUIRED NO_DEFAULT_PATH)
find_library(libva va HINTS ${CMAKE_EXTERNAL_LIB} REQUIRED NO_SYSTEM_ENVIRONMENT_PATH)
find_library(libva_drm va-drm HINTS ${CMAKE_EXTERNAL_LIB} REQUIRED NO_SYSTEM_ENVIRONMENT_PATH)
target_link_libraries(${PLUGIN_NAME} PRIVATE ${libmfxhw64} ${libva} ${libva_drm})
endif(RTMP_QUICKSYNC)
endif(LINUX OR ANDROID)
endif()
endif()
if(APPLE)
if(APPLE_MACPORTS OR APPLE_BREW)
......@@ -281,7 +281,7 @@ endif()
if(WINDOWS)
target_compile_definitions(${PLUGIN_NAME} PRIVATE NOMINMAX _USE_MATH_DEFINES)
endif(WINDOWS)
endif()
# Unit tests
......
......@@ -12,7 +12,7 @@ endif()
if(LINUX OR ANDROID)
if(LINUX_PKG)
if(LINUX)
find_library(OpenCV_CORE_LIBS NAMES "opencv_core")
find_library(OpenCV_CALIB_LIBS NAMES "opencv_calib3d")
find_library(OpenCV_FEATURES_LIBS NAMES "opencv_features2d")
......
......@@ -14,17 +14,17 @@ if(APPLE)
else()
find_path(OpenEXR_LIBRARY_DIR libHalf.dylib HINTS "${CMAKE_EXTERNAL_DEPS}" PATH_SUFFIXES lib/openexr/ NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
endif()
elseif (LINUX OR ANDROID)
if(LINUX_PKG)
elseif(LINUX OR ANDROID)
if(LINUX)
find_library(OpenEXR_LIBRARY_DIR libHalf.so)
else(LINUX_PKG)
else()
find_path(OpenEXR_LIBRARY_DIR libHalf.so HINTS "${CMAKE_EXTERNAL_DEPS}" PATH_SUFFIXES lib/openexr/ NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
endif()
elseif(WINDOWS)
find_path(OpenEXR_LIBRARY_DIR Half.lib HINTS "${CMAKE_EXTERNAL_DEPS}" PATH_SUFFIXES lib/openexr/ NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
endif()
if(LINUX_PKG)
if(LINUX)
find_path(OpenEXR_INCLUDE_DIR OpenEXR/half.h)
elseif(APPLE_MACPORTS)
find_path(OpenEXR_INCLUDE_DIR OpenEXR/half.h HINTS /opt/local/include)
......@@ -34,7 +34,7 @@ else()
find_path(OpenEXR_INCLUDE_DIR openexr/half.h HINTS "${CMAKE_EXTERNAL_DEPS}" PATH_SUFFIXES include/ NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
endif()
if(LINUX_PKG OR APPLE_MACPORTS OR APPLE_BREW)
if(LINUX OR APPLE_MACPORTS OR APPLE_BREW)
if(OpenEXR_INCLUDE_DIR AND EXISTS "${OpenEXR_INCLUDE_DIR}/OpenEXR/OpenEXRConfig.h")
file(STRINGS
${OpenEXR_INCLUDE_DIR}/OpenEXR/OpenEXRConfig.h
......@@ -53,12 +53,10 @@ else()
endif()
foreach(OpenEXR_LIB Half Iex Imath IlmImf IlmThread)
if(LINUX OR ANDROID)
if(LINUX_PKG)
if(LINUX)
find_library(OpenEXR_${OpenEXR_LIB}_LIBRARY ${OpenEXR_LIB})
else()
elseif(ANDROID)
find_library(OpenEXR_${OpenEXR_LIB}_LIBRARY ${OpenEXR_LIB} NO_DEFAULT_PATH HINTS "${CMAKE_EXTERNAL_DEPS}" PATH_SUFFIXES lib/ NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
endif()
elseif(APPLE_MACPORTS OR APPLE_BREW)
find_library(OpenEXR_${OpenEXR_LIB}_LIBRARY ${OpenEXR_LIB} NO_DEFAULT_PATH HINTS ${OpenEXR_ROOT_DIR} PATH_SUFFIXES lib/)
else()
......
if(APPLE)
find_package(PNG REQUIRED)
find_library(CORE_FOUNDATION CoreFoundation REQUIRED)
elseif(LINUX OR ANDROID)
if(LINUX_PKG)
find_library(PNG_LIBRARY libpng.so)
else(LINUX_PKG)
find_library(PNG_LIBRARY libpng.so PATHS ${CMAKE_EXTERNAL_LIB} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
endif(LINUX_PKG)
elseif(LINUX)
find_library(PNG_LIBRARY png)
elseif(ANDROID)
find_library(PNG_LIBRARY png PATHS ${CMAKE_EXTERNAL_LIB} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
elseif(WINDOWS)
find_debug_and_optimized_library(PNG_LIBRARY "libpng/debug" "libpng" "libpng/release" "libpng")
endif(APPLE)
endif()
......@@ -72,7 +72,6 @@ export CXX=g++-6
# Install CUDA: https://developer.nvidia.com/cuda-90-download-archive
cmake -DGPU_BACKEND_CUDA=ON -DGPU_BACKEND_OPENCL=ON \
-DLINUX_PKG=ON \
-G Ninja \
stitchEm
```
......
......@@ -5,5 +5,5 @@ ADD . stitchEm
WORKDIR stitchEm
RUN echo ${CUDA_SHORT} > cuda.version
WORKDIR build
RUN cmake -DCMAKE_BUILD_TYPE=Release -DLINUX_PKG=ON -DRTMP_NVENC=OFF -DCUDA_TARGET_ARCH="50" -G Ninja ..
RUN cmake -DCMAKE_BUILD_TYPE=Release -DRTMP_NVENC=OFF -DCUDA_TARGET_ARCH="50" -G Ninja ..
CMD ninja
......@@ -215,7 +215,7 @@ set(CMAKE_SWIG_FLAGS "${SWIG_FLAGS}" "-modern" "-builtin")
if(APPLE)
# using MacPorts glfw for now
find_library(glfw glfw HINTS "/opt/local/lib" REQUIRED NO_DEFAULT_PATH)
elseif(LINUX_PKG)
elseif(LINUX)
find_library(glfw glfw REQUIRED)
else()
find_library(glfw glfw HINTS "${CMAKE_EXTERNAL_LIB}" REQUIRED NO_DEFAULT_PATH)
......
if(TEGRA_DEMO)
find_library(GLOG glog PATHS ${CMAKE_EXTERNAL_LIB} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
endif()
if(LINUX_PKG)
find_library(CERES_OPTIMIZED_LIBRARY NAMES "ceres")
else(LINUX_PKG)
if(ANDROID)
find_library(CERES_OPTIMIZED_LIBRARY NAMES "ceres" PATHS ${CMAKE_EXTERNAL_LIB} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
endif(LINUX_PKG)
set(CERES_LIBS general ${CERES_OPTIMIZED_LIBRARY})
else()
find_library(CERES_OPTIMIZED_LIBRARY NAMES "ceres")
endif()
set(CERES_LIBS general ${CERES_OPTIMIZED_LIBRARY})
set(EIGEN3_INCLUDE_DIRS /usr/include/eigen3)
......@@ -7,11 +7,7 @@ include_discovery_vs_headers(${CMD_NAME})
link_target_to_libvideostitch(${CMD_NAME})
if(LINUX)
if(LINUX_PKG)
find_library(GLFW glfw REQUIRED)
else(LINUX_PKG)
find_library(GLFW glfw HINTS "${CMAKE_EXTERNAL_LIB}" REQUIRED NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
endif(LINUX_PKG)
elseif(APPLE)
if(APPLE_MACPORTS OR APPLE_BREW)
find_library(GLFW glfw HINTS "${CMAKE_EXTERNAL_LIB}/glfw" REQUIRED)
......
......@@ -84,7 +84,6 @@ if(APPLE)
endif(APPLE)
if(LINUX)
if(LINUX_PKG)
if(NOT EXISTS ${CMAKE_SOURCE_DIR}/external_deps/include/clangcl/opencl_spir.h)
file (DOWNLOAD https://raw.githubusercontent.com/KhronosGroup/SPIR-Tools/9c498a665a08db583c61fd34b9e2486978c2431b/headers/opencl_spir.h ${CMAKE_SOURCE_DIR}/external_deps/include/clangcl/opencl_spir.h)
endif()
......@@ -93,10 +92,6 @@ if(LINUX)
if(NOT OPENCL_OFFLINE_COMPILER)
message(FATAL_ERROR "openCL compiler (CLANG) not found")
endif()
else()
find_program(OPENCL_OFFLINE_COMPILER ${CMAKE_EXTERNAL_DEPS}/lib/clang
DOC "OpenCL offline compiler to build spir files from kernel sources")
endif()
elseif(ANDROID)
find_program(OPENCL_OFFLINE_COMPILER ${ANDROID_CLANG_TOOLCHAIN_ROOT}/bin/clang
DOC "OpenCL offline compiler to build spir files from kernel sources")
......
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