Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

Commit

Permalink
hunterize
Browse files Browse the repository at this point in the history
  • Loading branch information
caseymcc committed Jun 26, 2017
1 parent 2d4129b commit 33bb66c
Show file tree
Hide file tree
Showing 3 changed files with 657 additions and 80 deletions.
225 changes: 145 additions & 80 deletions surround360_render/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,52 @@
CMAKE_MINIMUM_REQUIRED(VERSION 3.2)

PROJECT(Surround360Render CXX)
OPTION(USE_HUNTER "Enable Hunter CMake package handler, auto downloads and compiles require packages" OFF)

FIND_PACKAGE(OpenCV)
FIND_PACKAGE(Ceres REQUIRED)
IF(USE_HUNTER)
include(${CMAKE_CURRENT_LIST_DIR}/cmake/Hunter/HunterGate.cmake)

HunterGate(
URL "https://github.com/ruslo/hunter/archive/v0.18.30.tar.gz"
SHA1 "6fc9258f984aed303eb960a95e36e19f2e7e83be"
LOCAL
)
ENDIF()

PROJECT(Surround360Render)

IF(USE_HUNTER)
HUNTER_ADD_PACKAGE(Boost COMPONENTS system filesystem)
HUNTER_ADD_PACKAGE(gflags)
HUNTER_ADD_PACKAGE(glog)
HUNTER_ADD_PACKAGE(Eigen)
HUNTER_ADD_PACKAGE(OpenCV)
HUNTER_ADD_PACKAGE(ceres-solver)

add_definitions("-DBOOST_ALL_NO_LIB") #remove auto linking from boost

FIND_PACKAGE(Boost CONFIG REQUIRED system filesystem)
FIND_PACKAGE(gflags CONFIG REQUIRED)
FIND_PACKAGE(glog CONFIG REQUIRED)
FIND_PACKAGE(Eigen3 CONFIG REQUIRED)
FIND_PACKAGE(Ceres CONFIG REQUIRED)

SET(GLOG_LIBS glog::glog)
SET(GFLAGS_LIBS gflags-static)
SET(BOOST_LIBS Boost::system Boost::filesystem)
set(EIGEN_LIBS Eigen3::Eigen)
SET(DOUBLE_CONVERSION_LIBS "")
ELSE()
FIND_PACKAGE(Ceres REQUIRED)
INCLUDE_DIRECTORIES(/usr/local/include/eigen3)

SET(GLOG_LIBs glog)
SET(GFLAGS_LIBS gflags)
SET(BOOST_LIBS boost_filesystem boost_system)
set(EIGEN_LIBS "")
SET(DOUBLE_CONVERSION_LIBS double-conversion)
ENDIF()

FIND_PACKAGE(OpenCV REQUIRED)

INCLUDE_DIRECTORIES(${OpenCV_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/source)
Expand All @@ -12,8 +55,8 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/source/optical_flow)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/source/camera_isp)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/source/calibration)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/source/render)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/source/thirdparty/supereasyjson)
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR})
INCLUDE_DIRECTORIES(/usr/local/include/eigen3)

if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# required for clang, including AppleClang
Expand Down Expand Up @@ -98,7 +141,19 @@ ADD_LIBRARY(
${render_SRC}
${util_SRC}
)

TARGET_COMPILE_FEATURES(LibVrCamera PRIVATE cxx_range_for)
IF(USE_HUNTER)
TARGET_LINK_LIBRARIES(
LibVrCamera
Eigen3::Eigen
Boost::system
Boost::filesystem
glog::glog
gflags-static
LibJSON
)
ENDIF()

### Raw2Rgb ###

