Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/ccpp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Install generic prerequisites
run: |
sudo apt-get update
sudo apt install -y libtbb-dev libavcodec-dev libavutil-dev libavformat-dev libswscale-dev libjpeg-dev libpng-dev libopenblas-dev liblapacke-dev
sudo apt install -y libtbb-dev libavcodec-dev libavutil-dev libavformat-dev libswscale-dev libjpeg-dev libpng-dev libopenblas-dev liblapacke-dev libfftw3-dev libsoapysdr-dev
- name: Install OpenCV prerequisites
run: |
sudo apt-get update
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu_no_opencv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Install generic prerequisites
run: |
sudo apt-get update
sudo apt install -y libtbb-dev libavcodec-dev libavutil-dev libavformat-dev libswscale-dev libjpeg-dev libpng-dev libopenblas-dev liblapacke-dev
sudo apt install -y libtbb-dev libavcodec-dev libavutil-dev libavformat-dev libswscale-dev libjpeg-dev libpng-dev libopenblas-dev liblapacke-dev libfftw3-dev libsoapysdr-dev
- name: Install Qt
run: |
sudo apt install -y qt5-default qtscript-tools qtscript5-dev libqt5serialport5-dev
Expand Down
52 changes: 52 additions & 0 deletions BuildCoreCVS.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
@echo off

pushd %~dp0

set config=Release

set build_sln=ON
if /i '%1' == 'OFF' set build_sln=OFF

set configs=Release
set blddir=build

call cmake\find_cmake.bat

if not exist %blddir% mkdir %blddir%

pushd %blddir%

call "%MSVS_LOCATION%..\..\VC\Auxiliary\Build\vcvarsall.bat" x64

echo Generate CoreCVS sln

cmake ..\ -G%generator_string% -Thost=x64 -DCMAKE_CONFIGURATION_TYPES=%configs%
if not %errorlevel% == 0 (
echo CMake CoreCVS generation error!
popd
goto ERROR
)

:BUILD
if '%build_sln%' == 'OFF' GOTO SUCCESS
echo CoreCVS is building
cmake --build . --config %config% -- /m /verbosity:normal
if not %errorlevel%==0 (
echo CoreCVS build failed
popd
goto ERROR
)

popd

:SUCCESS
popd
exit /b 0

:USAGE
echo usage %~n0%~x0 [ON^|OFF]
echo arg1: ON=generate and build solution, OFF=generate solution only without build

:ERROR
popd
exit /b 1
171 changes: 91 additions & 80 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,88 +1,117 @@
cmake_minimum_required (VERSION 3.10)
project (CoreCVS)
cmake_minimum_required (VERSION 3.11)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set (CoreCVS_VERSION_MAJOR 1)
set (CoreCVS_VERSION_MINOR 0)
project(CoreCVS)

set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake/Modules/")
set(CoreCVS_VERSION_MAJOR 1)
set(CoreCVS_VERSION_MINOR 0)

# Debug/Release switch

#set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -g")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -g")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake/Modules/")

include(cmake/CMakeCpuOptions.cmake)
include(cmake/functions.cmake)
include(cmake/utility.cmake)

set_property(GLOBAL PROPERTY USE_FOLDERS ON)

file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/bin)

# Overall dependances
option(USE_TBB "Should compile with TBB" YES)
IF ( USE_TBB )
MESSAGE( STATUS "Including TBB on CORECVS build" )
if(USE_TBB)
message(STATUS "Including TBB on CORECVS build")
find_package(TBB REQUIRED)
if (TBB_LIBRARY)
add_definitions(-DWITH_TBB)
endif()
ENDIF ()

endif()

#option(USE_TBB "Should compile with FILESYSTEM" YES)
#IF ( USE_TBB )
# MESSAGE( STATUS "Including FILESYSTEM on CORECVS build" )
#if (USE_TBB)
# message(STATUS "Including FILESYSTEM on CORECVS build")
# find_package(Filesystem)
# if (FILESYSTEM_LIBRARY)
# add_definitions(-DWITH_FILESYSTEM)
# endif()
#ENDIF ()
#endif()

option(USE_OPENBLAS "Should compile with OpenBlas" YES)
IF ( USE_OPENBLAS )
MESSAGE( STATUS "Including OpenBlas and Lapacke on CORECVS build" )
find_package( OpenBlas )
find_package( Lapacke )
if(USE_OPENBLAS)
message(STATUS "Including OpenBlas and Lapacke on CORECVS build")
find_package(OpenBlas)
find_package(Lapacke)
if (OpenBLAS_LIB AND Lapacke_LIB)
add_definitions(-DWITH_BLAS)
endif()
ENDIF ()
endif()

option(USE_OPENCV "Should compile with OpenCV" YES)
IF ( USE_OPENCV )
MESSAGE( STATUS "Including OpenCV on CORECVS build" )
find_package( OpenCV )
if (OpenCV_LIBS)
if(USE_OPENCV)
message(STATUS "Including OpenCV on CORECVS build")
find_package(OpenCV)
if(OpenCV_LIBS)
add_definitions(-DWITH_OPENCV)
else()
message("You requested OPENCV in the build, but none was found.")
endif()
ENDIF ()
endif()

