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:
script:
- mkdir 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
- name: CUDA 8 Linux
dist: xenial
......
......@@ -90,6 +90,7 @@ endif( NOT NO_CCACHE )
# ----------------------------------------------------------------------------
if(APPLE)
message(STATUS "System: APPLE")
option(MACPORTS "Use MacPorts, OFF uses Homebrew" ON)
endif(APPLE)
if(${CMAKE_SYSTEM_NAME} MATCHES "Android")
......
......@@ -59,9 +59,9 @@ function(setup_av_plugin PLUGIN_NAME BACKEND_NAME USE_CUDA)
set_property(TARGET ${PLUGIN_NAME} PROPERTY CXX_STANDARD 14)
set(FFMPEG_INCLUDE_PATH ${CMAKE_EXTERNAL_DEPS}/include/ffmpeg)
if(APPLE_MACPORTS)
if(MACPORTS)
set(FFMPEG_INCLUDE_PATH /opt/local/include)
elseif(APPLE_BREW)
else()
set(FFMPEG_INCLUDE_PATH /usr/local/include)
endif()
......
......@@ -59,22 +59,18 @@ function(setup_format BACKEND_NAME USE_CUDA)
endif(WINDOWS)
if(APPLE)
if(APPLE_MACPORTS)
if(MACPORTS)
find_library(FFMPEG_avcodec NAMES avcodec)
find_library(FFMPEG_avformat NAMES avformat)
find_library(FFMPEG_avutil NAMES avutil)
target_include_directories(${LIST_NAME} PRIVATE /opt/local/include)
elseif(APPLE_BREW)
else()
find_library(FFMPEG_avcodec NAMES avcodec)
find_library(FFMPEG_avformat NAMES avformat)
find_library(FFMPEG_avutil NAMES avutil)
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(APPLE)
endif()
set(FFMPEG_libraries_cuda_${USE_CUDA} ${FFMPEG_avcodec} ${FFMPEG_avutil} ${FFMPEG_avformat} CACHE STRING "FFMPEG LIBRARIES")
endfunction()
......
......@@ -30,24 +30,28 @@ set_property(TARGET ${PLUGIN_NAME} PROPERTY CXX_STANDARD 14)
if(LINUX)
find_library(JPEG NAMES "jpeg")
elseif(APPLE_MACPORTS)
find_library(JPEG NAMES jpeg PATHS /opt/local/lib)
elseif(APPLE_BREW)
find_library(JPEG NAMES jpeg PATHS /usr/local/lib)
elseif(APPLE)
if(MACPORTS)
find_library(JPEG NAMES jpeg PATHS /opt/local/lib)
else()
find_library(JPEG NAMES jpeg PATHS /usr/local/lib)
endif()
else()
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)
endif()
if(APPLE_MACPORTS)
target_include_directories(${PLUGIN_NAME} SYSTEM PRIVATE /opt/local/include)
elseif(APPLE_BREW)
target_include_directories(${PLUGIN_NAME} SYSTEM PRIVATE /usr/local/include)
else()
if(APPLE)
if(MACPORTS)
target_include_directories(${PLUGIN_NAME} SYSTEM PRIVATE /opt/local/include)
else()
target_include_directories(${PLUGIN_NAME} SYSTEM PRIVATE /usr/local/include)
endif()
elseif(WINDOWS)
target_include_directories(${PLUGIN_NAME} SYSTEM PRIVATE "${CMAKE_EXTERNAL_DEPS}/include/libjpeg-turbo")
endif()
if(APPLE_MACPORTS OR LINUX OR APPLE_BREW)
if(APPLE OR LINUX)
target_link_libraries(${PLUGIN_NAME} PRIVATE ${JPEG} ${VS_DISCOVERY})
else()
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}
endif()
if(APPLE)
if(APPLE_MACPORTS OR APPLE_BREW)
find_library(librtmp rtmp 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(librtmp rtmp REQUIRED)
find_library(libx264 x264 REQUIRED)
find_library(libfaac faac REQUIRED)
find_library(libfaad faad.2 REQUIRED)
find_library(libmp3lame mp3lame REQUIRED)
target_include_directories(${PLUGIN_NAME} SYSTEM PRIVATE ${CMAKE_EXTERNAL_DEPS}/include/librtmp)
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)
if(MACPORTS)
target_include_directories(${PLUGIN_NAME} SYSTEM PRIVATE /opt/local/include)
endif()
target_link_libraries(${PLUGIN_NAME} PRIVATE ${librtmp} ${libx264} ${libmp3lame} ${libfaac} ${libfaad})
endif()
......
......@@ -46,11 +46,9 @@ if(ANDROID)
endif()
if(APPLE)
if(APPLE_MACPORTS)
if(MACPORTS)
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()
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()
if(APPLE_MACPORTS)
find_path(OpenEXR_ROOT_DIR include/openexr/half.h HINTS /opt/local)
elseif(APPLE_BREW)
if(APPLE)
if(MACPORTS)
find_path(OpenEXR_ROOT_DIR include/openexr/half.h HINTS /opt/local)
else()
find_path(OpenEXR_ROOT_DIR include/openexr/half.h HINTS /usr/local)
endif()
else()
find_path(OpenEXR_ROOT_DIR include/openexr/half.h HINTS "${CMAKE_EXTERNAL_DEPS}" NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
endif()
if(APPLE)
if(APPLE_MACPORTS)
if(MACPORTS)
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()
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)
find_library(OpenEXR_LIBRARY_DIR libHalf.so)
else()
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.dylib HINTS /usr/local/lib)
endif()
elseif(LINUX)
find_library(OpenEXR_LIBRARY_DIR libHalf.so)
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)
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)
find_path(OpenEXR_INCLUDE_DIR OpenEXR/half.h)
elseif(APPLE_MACPORTS)
find_path(OpenEXR_INCLUDE_DIR OpenEXR/half.h HINTS /opt/local/include)
elseif(APPLE_BREW)
find_path(OpenEXR_INCLUDE_DIR OpenEXR/half.h HINTS /usr/local/include)
elseif(APPLE)
if(MACPORTS)
find_path(OpenEXR_INCLUDE_DIR OpenEXR/half.h HINTS /opt/local/include)
elseif()
find_path(OpenEXR_INCLUDE_DIR OpenEXR/half.h HINTS /usr/local/include)
endif()
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 OR APPLE_MACPORTS OR APPLE_BREW)
if(LINUX OR APPLE)
if(OpenEXR_INCLUDE_DIR AND EXISTS "${OpenEXR_INCLUDE_DIR}/OpenEXR/OpenEXRConfig.h")
file(STRINGS
${OpenEXR_INCLUDE_DIR}/OpenEXR/OpenEXRConfig.h
......@@ -57,7 +57,7 @@ foreach(OpenEXR_LIB Half Iex Imath IlmImf IlmThread)
find_library(OpenEXR_${OpenEXR_LIB}_LIBRARY ${OpenEXR_LIB})
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)
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/)
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)
......
......@@ -18,7 +18,6 @@ sudo port install opencv glew gsed jpeg libpng openal \
```
cmake -DCREATE_BOX_PACKAGE=OFF \
-DGPU_BACKEND_CUDA=ON -DGPU_BACKEND_OPENCL=ON \
-DAPPLE_MACPORTS=ON \
-DQt5_DIR=~/Qt/5.9.6/clang_64/lib/cmake/Qt5 \
-G Ninja \
stitchEm
......@@ -117,4 +116,7 @@ cmake -DGPU_BACKEND_CUDA=ON -DGPU_BACKEND_OPENCL=ON \
| Option | Default | Usage |
|:---------------------|:----------|:---------------------------------------------------------------------------------------------------------------------|
| 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
find_library(IO_KIT IOKit REQUIRED)
if(APPLE_MACPORTS OR APPLE_BREW)
find_package(Ceres REQUIRED)
set(CERES_LIBS general ${CERES_LIBRARIES})
find_package(Ceres REQUIRED)
set(CERES_LIBS general ${CERES_LIBRARIES})
if(APPLE_MACPORTS)
set(EIGEN3_INCLUDE_DIRS /opt/local/include/eigen3)
else()
set(EIGEN3_INCLUDE_DIRS /usr/local/include/eigen3)
endif()
if(MACPORTS)
set(EIGEN3_INCLUDE_DIRS /opt/local/include/eigen3)
else()
find_library(CERES_OPTIMIZED_LIBRARY NAMES ceres ceres.1 PATHS ${CMAKE_EXTERNAL_DEPS}/lib/ceres)
set(CERES_LIBS
general ${CERES_OPTIMIZED_LIBRARY})
set(EIGEN3_INCLUDE_DIRS ${CMAKE_EXTERNAL_DEPS}/lib/eigen)
set(EIGEN3_INCLUDE_DIRS /usr/local/include/eigen3)
endif()
......@@ -9,19 +9,15 @@ link_target_to_libvideostitch(${CMD_NAME})
if(LINUX)
find_library(GLFW glfw REQUIRED)
elseif(APPLE)
if(APPLE_MACPORTS OR APPLE_BREW)
find_library(GLFW glfw HINTS "${CMAKE_EXTERNAL_LIB}/glfw" REQUIRED)
if(APPLE_MACPORTS)
target_include_directories(${CMD_NAME} PRIVATE /opt/local/include)
else()
target_include_directories(${CMD_NAME} PRIVATE /usr/local/include)
endif()
find_library(GLFW glfw HINTS "${CMAKE_EXTERNAL_LIB}/glfw" REQUIRED)
if(MACPORTS)
target_include_directories(${CMD_NAME} PRIVATE /opt/local/include)
else()
find_library(GLFW glfw HINTS "${CMAKE_EXTERNAL_LIB}/glfw" REQUIRED NO_DEFAULT_PATH)
target_include_directories(${CMD_NAME} PRIVATE /usr/local/include)
endif()
elseif(WINDOWS)
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_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