Expand All @@ -125,46 +180,61 @@ IF (DEFINED HALIDE_DIR)
IF(NOT APPLE AND NOT MSVC)
TARGET_LINK_LIBRARIES(
Raw2Rgb
"${CMAKE_CURRENT_BINARY_DIR}/CameraIspGenFast8${CMAKE_STATIC_LIBRARY_SUFFIX}"
"${CMAKE_CURRENT_BINARY_DIR}/CameraIspGen8${CMAKE_STATIC_LIBRARY_SUFFIX}"
"${CMAKE_CURRENT_BINARY_DIR}/CameraIspGenFast16${CMAKE_STATIC_LIBRARY_SUFFIX}"
"${CMAKE_CURRENT_BINARY_DIR}/CameraIspGen16${CMAKE_STATIC_LIBRARY_SUFFIX}"
LibVrCamera
LibJSON
glog
gflags
${OpenCV_LIBS}
Halide
dl
tinfo
z)
"${CMAKE_CURRENT_BINARY_DIR}/CameraIspGenFast8${CMAKE_STATIC_LIBRARY_SUFFIX}"
"${CMAKE_CURRENT_BINARY_DIR}/CameraIspGen8${CMAKE_STATIC_LIBRARY_SUFFIX}"
"${CMAKE_CURRENT_BINARY_DIR}/CameraIspGenFast16${CMAKE_STATIC_LIBRARY_SUFFIX}"
"${CMAKE_CURRENT_BINARY_DIR}/CameraIspGen16${CMAKE_STATIC_LIBRARY_SUFFIX}"
LibVrCamera
LibJSON
${GLOG_LIBS}
${GFLAG_LIBS}
${OpenCV_LIBS}
Halide
dl
tinfo
z
)
ELSE()
TARGET_LINK_LIBRARIES(
Raw2Rgb
"${CMAKE_CURRENT_BINARY_DIR}/CameraIspGenFast8${CMAKE_STATIC_LIBRARY_SUFFIX}"
"${CMAKE_CURRENT_BINARY_DIR}/CameraIspGen8${CMAKE_STATIC_LIBRARY_SUFFIX}"
"${CMAKE_CURRENT_BINARY_DIR}/CameraIspGenFast16${CMAKE_STATIC_LIBRARY_SUFFIX}"
"${CMAKE_CURRENT_BINARY_DIR}/CameraIspGen16${CMAKE_STATIC_LIBRARY_SUFFIX}"
LibVrCamera
LibJSON
glog
gflags
${OpenCV_LIBS}
Halide
dl)
"${CMAKE_CURRENT_BINARY_DIR}/CameraIspGenFast8${CMAKE_STATIC_LIBRARY_SUFFIX}"
"${CMAKE_CURRENT_BINARY_DIR}/CameraIspGen8${CMAKE_STATIC_LIBRARY_SUFFIX}"
"${CMAKE_CURRENT_BINARY_DIR}/CameraIspGenFast16${CMAKE_STATIC_LIBRARY_SUFFIX}"
"${CMAKE_CURRENT_BINARY_DIR}/CameraIspGen16${CMAKE_STATIC_LIBRARY_SUFFIX}"
LibVrCamera
LibJSON
${GLOG_LIBS}
${GFLAG_LIBS}
${OpenCV_LIBS}
Halide
dl
)
ENDIF()
ELSE()
ADD_EXECUTABLE(Raw2Rgb source/camera_isp/Raw2Rgb.cpp)

if(USE_HUNTER) #dl and z not supported in hunter yet
TARGET_LINK_LIBRARIES(
Raw2Rgb
LibVrCamera
LibJSON
glog
gflags
dl
z
${OpenCV_LIBS}
LibVrCamera
LibJSON
${GLOG_LIBS}
${GFLAG_LIBS}
${OpenCV_LIBS}
)
else()
TARGET_LINK_LIBRARIES(
Raw2Rgb
LibVrCamera
LibJSON
${GLOG_LIBS}
${GFLAG_LIBS}
dl
z
${OpenCV_LIBS}
)
endif()

ENDIF()

### TestRenderStereoPanorama ###
Expand All @@ -178,9 +248,8 @@ TARGET_LINK_LIBRARIES(
TestRenderStereoPanorama
LibVrCamera
LibJSON
folly
glog
gflags
${GLOG_LIBS}
${GFLAG_LIBS}
${OpenCV_LIBS}
${PLATFORM_SPECIFIC_LIBS}
)
Expand All @@ -196,8 +265,10 @@ TARGET_LINK_LIBRARIES(
TestJson
LibVrCamera
LibJSON
glog
gflags
${GLOG_LIBS}
${GFLAG_LIBS}
${BOOST_LIBS}
${OpenCV_LIBS}
)

### TestOpticalFlow ###
Expand All @@ -211,8 +282,9 @@ TARGET_LINK_LIBRARIES(
TestOpticalFlow
LibVrCamera
LibJSON
glog
gflags
${GLOG_LIBS}
${GFLAG_LIBS}
${BOOST_LIBS}
${OpenCV_LIBS}
${PLATFORM_SPECIFIC_LIBS}
)
Expand All @@ -227,8 +299,8 @@ TARGET_COMPILE_FEATURES(TestLogger PRIVATE cxx_range_for)
TARGET_LINK_LIBRARIES(
TestLogger
LibVrCamera
glog
gflags
${GLOG_LIBS}
${GFLAG_LIBS}
${OpenCV_LIBS}
)