option(USE_LIBPNG "Should compile with LibPNG" YES)
IF ( USE_LIBPNG )
MESSAGE( STATUS "Including LibPNG wherever possible" )
find_package( Png )
ENDIF ()
if(USE_LIBPNG)
message(STATUS "Including LibPNG wherever possible")
find_package(Png)
endif()

option(USE_LIBJPEG "Should compile with LibJPEG" YES)
IF ( USE_LIBJPEG )
MESSAGE( STATUS "Including LibJpeg wherever possible" )
find_package( Jpeg )
ENDIF ()
if(USE_LIBJPEG)
message(STATUS "Including LibJpeg wherever possible")
find_package(Jpeg)
endif()

option(USE_EIGEN "Should compile with Eigen solver" YES)
IF ( USE_EIGEN )
MESSAGE( STATUS "Including Eigen solver wherever possible" )
find_package( Eigen )
ENDIF ()
if(USE_EIGEN)
message(STATUS "Including Eigen solver wherever possible")
find_package(Eigen)
endif()

option(USE_CERES "Should compile with Ceres solver" YES)
IF ( USE_CERES )
MESSAGE( STATUS "Including Ceres solver wherever possible" )
find_package( Ceres )
if(USE_CERES)
message(STATUS "Including Ceres solver wherever possible")
find_package(Ceres)
endif()

option(USE_LIBFFT "Should compile with libfftw" YES)
IF ( USE_LIBFFT )
MESSAGE( STATUS "Including libfftw wherever possible" )
find_package( FFTW )
ENDIF ()

option(USE_AVCODEC "Should compile with AVCODEC" YES)
IF ( USE_AVCODEC )
MESSAGE( STATUS "Including AVCODEC wherever possible" )
find_package( AVCodec )
ELSE()
MESSAGE( STATUS "Including AVCODEC requested, but libaray not found" )
option(USE_SOAPYSDR "Should compile with SoapySDR" YES)
IF ( USE_SOAPYSDR )
MESSAGE( STATUS "Including SoapySDR wherever possible" )
find_package( SoapySDR )
ENDIF ()

option(USE_AVCODEC "Should compile with AVCODEC" YES)
if(USE_AVCODEC)
message(STATUS "Including AVCODEC wherever possible")
find_package(AVCodec)
else()
message(STATUS "Including AVCODEC requested, but libaray not found")
endif()

option(USE_APRILTAG "Should compile with APRILTAG" YES)
IF ( USE_APRILTAG )
MESSAGE(STATUS "Including Apriltag wherever possible")
if(USE_APRILTAG)
message(STATUS "Including Apriltag wherever possible")
find_package(Apriltag)
find_package(Threads)
if (APRILTAG_FOUND)
Expand All @@ -91,47 +120,29 @@ IF ( USE_APRILTAG )
message("You requested USE_APRILTAG in the build, but none was found.")
endif()
else()
MESSAGE(STATUS "Apriltag switched off")
message(STATUS "Apriltag switched off")
endif()

###
#
# Debug/Release switch

#set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -g")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -g")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")


include(cmake/CMakeCpuOptions.cmake)


###
#
# Actual subprojects
#

include(cmake/googletest.cmake)
fetch_googletest(
${PROJECT_SOURCE_DIR}/cmake
${PROJECT_BINARY_DIR}/googletest
)

file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
if(UNIX)
include(cmake/googletest.cmake)
fetch_googletest(
${PROJECT_SOURCE_DIR}/cmake
${PROJECT_BINARY_DIR}/googletest
)
endif(UNIX)

add_subdirectory(core)
add_subdirectory(utils)

add_subdirectory(test)
add_subdirectory(applications)
add_subdirectory(tools)


enable_testing()
add_subdirectory(test-core)
add_subdirectory(test-core/-perf)



if(UNIX)
add_subdirectory(test)
add_subdirectory(applications)
add_subdirectory(tools)
add_subdirectory(wrappers)

enable_testing()
add_subdirectory(test-core)
add_subdirectory(test-core/-perf)
endif(UNIX)
1 change: 1 addition & 0 deletions GenerateCoreCVS.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
call %~dp0BuildCoreCVS.bat OFF
20 changes: 10 additions & 10 deletions applications/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@

set(TEST_SUBDIRECTORIES
set(SUBDIRECTORIES
#base
cloudview
drone
#egomotion # Cannot be included because it depends on base application
imageview
#laserscan # Cannot be included because it uses some deprecated/unknown API: calibrationHelpers.h
nester
qtnester
#nester-test # TODO: include this
#recorder # Cannot be added because it depends on base application
#robodetect # Cannot be included because it depends on deprecated filters
Expand All @@ -15,15 +15,15 @@ set(TEST_SUBDIRECTORIES
vinylCutter
)

if (apriltag_LIBS)
set(TEST_SUBDIRECTORIES
${TEST_SUBDIRECTORIES}
if(APRILTAG_LIBS)
set(SUBDIRECTORIES
${SUBDIRECTORIES}
apriltag_test
)
)
endif()

foreach(subdirectory ${SUBDIRECTORIES})
message(STATUS "adding subdirectory/${subdirectory}")
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/${subdirectory})
endforeach(subdirectory)

foreach(test_subdirectory ${TEST_SUBDIRECTORIES})
message(STATUS "adding subdirectory applications/${test_subdirectory}")
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/${test_subdirectory})
endforeach(test_subdirectory)
Loading