Commit Graph

146 Commits

Author SHA1 Message Date
Alex Richardson c6ceb84c22 Make OpenJPEGConfig.cmake relocatable with CMake > 3.0
Using CMakePackageConfigHelpers, we can generate a relocatable
OpenJPEGConfig.config, using the PATH_VARS feature to make
CMAKE_INSTALL_LIBDIR relative to the installed location.
This change is needed for me when cross-compiling since
CMAKE_INSTALL_FULL_LIBDIR is a path inside the sysroot rather than
an absolute path to the actual includes. Without this change poppler
ends up passing a -I flag that does not exist.

This includes fallback code for CMake 2.8, which adds a bit of complexity,
since I'm not sure if raising the minimum to 3.0 (now over 8 years old)
is acceptable.
2022-08-11 12:13:18 +00:00
Thomas Bracht Laumann Jespersen c7bccf0515
CMake: switch to GNUInstallDirs (#1424)
* Add GNUInstallDirs for standard installation directories

Distributions are given standard variables for already existing hooks.
Multiarch libdirs is taken care of automagically.
Raises minimum cmake version by a little.

* Handle CMAKE_INSTALL_xxx being absolute paths for .pc file generation

In some cases the CMAKE_INSTAL_{BIN,MAN,DOC,LIB,INCLUDE}DIR variables
may turn out to be absolute paths in which case prepending ${prefix} in
the pkg-config .pc files will result in incorrect values.

For .pc file generation, figure out if these variables are absolute and
omit the prefix in the configured file when so.

See: ab25e4b7ed
2022-08-07 16:42:01 +02:00
Even Rouault a5891555eb
Prepare for 2.5.0 release 2022-05-13 18:54:29 +02:00
Even Rouault e33944ea9e
CMakeLists.txt: do not set INSTALL_NAME_DIR for MacOS builds for CMake >= 3.0 (fixes #1404) 2022-02-13 10:42:47 +01:00
Stefan Weil 667149ffa1 Fix some typos (found by codespell)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-12-05 13:14:33 +01:00
Even Rouault 655bb12525
CMakeLists.txt/appveyor.yml: update version number to 2.5.0 to make it easier for downstream consumers to use new features 2021-06-08 14:34:43 +02:00
Mehdi Sabwat 99c28c960c fix #1345: don't remove big endian test for other platforms
thanks to @ePirat, it turns out that !EMSCRIPTEN does not evaluate to 1 on other platforms, so the the #1345 actually disabled the test for all platforms.
2021-06-01 22:39:27 +02:00
Mehdi Sabwat 238e849746 emscripten: disable big endian test
This test should not run on the emscripten platform because of :
dff3336842/cmake/Modules/TestBigEndian.cmake (L5)
2021-05-07 00:03:48 +02:00
Even Rouault 85a87cd505
Remove obsolete components JPWL, JP3D and MJ2 2021-05-04 19:21:45 +02:00
Peter Korsgaard 4d147d9630 CMakeLists.txt: Don't require a C++ compiler
By default, CMake assumes that the project is using both C and C++.  By
explicitly passing 'C' as argument of the project() macro, we tell CMake
that only C is used, which prevents CMake from erroring out if a C++
compiler doesn't exist.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
[Retrieved (and slightly updated by adding enable_language(CXX) if
WITH_ASTYLE is set) from:
https://git.buildroot.net/buildroot/tree/package/openjpeg/0003-CMakeLists.txt-Don-t-require-a-C-compiler.patch]
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2021-01-04 09:14:20 +01:00
Even Rouault 37ac30ceff
Prepare for v2.4.0 2020-12-28 21:59:39 +01:00
Even Rouault 07d1f775a1
Add multithreaded support in the DWT encoder.
Update the bench_dwt utility to have a -decode/-encode switch

Measured performance gains for DWT encoder on a
Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz (4 cores, hyper threaded)

Encoding time:
$ ./bin/bench_dwt -encode -num_threads 1
time for dwt_encode: total = 8.348 s, wallclock = 8.352 s

$ ./bin/bench_dwt -encode -num_threads 2
time for dwt_encode: total = 9.776 s, wallclock = 4.904 s

$ ./bin/bench_dwt -encode -num_threads 4
time for dwt_encode: total = 13.188 s, wallclock = 3.310 s

$ ./bin/bench_dwt -encode -num_threads 8
time for dwt_encode: total = 30.024 s, wallclock = 4.064 s

Scaling is probably limited by memory access patterns causing
memory access to be the bottleneck.
The slightly worse results with threads==8 than with thread==4
is due to hyperthreading being not appropriate here.
2020-05-20 20:30:21 +02:00
Antonin Descampe c7798bb0c6
update for release 2.3.1 2019-04-02 11:02:20 +02:00
Antonin Descampe 8196ab531e
Update BUILD version for release 2.3.1 2019-04-02 11:00:58 +02:00
Even Rouault 53d265576a CMakeLists.txt: turn BUILD_PKGCONFIG_FILES ON by default on Windows if compiler is GCC 2017-10-14 22:42:12 +02:00
Antonin Descampe 0b8903d9ea Preparing v2.3.0 release 2017-10-03 17:08:30 -03:00
Even Rouault 3dfc6ca2bc Build: make sure that -DBUILD_SHARED_LIBS:bool=off is honoured to build only the static lib (#1019) 2017-09-17 12:17:49 +02:00
Even Rouault f9e9942330 Sub-tile decoding: only allocate tile component buffer of the needed dimension
Instead of being the full tile size.

* Use a sparse array mechanism to store code-blocks and intermediate stages of
  IDWT.
* IDWT, DC level shift and MCT stages are done just on that smaller array.
* Improve copy of tile component array to final image, by saving an intermediate
  buffer.
* For full-tile decoding at reduced resolution, only allocate the tile buffer to
  the reduced size, instead of the full-resolution size.
2017-09-01 16:30:29 +02:00
Antonin Descampe bc21818c63 Preparing Release v2.2.0 2017-08-09 17:28:17 -07:00
Even Rouault 919ed5f8b8 Add bench_dwt program (compiled only if BUILD_BENCH_DWT=ON) 2017-06-20 17:56:19 +02:00
Even Rouault a8ca7c51f3 CMake: add stronger warnings for openjp2 lib/bin by default, and error out on declaration-after-statement
And remove occurences of unused arguments in src/lib/openjp2
2017-05-23 15:47:57 +02:00
Even Rouault d4e54e9f35 Add mechanisms to reformant and check code style (#128)
Use an internal version of astyle (astyle 3.0). Scripts taken from QGIS.
astyle.options from https://github.com/uclouvain/openjpeg/issues/128

scripts/prepare-commit.sh can be used locally to automatically reformat
edited files.

Travis-CI will run scripts/verify-indentation.sh to verify committed files.
2017-05-09 20:46:16 +02:00
Antonin Descampe 9afc1699f0 Update version number for future release 2.2.0 2016-09-28 18:55:02 +02:00
Mathieu Malaterre 34dae137a9 OPENJPEG_NAMESPACE is configurable by user 2016-09-26 12:01:31 +02:00
Antonin Descampe 31d44f0280 Disable automatic compilation of t1_generate_luts
Fix #831
2016-09-20 18:48:06 +02:00
Antonin Descampe 2e0779e250 Update version number in CMakeLists.txt 2016-05-13 12:31:56 +02:00
Julien Malik 17a0a8a195 Use lowercase for cmake commands consistenly
Inspired from https://github.com/InsightSoftwareConsortium/ITK/blob/master/Utilities/Maintenance/HowToCreateTheCMakeCaseConversion.txt
This needs vim 7.3 and fails with vim 7.4

This also fixes a number of :
- missing empty line at end of files
- useless space at end of lines
2016-05-02 16:05:41 +02:00
Stefan Weil c00ee8bff7 Fix support of posix_memalign for Linux
posix_memalign is only declared conditionally in stdlib.h,
so add one of the possible definitions to get the declaration.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-01-06 18:06:45 +01:00
mayeut 38ffbbe42e Fin compiler warnings 2015-11-01 17:08:47 +01:00
Matthieu Darbois 4831badeb4 Merge pull request #637 from stweil/fixes
Fix repository for JPEG2000 test data
2015-10-18 14:42:58 +02:00
Mathieu Malaterre 2d410fc74b do not use aligned_alloc since it requires c11 2015-10-10 14:54:21 +02:00
Mathieu Malaterre 0dc4914b4e cleanup header file and move to implementation 2015-10-09 22:04:04 +02:00
Stefan Weil 0cfe2ca4a9 Fix repository for JPEG2000 test data
The data is now maintained in a git repository on Github.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-09-29 15:28:43 +02:00
Rex Dieter e4735c703d better -ffast-math handling
issue #488

See also
http://public.kitware.com/pipermail/cmake/2015-April/060479.html
2015-07-30 09:54:07 -05:00
Matthieu Darbois 46afb746f0 [trunk] removed warnings when configuring with CMake 3.x on MacOS (fixes issue 443) 2014-11-25 23:57:37 +00:00
Antonin Descampe 984351f86f [trunk] Add option to call dsymutil on built binaries (fixes issue 409) 2014-10-15 10:24:49 +00:00
Antonin Descampe b9a247b559 fixes install name id on OSX builds (fixes issue 367) 2014-09-19 09:30:12 +00:00
Mathieu Malaterre 997758f91c [trunk] properly handle pkg-config on non-UNIX hosts
Fixes issue 340
2014-04-28 07:34:26 +00:00
Mathieu Malaterre 1adf89d5d2 [trunk] Import change from 2.0 branch 2014-03-25 15:21:53 +00:00
Mathieu Malaterre 3e33012bd9 [trunk] Mark OpenJPEG to be ABI incompatible with previous one, move to SONAME 7
Also declare this is 2.1.0 (or very close)
2014-03-14 09:30:03 +00:00
Mathieu Malaterre 65503dad73 [trunk] Fix find_path behavior within cross-compilation execution 2014-02-28 08:28:25 +00:00
Antonin Descampe 05f796d2fa trunk: fixed cmake config so as to be able to link opj_jpip_server with FCGI. 2013-10-30 08:59:23 +00:00
Rex Dieter 4d7b6374c8 complete openjpeg2 pkgconfig support, bug #68 2013-10-15 19:17:51 +00:00
Mickael Savinaud 68415d040f [trunk] separate the opj_config file between public and private part to avoid expose unused variables into the public API. 2013-03-25 12:43:27 +00:00
Mickael Savinaud a13e4a77e0 [trunk] use everywhere the new opj_ prefix for HAVE variables and use the opj_apps_config file (thanks to winfried) 2013-03-17 17:03:00 +00:00
Mickael Savinaud 6de2271e2a [trunk] use the home made macro to ensure the existence of some include file 2013-03-13 15:21:20 +00:00
Mickael Savinaud 92b1e038c1 [trunk] correct missing variable in openjpeg config file 2013-03-13 10:18:04 +00:00
Mickael Savinaud e7bc30b409 [trunk] split into two config files config options related to the lib and to the application. 2013-03-03 17:55:35 +00:00
Mickael Savinaud b42cf317d6 [trunk] correct the new name of OPJ_HAVE_STDINT_H everywhere 2012-12-04 13:13:50 +00:00
Mickael Savinaud f5429e4ce8 [trunk] remove SSIZE which is unused in openjpeg and rename HAVE_STDINT_H to OPJ_HAVE_STDINT_H 2012-12-04 12:51:00 +00:00