Skip to content

Commit

Permalink
Remove unused parts of the OpenCV build (#96)
Browse files Browse the repository at this point in the history
* Aruco module has been replaced by objdetect

* Remove opencv_contrib submodule

* Remove unused date variables

* Remove manifest blocks from JARs
  • Loading branch information
Gold856 authored Dec 25, 2024
1 parent 3b01a13 commit c941608
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 40 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "opencv"]
path = opencv
url = https://github.com/wpilibsuite/opencv.git
[submodule "opencv_contrib"]
path = opencv_contrib
url = https://github.com/opencv/opencv_contrib
8 changes: 2 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import java.nio.file.Paths;

apply plugin: 'java'

def date = new Date()
def formattedDate = date.format('yyMMdd')
ext.version = "4.10.0"
ext.soVersion = "4.10"
ext.libVersion = "${ext.version.replace(".", "")}"
Expand Down Expand Up @@ -50,7 +48,6 @@ ext {
'-DBUILD_PNG=ON',
'-DBUILD_ZLIB=ON',
'-DBUILD_TESTS=OFF',
'-DPython_ADDITIONAL_VERSIONS=3.5',
'-DWITH_WEBP=OFF',
'-DBUILD_JAVA=ON',
'-DBUILD_WITH_STATIC_CRT=OFF',
Expand All @@ -65,7 +62,6 @@ ext {
'-DBUILD_opencv_apps=OFF',
'-DBUILD_TESTS=OFF',
'-DBUILD_PERF_TESTS=OFF',
"-DOPENCV_EXTRA_MODULES_PATH=$rootDir/opencv_contrib/modules/aruco",
'-DCMAKE_INSTALL_PREFIX=install'
]
}
Expand Down Expand Up @@ -329,7 +325,7 @@ if (project.platform == "linux-athena") {
dependsOn 'make' + buildType
workingDir buildDirectory.resolve("lib").resolve(buildTypeFolder).toString()
executable 'lib'
def inputFiles = ["opencv_calib3d${project.libVersion}", "opencv_features2d${project.libVersion}", "opencv_flann${project.libVersion}", "opencv_gapi${project.libVersion}", "opencv_highgui${project.libVersion}", "opencv_imgcodecs${project.libVersion}", "opencv_imgproc${project.libVersion}", "opencv_ml${project.libVersion}", "opencv_objdetect${project.libVersion}", "opencv_photo${project.libVersion}", "opencv_stitching${project.libVersion}", "opencv_videoio${project.libVersion}", "opencv_video${project.libVersion}", "opencv_core${project.libVersion}", "opencv_aruco${project.libVersion}", "../../3rdparty/lib/${buildTypeFolder}/ade", "../../3rdparty/lib/${buildTypeFolder}/libjpeg-turbo", "../../3rdparty/lib/${buildTypeFolder}/libopenjp2", "../../3rdparty/lib/${buildTypeFolder}/libpng", "../../3rdparty/lib/${buildTypeFolder}/zlib"]
def inputFiles = ["opencv_calib3d${project.libVersion}", "opencv_features2d${project.libVersion}", "opencv_flann${project.libVersion}", "opencv_gapi${project.libVersion}", "opencv_highgui${project.libVersion}", "opencv_imgcodecs${project.libVersion}", "opencv_imgproc${project.libVersion}", "opencv_ml${project.libVersion}", "opencv_objdetect${project.libVersion}", "opencv_photo${project.libVersion}", "opencv_stitching${project.libVersion}", "opencv_videoio${project.libVersion}", "opencv_video${project.libVersion}", "opencv_core${project.libVersion}", "../../3rdparty/lib/${buildTypeFolder}/ade", "../../3rdparty/lib/${buildTypeFolder}/libjpeg-turbo", "../../3rdparty/lib/${buildTypeFolder}/libopenjp2", "../../3rdparty/lib/${buildTypeFolder}/libpng", "../../3rdparty/lib/${buildTypeFolder}/zlib"]
def setArgs = ["/OUT:opencv${project.libVersion}.lib"]
inputFiles.each {
def inFile = it
Expand Down Expand Up @@ -379,7 +375,7 @@ if (project.platform == "linux-athena") {
workingDir buildDirectory.resolve("lib").toString()
executable 'ar'
args = ['-M']
def inputFiles = ["libopencv_calib3d", "libopencv_features2d", "libopencv_flann", "libopencv_gapi", "libopencv_highgui", "libopencv_imgcodecs", "libopencv_imgproc", "libopencv_ml", "libopencv_objdetect", "libopencv_photo", "libopencv_stitching", "libopencv_videoio", "libopencv_video", "libopencv_core", "libopencv_aruco", "../3rdparty/lib/libade", "../3rdparty/lib/liblibjpeg-turbo", "../3rdparty/lib/liblibopenjp2", "../3rdparty/lib/liblibpng", "../3rdparty/lib/libzlib"]
def inputFiles = ["libopencv_calib3d", "libopencv_features2d", "libopencv_flann", "libopencv_gapi", "libopencv_highgui", "libopencv_imgcodecs", "libopencv_imgproc", "libopencv_ml", "libopencv_objdetect", "libopencv_photo", "libopencv_stitching", "libopencv_videoio", "libopencv_video", "libopencv_core", "../3rdparty/lib/libade", "../3rdparty/lib/liblibjpeg-turbo", "../3rdparty/lib/liblibopenjp2", "../3rdparty/lib/liblibpng", "../3rdparty/lib/libzlib"]

def inputString = "create libopencv${project.libVersion}.a\n"
inputFiles.each {
Expand Down
1 change: 0 additions & 1 deletion opencv_contrib
Submodule opencv_contrib deleted from 1ed3dd
30 changes: 0 additions & 30 deletions publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,6 @@ task cppHeadersZip(type: Zip, dependsOn: make) {
exclude '**/CMakeLists.txt'
}

from ('opencv_contrib/modules/aruco/include') {
into '/'
}

from (project.cmakeBuildDirectory.resolve('opencv2').toFile()) {
into '/opencv2/'
}
Expand Down Expand Up @@ -126,19 +122,6 @@ task cppHeadersZip(type: Zip, dependsOn: make) {
archiveBaseName = zipBaseName
duplicatesStrategy = 'exclude'

manifest {
attributes(
"Created-By": "WPILib Gradle Build Script",
"Implementation-Title": "OpenCV Native Libraries, ${project.ext.platformClassifier}",
"Implementation-Version": pubVersion,
"Implementation-Vendor": "Itseez",

"Bundle-Name": "${archiveBaseName.get()}",
"Bundle-Version": pubVersion,
"Bundle-License": "https://opensource.org/licenses/BSD-3-Clause",
"Bundle-Vendor": "WPILib")
}

from(licenseFile) {
into '/'
}
Expand Down Expand Up @@ -215,19 +198,6 @@ task cppHeadersZip(type: Zip, dependsOn: make) {
archiveBaseName = zipBaseName
duplicatesStrategy = 'exclude'

manifest {
attributes(
"Created-By": "WPILib Gradle Build Script",
"Implementation-Title": "OpenCV Native Libraries, ${project.ext.platformClassifier}",
"Implementation-Version": pubVersion,
"Implementation-Vendor": "Itseez",

"Bundle-Name": "${archiveBaseName.get()}",
"Bundle-Version": pubVersion,
"Bundle-License": "https://opensource.org/licenses/BSD-3-Clause",
"Bundle-Vendor": "WPILib")
}

from(licenseFile) {
into '/'
}
Expand Down

0 comments on commit c941608

Please sign in to comment.