Expand All @@ -249,8 +321,8 @@ IF (DEFINED HALIDE_DIR)
Unpacker
LibVrCamera
LibJSON
glog
gflags
${GLOG_LIBS}
${GFLAG_LIBS}
${OpenCV_LIBS}
"${CMAKE_CURRENT_BINARY_DIR}/CameraIspGenFast8${CMAKE_STATIC_LIBRARY_SUFFIX}"
"${CMAKE_CURRENT_BINARY_DIR}/CameraIspGen8${CMAKE_STATIC_LIBRARY_SUFFIX}"
Expand All @@ -268,8 +340,8 @@ IF (DEFINED HALIDE_DIR)
Unpacker
LibVrCamera
LibJSON
glog
gflags
${GLOG_LIBS}
${GFLAG_LIBS}
${OpenCV_LIBS}
"${CMAKE_CURRENT_BINARY_DIR}/CameraIspGenFast8${CMAKE_STATIC_LIBRARY_SUFFIX}"
"${CMAKE_CURRENT_BINARY_DIR}/CameraIspGen8${CMAKE_STATIC_LIBRARY_SUFFIX}"
Expand All @@ -296,9 +368,8 @@ TARGET_LINK_LIBRARIES(
TestHyperPreview
LibVrCamera
LibJSON
folly
glog
gflags
${GLOG_LIBS}
${GFLAG_LIBS}
${OpenCV_LIBS}
${PLATFORM_SPECIFIC_LIBS}
)
Expand All @@ -314,9 +385,8 @@ TARGET_LINK_LIBRARIES(
TestPoleRemoval
LibVrCamera
LibJSON
folly
gflags
glog
${GLOG_LIBS}
${GFLAG_LIBS}
${OpenCV_LIBS}
${PLATFORM_SPECIFIC_LIBS}
)
Expand All @@ -332,8 +402,8 @@ TARGET_LINK_LIBRARIES(
TestExtractAlphaChannel
LibVrCamera
LibJSON
gflags
glog
${GLOG_LIBS}
${GFLAG_LIBS}
${OpenCV_LIBS}
${PLATFORM_SPECIFIC_LIBS}
)
Expand All @@ -358,8 +428,8 @@ IF (DEFINED HALIDE_DIR)
"${CMAKE_CURRENT_BINARY_DIR}/CameraIspGen16${CMAKE_STATIC_LIBRARY_SUFFIX}"
LibVrCamera
LibJSON
gflags
glog
${GLOG_LIBS}
${GFLAG_LIBS}
${OpenCV_LIBS}
${CERES_LIBRARIES}
Halide
Expand All @@ -376,8 +446,8 @@ IF (DEFINED HALIDE_DIR)
"${CMAKE_CURRENT_BINARY_DIR}/CameraIspGen16${CMAKE_STATIC_LIBRARY_SUFFIX}"
LibVrCamera
LibJSON
gflags
glog
${GLOG_LIBS}
${GFLAG_LIBS}
${OpenCV_LIBS}
${CERES_LIBRARIES}
Halide
Expand All @@ -394,8 +464,8 @@ ELSE()
TestColorCalibration
LibVrCamera
LibJSON
gflags
glog
${GLOG_LIBS}
${GFLAG_LIBS}
${OpenCV_LIBS}
${CERES_LIBRARIES}
${PLATFORM_SPECIFIC_LIBS}
Expand All @@ -421,9 +491,8 @@ IF (DEFINED HALIDE_DIR)
"${CMAKE_CURRENT_BINARY_DIR}/CameraIspGen16${CMAKE_STATIC_LIBRARY_SUFFIX}"
LibVrCamera
LibJSON
gflags
glog
folly
${GLOG_LIBS}
${GFLAG_LIBS}
${OpenCV_LIBS}
${CERES_LIBRARIES}
Halide
Expand All @@ -440,9 +509,8 @@ IF (DEFINED HALIDE_DIR)
"${CMAKE_CURRENT_BINARY_DIR}/CameraIspGen16${CMAKE_STATIC_LIBRARY_SUFFIX}"
LibVrCamera
LibJSON
gflags
glog
folly
${GLOG_LIBS}
${GFLAG_LIBS}
${OpenCV_LIBS}
${CERES_LIBRARIES}
Halide
Expand All @@ -459,9 +527,8 @@ ELSE()
TestVignettingCalibration
LibVrCamera
LibJSON
gflags
glog
folly
${GLOG_LIBS}
${GFLAG_LIBS}
${OpenCV_LIBS}
${CERES_LIBRARIES}
${PLATFORM_SPECIFIC_LIBS}
Expand All @@ -478,9 +545,8 @@ TARGET_LINK_LIBRARIES(
TestVignettingDataAcquisition
LibVrCamera
LibJSON
gflags
glog
folly
${GLOG_LIBS}
${GFLAG_LIBS}
${OpenCV_LIBS}
${CERES_LIBRARIES}
${PLATFORM_SPECIFIC_LIBS}
Expand All @@ -496,12 +562,11 @@ TARGET_LINK_LIBRARIES(
GeometricCalibration
LibVrCamera
LibJSON
gflags
glog
folly
boost_filesystem
boost_system
double-conversion
${GLOG_LIBS}
${GFLAG_LIBS}
${EIGEN_LIBS}
${BOOST_LIBS}
${DOUBLE_CONVERSION_LIBS}
${OpenCV_LIBS}
${PLATFORM_SPECIFIC_LIBS}
${CERES_LIBRARIES}
Expand Down
Loading

0 comments on commit 33bb66c

Please sign in to comment.