Commit 592dec64 authored by jerem's avatar jerem Committed by jeremad

remove APPLE with external_deps

Now we can only use mac ports or homebrew
parent 9900f392
...@@ -32,7 +32,7 @@ matrix: ...@@ -32,7 +32,7 @@ matrix:
script: script:
- mkdir build - mkdir build
- cd build - cd build
- cmake -DCREATE_BOX_PACKAGE=OFF -DGPU_BACKEND_CUDA=OFF -DGPU_BACKEND_OPENCL=ON -DAPPLE_BREW=ON -DQt5_DIR=/usr/local/opt/qt/lib/cmake/Qt5 -G Ninja .. - cmake -DCREATE_BOX_PACKAGE=OFF -DGPU_BACKEND_CUDA=OFF -DGPU_BACKEND_OPENCL=ON -DMACPORTS=OFF -DQt5_DIR=/usr/local/opt/qt/lib/cmake/Qt5 -G Ninja ..
- ninja - ninja
- name: CUDA 8 Linux - name: CUDA 8 Linux
dist: xenial dist: xenial
......
...@@ -90,6 +90,7 @@ endif( NOT NO_CCACHE ) ...@@ -90,6 +90,7 @@ endif( NOT NO_CCACHE )
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
if(APPLE) if(APPLE)
message(STATUS "System: APPLE") message(STATUS "System: APPLE")
option(MACPORTS "Use MacPorts, OFF uses Homebrew" ON)
endif(APPLE) endif(APPLE)
if(${CMAKE_SYSTEM_NAME} MATCHES "Android") if(${CMAKE_SYSTEM_NAME} MATCHES "Android")
......
...@@ -59,9 +59,9 @@ function(setup_av_plugin PLUGIN_NAME BACKEND_NAME USE_CUDA) ...@@ -59,9 +59,9 @@ function(setup_av_plugin PLUGIN_NAME BACKEND_NAME USE_CUDA)
set_property(TARGET ${PLUGIN_NAME} PROPERTY CXX_STANDARD 14) set_property(TARGET ${PLUGIN_NAME} PROPERTY CXX_STANDARD 14)
set(FFMPEG_INCLUDE_PATH ${CMAKE_EXTERNAL_DEPS}/include/ffmpeg) set(FFMPEG_INCLUDE_PATH ${CMAKE_EXTERNAL_DEPS}/include/ffmpeg)
if(APPLE_MACPORTS) if(MACPORTS)
set(FFMPEG_INCLUDE_PATH /opt/local/include) set(FFMPEG_INCLUDE_PATH /opt/local/include)
elseif(APPLE_BREW) else()
set(FFMPEG_INCLUDE_PATH /usr/local/include) set(FFMPEG_INCLUDE_PATH /usr/local/include)
endif() endif()
......
...@@ -59,22 +59,18 @@ function(setup_format BACKEND_NAME USE_CUDA) ...@@ -59,22 +59,18 @@ function(setup_format BACKEND_NAME USE_CUDA)
endif(WINDOWS) endif(WINDOWS)
if(APPLE) if(APPLE)
if(APPLE_MACPORTS) if(MACPORTS)
find_library(FFMPEG_avcodec NAMES avcodec) find_library(FFMPEG_avcodec NAMES avcodec)
find_library(FFMPEG_avformat NAMES avformat) find_library(FFMPEG_avformat NAMES avformat)
find_library(FFMPEG_avutil NAMES avutil) find_library(FFMPEG_avutil NAMES avutil)
target_include_directories(${LIST_NAME} PRIVATE /opt/local/include) target_include_directories(${LIST_NAME} PRIVATE /opt/local/include)
elseif(APPLE_BREW) else()
find_library(FFMPEG_avcodec NAMES avcodec) find_library(FFMPEG_avcodec NAMES avcodec)
find_library(FFMPEG_avformat NAMES avformat) find_library(FFMPEG_avformat NAMES avformat)
find_library(FFMPEG_avutil NAMES avutil) find_library(FFMPEG_avutil NAMES avutil)
target_include_directories(${LIST_NAME} PRIVATE /usr/local/include) target_include_directories(${LIST_NAME} PRIVATE /usr/local/include)
else()
find_library(FFMPEG_avcodec NAMES avcodec avcodec.57 PATHS ${CMAKE_EXTERNAL_DEPS}/lib/ffmpeg NO_DEFAULT_PATH)
find_library(FFMPEG_avformat NAMES avformat avformat.57 PATHS ${CMAKE_EXTERNAL_DEPS}/lib/ffmpeg NO_DEFAULT_PATH)
find_library(FFMPEG_avutil NAMES avutil avutil.55 PATHS ${CMAKE_EXTERNAL_DEPS}/lib/ffmpeg NO_DEFAULT_PATH)
endif() endif()
endif(APPLE) endif()
set(FFMPEG_libraries_cuda_${USE_CUDA} ${FFMPEG_avcodec} ${FFMPEG_avutil} ${FFMPEG_avformat} CACHE STRING "FFMPEG LIBRARIES") set(FFMPEG_libraries_cuda_${USE_CUDA} ${FFMPEG_avcodec} ${FFMPEG_avutil} ${FFMPEG_avformat} CACHE STRING "FFMPEG LIBRARIES")
endfunction() endfunction()
......
...@@ -30,24 +30,28 @@ set_property(TARGET ${PLUGIN_NAME} PROPERTY CXX_STANDARD 14) ...@@ -30,24 +30,28 @@ set_property(TARGET ${PLUGIN_NAME} PROPERTY CXX_STANDARD 14)
if(LINUX) if(LINUX)
find_library(JPEG NAMES "jpeg") find_library(JPEG NAMES "jpeg")
elseif(APPLE_MACPORTS) elseif(APPLE)
if(MACPORTS)
find_library(JPEG NAMES jpeg PATHS /opt/local/lib) find_library(JPEG NAMES jpeg PATHS /opt/local/lib)
elseif(APPLE_BREW) else()
find_library(JPEG NAMES jpeg PATHS /usr/local/lib) find_library(JPEG NAMES jpeg PATHS /usr/local/lib)
endif()
else() else()
find_library(TURBO_JPEG NAMES turbojpeg turbojpeg.0 PATHS "${CMAKE_EXTERNAL_DEPS}/lib/libjpeg-turbo" NO_DEFAULT_PATH) find_library(TURBO_JPEG NAMES turbojpeg turbojpeg.0 PATHS "${CMAKE_EXTERNAL_DEPS}/lib/libjpeg-turbo" NO_DEFAULT_PATH)
find_library(JPEG NAMES jpeg jpeg.62 PATHS "${CMAKE_EXTERNAL_DEPS}/lib/libjpeg-turbo" NO_DEFAULT_PATH) find_library(JPEG NAMES jpeg jpeg.62 PATHS "${CMAKE_EXTERNAL_DEPS}/lib/libjpeg-turbo" NO_DEFAULT_PATH)
endif() endif()
if(APPLE_MACPORTS) if(APPLE)
if(MACPORTS)
target_include_directories(${PLUGIN_NAME} SYSTEM PRIVATE /opt/local/include) target_include_directories(${PLUGIN_NAME} SYSTEM PRIVATE /opt/local/include)
elseif(APPLE_BREW) else()
target_include_directories(${PLUGIN_NAME} SYSTEM PRIVATE /usr/local/include) target_include_directories(${PLUGIN_NAME} SYSTEM PRIVATE /usr/local/include)
else() endif()
elseif(WINDOWS)
target_include_directories(${PLUGIN_NAME} SYSTEM PRIVATE "${CMAKE_EXTERNAL_DEPS}/include/libjpeg-turbo") target_include_directories(${PLUGIN_NAME} SYSTEM PRIVATE "${CMAKE_EXTERNAL_DEPS}/include/libjpeg-turbo")
endif() endif()
if(APPLE_MACPORTS OR LINUX OR APPLE_BREW) if(APPLE OR LINUX)
target_link_libraries(${PLUGIN_NAME} PRIVATE ${JPEG} ${VS_DISCOVERY}) target_link_libraries(${PLUGIN_NAME} PRIVATE ${JPEG} ${VS_DISCOVERY})
else() else()
target_link_libraries(${PLUGIN_NAME} PRIVATE ${TURBO_JPEG} ${JPEG} ${VS_DISCOVERY}) target_link_libraries(${PLUGIN_NAME} PRIVATE ${TURBO_JPEG} ${JPEG} ${VS_DISCOVERY})
......
...@@ -256,20 +256,14 @@ target_link_libraries(${PLUGIN_NAME} PRIVATE ${libmfxhw64} ${libva} ${libva_drm} ...@@ -256,20 +256,14 @@ target_link_libraries(${PLUGIN_NAME} PRIVATE ${libmfxhw64} ${libva} ${libva_drm}
endif() endif()
if(APPLE) if(APPLE)
if(APPLE_MACPORTS OR APPLE_BREW)
find_library(librtmp rtmp REQUIRED) find_library(librtmp rtmp REQUIRED)
find_library(libx264 x264 REQUIRED) find_library(libx264 x264 REQUIRED)
else()
find_library(librtmp rtmp HINTS ${CMAKE_EXTERNAL_LIB}/librtmp REQUIRED NO_DEFAULT_PATH)
find_library(libx264 x264 HINTS ${CMAKE_EXTERNAL_LIB}/ffmpeg REQUIRED NO_DEFAULT_PATH)
endif()
find_library(libfaac faac REQUIRED) find_library(libfaac faac REQUIRED)
find_library(libfaad faad.2 REQUIRED) find_library(libfaad faad.2 REQUIRED)
find_library(libmp3lame mp3lame REQUIRED) find_library(libmp3lame mp3lame REQUIRED)
target_include_directories(${PLUGIN_NAME} SYSTEM PRIVATE ${CMAKE_EXTERNAL_DEPS}/include/librtmp) if(MACPORTS)
target_include_directories(${PLUGIN_NAME} SYSTEM PRIVATE ${CMAKE_EXTERNAL_DEPS}/include/ffmpeg/x264)
# Use libfaac and libfaac from MacPorts
target_include_directories(${PLUGIN_NAME} SYSTEM PRIVATE /opt/local/include) target_include_directories(${PLUGIN_NAME} SYSTEM PRIVATE /opt/local/include)
endif()
target_link_libraries(${PLUGIN_NAME} PRIVATE ${librtmp} ${libx264} ${libmp3lame} ${libfaac} ${libfaad}) target_link_libraries(${PLUGIN_NAME} PRIVATE ${librtmp} ${libx264} ${libmp3lame} ${libfaac} ${libfaad})
endif() endif()
......
...@@ -46,11 +46,9 @@ if(ANDROID) ...@@ -46,11 +46,9 @@ if(ANDROID)
endif() endif()
if(APPLE) if(APPLE)
if(APPLE_MACPORTS) if(MACPORTS)
find_package(OpenCV REQUIRED core calib3d features2d imgproc flann video PATHS /opt/local NO_DEFAULT_PATH) find_package(OpenCV REQUIRED core calib3d features2d imgproc flann video PATHS /opt/local NO_DEFAULT_PATH)
elseif(APPLE_BREW)
find_package(OpenCV REQUIRED core calib3d features2d imgproc flann video PATHS "/usr/local/opt/opencv@3" "/usr/local" NO_DEFAULT_PATH)
else() else()
find_package(OpenCV REQUIRED core calib3d features2d imgproc flann video PATHS ${CMAKE_EXTERNAL_DEPS}/lib/opencv2/share/OpenCV NO_DEFAULT_PATH) find_package(OpenCV REQUIRED core calib3d features2d imgproc flann video PATHS "/usr/local/opt/opencv@3" "/usr/local" NO_DEFAULT_PATH)
endif() endif()
endif() endif()
if(APPLE_MACPORTS) if(APPLE)
if(MACPORTS)
find_path(OpenEXR_ROOT_DIR include/openexr/half.h HINTS /opt/local) find_path(OpenEXR_ROOT_DIR include/openexr/half.h HINTS /opt/local)
elseif(APPLE_BREW) else()
find_path(OpenEXR_ROOT_DIR include/openexr/half.h HINTS /usr/local) find_path(OpenEXR_ROOT_DIR include/openexr/half.h HINTS /usr/local)
endif()
else() else()
find_path(OpenEXR_ROOT_DIR include/openexr/half.h HINTS "${CMAKE_EXTERNAL_DEPS}" NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) find_path(OpenEXR_ROOT_DIR include/openexr/half.h HINTS "${CMAKE_EXTERNAL_DEPS}" NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
endif() endif()
if(APPLE) if(APPLE)
if(APPLE_MACPORTS) if(MACPORTS)
find_path(OpenEXR_LIBRARY_DIR libHalf.dylib HINTS /opt/local/lib) find_path(OpenEXR_LIBRARY_DIR libHalf.dylib HINTS /opt/local/lib)
elseif(APPLE_BREW)
find_path(OpenEXR_LIBRARY_DIR libHalf.dylib HINTS /usr/local/lib)
else() else()
find_path(OpenEXR_LIBRARY_DIR libHalf.dylib HINTS "${CMAKE_EXTERNAL_DEPS}" PATH_SUFFIXES lib/openexr/ NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) find_path(OpenEXR_LIBRARY_DIR libHalf.dylib HINTS /usr/local/lib)
endif() endif()
elseif(LINUX OR ANDROID) elseif(LINUX)
if(LINUX)
find_library(OpenEXR_LIBRARY_DIR libHalf.so) find_library(OpenEXR_LIBRARY_DIR libHalf.so)
else() elseif(ANDROID)
find_path(OpenEXR_LIBRARY_DIR libHalf.so HINTS "${CMAKE_EXTERNAL_DEPS}" PATH_SUFFIXES lib/openexr/ NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) 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) 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) find_path(OpenEXR_LIBRARY_DIR Half.lib HINTS "${CMAKE_EXTERNAL_DEPS}" PATH_SUFFIXES lib/openexr/ NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
endif() endif()
if(LINUX) if(LINUX)
find_path(OpenEXR_INCLUDE_DIR OpenEXR/half.h) find_path(OpenEXR_INCLUDE_DIR OpenEXR/half.h)
elseif(APPLE_MACPORTS) elseif(APPLE)
if(MACPORTS)
find_path(OpenEXR_INCLUDE_DIR OpenEXR/half.h HINTS /opt/local/include) find_path(OpenEXR_INCLUDE_DIR OpenEXR/half.h HINTS /opt/local/include)
elseif(APPLE_BREW) elseif()
find_path(OpenEXR_INCLUDE_DIR OpenEXR/half.h HINTS /usr/local/include) find_path(OpenEXR_INCLUDE_DIR OpenEXR/half.h HINTS /usr/local/include)
endif()
else() else()
find_path(OpenEXR_INCLUDE_DIR openexr/half.h HINTS "${CMAKE_EXTERNAL_DEPS}" PATH_SUFFIXES include/ NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) find_path(OpenEXR_INCLUDE_DIR openexr/half.h HINTS "${CMAKE_EXTERNAL_DEPS}" PATH_SUFFIXES include/ NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
endif() endif()
if(LINUX OR APPLE_MACPORTS OR APPLE_BREW) if(LINUX OR APPLE)
if(OpenEXR_INCLUDE_DIR AND EXISTS "${OpenEXR_INCLUDE_DIR}/OpenEXR/OpenEXRConfig.h") if(OpenEXR_INCLUDE_DIR AND EXISTS "${OpenEXR_INCLUDE_DIR}/OpenEXR/OpenEXRConfig.h")
file(STRINGS file(STRINGS
${OpenEXR_INCLUDE_DIR}/OpenEXR/OpenEXRConfig.h ${OpenEXR_INCLUDE_DIR}/OpenEXR/OpenEXRConfig.h
...@@ -57,7 +57,7 @@ foreach(OpenEXR_LIB Half Iex Imath IlmImf IlmThread) ...@@ -57,7 +57,7 @@ foreach(OpenEXR_LIB Half Iex Imath IlmImf IlmThread)
find_library(OpenEXR_${OpenEXR_LIB}_LIBRARY ${OpenEXR_LIB}) find_library(OpenEXR_${OpenEXR_LIB}_LIBRARY ${OpenEXR_LIB})
elseif(ANDROID) 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) 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)
elseif(APPLE_MACPORTS OR APPLE_BREW) elseif(APPLE)
find_library(OpenEXR_${OpenEXR_LIB}_LIBRARY ${OpenEXR_LIB} NO_DEFAULT_PATH HINTS ${OpenEXR_ROOT_DIR} PATH_SUFFIXES lib/) find_library(OpenEXR_${OpenEXR_LIB}_LIBRARY ${OpenEXR_LIB} NO_DEFAULT_PATH HINTS ${OpenEXR_ROOT_DIR} PATH_SUFFIXES lib/)
else() else()
find_library(OpenEXR_${OpenEXR_LIB}_LIBRARY ${OpenEXR_LIB} NO_DEFAULT_PATH HINTS "${CMAKE_EXTERNAL_DEPS}" PATH_SUFFIXES lib/openexr/ NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) find_library(OpenEXR_${OpenEXR_LIB}_LIBRARY ${OpenEXR_LIB} NO_DEFAULT_PATH HINTS "${CMAKE_EXTERNAL_DEPS}" PATH_SUFFIXES lib/openexr/ NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
......
...@@ -18,7 +18,6 @@ sudo port install opencv glew gsed jpeg libpng openal \ ...@@ -18,7 +18,6 @@ sudo port install opencv glew gsed jpeg libpng openal \
``` ```
cmake -DCREATE_BOX_PACKAGE=OFF \ cmake -DCREATE_BOX_PACKAGE=OFF \
-DGPU_BACKEND_CUDA=ON -DGPU_BACKEND_OPENCL=ON \ -DGPU_BACKEND_CUDA=ON -DGPU_BACKEND_OPENCL=ON \
-DAPPLE_MACPORTS=ON \
-DQt5_DIR=~/Qt/5.9.6/clang_64/lib/cmake/Qt5 \ -DQt5_DIR=~/Qt/5.9.6/clang_64/lib/cmake/Qt5 \
-G Ninja \ -G Ninja \
stitchEm stitchEm
...@@ -117,4 +116,7 @@ cmake -DGPU_BACKEND_CUDA=ON -DGPU_BACKEND_OPENCL=ON \ ...@@ -117,4 +116,7 @@ cmake -DGPU_BACKEND_CUDA=ON -DGPU_BACKEND_OPENCL=ON \
| Option | Default | Usage | | Option | Default | Usage |
|:---------------------|:----------|:---------------------------------------------------------------------------------------------------------------------| |:---------------------|:----------|:---------------------------------------------------------------------------------------------------------------------|
| Qt5_DIR | undefined | Qt5 install path | | Qt5_DIR | undefined | Qt5 install path |
### macOS
| Option | Default | Usage |
|:---------------------|:----------|:---------------------------------------------------------------------------------------------------------------------|
| MACPORTS | ON | ON if you want to use MacPorts, OFF to use Homebrew |
...@@ -6,18 +6,11 @@ set(VS_LIB_SYSTEM_INCLUDES ...@@ -6,18 +6,11 @@ set(VS_LIB_SYSTEM_INCLUDES
find_library(IO_KIT IOKit REQUIRED) find_library(IO_KIT IOKit REQUIRED)
if(APPLE_MACPORTS OR APPLE_BREW) find_package(Ceres REQUIRED)
find_package(Ceres REQUIRED) set(CERES_LIBS general ${CERES_LIBRARIES})
set(CERES_LIBS general ${CERES_LIBRARIES})
if(APPLE_MACPORTS) if(MACPORTS)
set(EIGEN3_INCLUDE_DIRS /opt/local/include/eigen3) set(EIGEN3_INCLUDE_DIRS /opt/local/include/eigen3)
else()
set(EIGEN3_INCLUDE_DIRS /usr/local/include/eigen3)
endif()
else() else()
find_library(CERES_OPTIMIZED_LIBRARY NAMES ceres ceres.1 PATHS ${CMAKE_EXTERNAL_DEPS}/lib/ceres) set(EIGEN3_INCLUDE_DIRS /usr/local/include/eigen3)
set(CERES_LIBS
general ${CERES_OPTIMIZED_LIBRARY})
set(EIGEN3_INCLUDE_DIRS ${CMAKE_EXTERNAL_DEPS}/lib/eigen)
endif() endif()
...@@ -9,19 +9,15 @@ link_target_to_libvideostitch(${CMD_NAME}) ...@@ -9,19 +9,15 @@ link_target_to_libvideostitch(${CMD_NAME})
if(LINUX) if(LINUX)
find_library(GLFW glfw REQUIRED) find_library(GLFW glfw REQUIRED)
elseif(APPLE) elseif(APPLE)
if(APPLE_MACPORTS OR APPLE_BREW)
find_library(GLFW glfw HINTS "${CMAKE_EXTERNAL_LIB}/glfw" REQUIRED) find_library(GLFW glfw HINTS "${CMAKE_EXTERNAL_LIB}/glfw" REQUIRED)
if(APPLE_MACPORTS) if(MACPORTS)
target_include_directories(${CMD_NAME} PRIVATE /opt/local/include) target_include_directories(${CMD_NAME} PRIVATE /opt/local/include)
else() else()
target_include_directories(${CMD_NAME} PRIVATE /usr/local/include) target_include_directories(${CMD_NAME} PRIVATE /usr/local/include)
endif() endif()
else()
find_library(GLFW glfw HINTS "${CMAKE_EXTERNAL_LIB}/glfw" REQUIRED NO_DEFAULT_PATH)
endif()
elseif(WINDOWS) elseif(WINDOWS)
find_library(GLFW glfw3 HINTS "${CMAKE_EXTERNAL_LIB}/glfw" REQUIRED NO_DEFAULT_PATH) find_library(GLFW glfw3 HINTS "${CMAKE_EXTERNAL_LIB}/glfw" REQUIRED NO_DEFAULT_PATH)
endif(LINUX) endif()
target_include_directories(${CMD_NAME} PRIVATE "${CMAKE_EXTERNAL_DEPS}/include") target_include_directories(${CMD_NAME} PRIVATE "${CMAKE_EXTERNAL_DEPS}/include")
target_link_libraries(${CMD_NAME} PRIVATE ${VS_DISCOVERY} ${GLFW}) target_link_libraries(${CMD_NAME} PRIVATE ${VS_DISCOVERY} ${GLFW})
......
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