Lines Matching +full:cmake +full:-

1 Building libjpeg-turbo
6 ------------------
11 - [CMake](http://www.cmake.org) v2.8.12 or later
13 - [NASM](http://www.nasm.us) or [Yasm](http://yasm.tortall.net)
14 (if building x86 or x86-64 SIMD extensions)
19 - NOTE: Currently, if it is desirable to hide the SIMD function symbols in
21 libjpeg-turbo, then NASM 2.14 or later or Yasm must be used when
22 building libjpeg-turbo.
24 to the assembler by using either the `CMAKE_ASM_NASM_COMPILER` CMake
34 - GCC v4.1 (or later) or Clang recommended for best performance
36 - If building the TurboJPEG Java wrapper, JDK or OpenJDK 1.5 or later is
42 * If using JDK 11 or later, CMake 3.10.x or later must also be used.
46 - Microsoft Visual C++ 2005 or later
51 which includes everything necessary to build libjpeg-turbo.
54 or later), which includes command-line versions of the 32-bit and 64-bit
56 * If you intend to build libjpeg-turbo from the command line, then add the
61 * If built with Visual C++ 2015 or later, the libjpeg-turbo static libraries
63 * The libjpeg API DLL (**jpeg{version}.dll**) will depend on the C run-time
68 - MinGW
70 [MSYS2](http://msys2.github.io/) or [tdm-gcc](http://tdm-gcc.tdragon.net/)
75 - If building the TurboJPEG Java wrapper, JDK 1.5 or later is required. This
79 * If using JDK 11 or later, CMake 3.10.x or later must also be used.
82 Sub-Project Builds
83 ------------------
85 The libjpeg-turbo build system does not support being included as a sub-project
86 using the CMake `add_subdirectory()` function. Use the CMake
90 Out-of-Tree Builds
91 ------------------
94 which CMake is executed (the "binary directory"), and this directory need not
95 necessarily be the same as the libjpeg-turbo source directory. You can create
97 libjpeg-turbo can be built from the same source tree using different compilers
99 directory, whereas *{source_directory}* refers to the libjpeg-turbo source
100 directory. For in-tree builds, these directories are the same.
104 -----
107 CMake generator (specified with the `-G` option) with `Ninja`, in all of the
112 ---------------
114 NOTE: The build procedures below assume that CMake is invoked from the command
115 line, but all of these procedures can be adapted to the CMake GUI as
121 The following procedure will build libjpeg-turbo on Unix and Unix-like systems.
122 (On Solaris, this generates a 32-bit build. See "Build Recipes" below for
123 64-bit build instructions.)
126 cmake -G"Unix Makefiles" [additional CMake flags] {source_directory}
136 **cygjpeg-{version}.dll** (Cygwin)<br>
155 **cygturbojpeg-0.dll** (Cygwin)<br>
169 cmake -G"NMake Makefiles" -DCMAKE_BUILD_TYPE=Release [additional CMake flags] {source_directory}
172 This will build either a 32-bit or a 64-bit version of libjpeg-turbo, depending
177 **jpeg-static.lib**<br>
186 **turbojpeg-static.lib**<br>
201 Choose the appropriate CMake generator option for your version of Visual Studio
202 (run `cmake` with no arguments for a list of available generators.) For
206 cmake -G"Visual Studio 10" [additional CMake flags] {source_directory}
209 to build a 64-bit version of libjpeg-turbo. A separate build directory must be
210 used for 32-bit and 64-bit builds.
214 build of libjpeg-turbo.
218 **{configuration}/jpeg-static.lib**<br>
227 **{configuration}/turbojpeg-static.lib**<br>
244 environment. If you are cross-compiling on a Un*x platform (including Mac and
248 cmake -G"MSYS Makefiles" [additional CMake flags] {source_directory}
256 **libjpeg-{version}.dll**<br>
277 Add `-DCMAKE_BUILD_TYPE=Debug` to the CMake command line. Or, if building
278 with NMake, remove `-DCMAKE_BUILD_TYPE=Release` (Debug builds are the default
284 Add `-DWITH_JPEG7=1` to the CMake command line to build a version of
285 libjpeg-turbo that is API/ABI-compatible with libjpeg v7. Add `-DWITH_JPEG8=1`
286 to the CMake command line to build a version of libjpeg-turbo that is
287 API/ABI-compatible with libjpeg v8. See [README.md](README.md) for more
291 ### In-Memory Source/Destination Managers
293 When using libjpeg v6b or v7 API/ABI emulation, add `-DWITH_MEM_SRCDST=0` to
294 the CMake command line to build a version of libjpeg-turbo that lacks the
303 included in this release of libjpeg-turbo. libjpeg-turbo's implementation is
307 add `-DWITH_ARITH_ENC=0` or `-DWITH_ARITH_DEC=0` to the CMake command line to
313 Add `-DWITH_JAVA=1` to the CMake command line to incorporate an optional Java
315 Java front-end classes to support it. This allows the TurboJPEG shared library
320 build/test libjpeg-turbo, then (prior to running CMake) set the `JAVA_HOME`
323 CMake variables can also be used to specify alternate commands or locations for
325 `CMAKE_JAVA_COMPILE_FLAGS` CMake variable or the `JAVAFLAGS` environment
327 building the TurboJPEG classes, and the `JAVAARGS` CMake variable to specify
333 -------------
336 ### 32-bit Build on 64-bit Linux/Unix
339 CMake:
341 CFLAGS=-m32
342 LDFLAGS=-m32
345 ### 64-bit Build on Solaris
348 CMake:
350 CFLAGS=-m64
351 LDFLAGS=-m64
356 On Un*x systems, prior to running CMake, you can set the `CC` environment
360 ### 32-bit MinGW Build on Un*x (including Mac and Cygwin)
362 Create a file called **toolchain.cmake** under *{build_directory}*, with the
367 set(CMAKE_C_COMPILER {mingw_binary_path}/i686-w64-mingw32-gcc)
368 set(CMAKE_RC_COMPILER {mingw_binary_path}/i686-w64-mingw32-windres)
374 cmake -G"Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=toolchain.cmake \
375 -DCMAKE_INSTALL_PREFIX={install_path} \
376 [additional CMake flags] {source_directory}
379 *{install\_path}* is the path under which the libjpeg-turbo binaries should be
383 ### 64-bit MinGW Build on Un*x (including Mac and Cygwin)
385 Create a file called **toolchain.cmake** under *{build_directory}*, with the
390 set(CMAKE_C_COMPILER {mingw_binary_path}/x86_64-w64-mingw32-gcc)
391 set(CMAKE_RC_COMPILER {mingw_binary_path}/x86_64-w64-mingw32-windres)
397 cmake -G"Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=toolchain.cmake \
398 -DCMAKE_INSTALL_PREFIX={install_path} \
399 [additional CMake flags] {source_directory}
402 *{install\_path}* is the path under which the libjpeg-turbo binaries should be
406 Building libjpeg-turbo for iOS
407 ------------------------------
411 advantage of libjpeg-turbo's SIMD extensions to significantly accelerate JPEG
412 compression/decompression. This section describes how to build libjpeg-turbo
416 ### Armv8 (64-bit)
420 The following script demonstrates how to build libjpeg-turbo to run on the
425 export CFLAGS="-Wall -arch arm64 -miphoneos-version-min=8.0 -funwind-tables"
429 cat <<EOF >toolchain.cmake
435 cmake -G"Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=toolchain.cmake \
436 -DCMAKE_OSX_SYSROOT=${IOS_SYSROOT[0]} \
437 [additional CMake flags] {source_directory}
440 Replace `iPhoneOS` with `iPhoneSimulator` and `-miphoneos-version-min` with
441 `-miphonesimulator-version-min` to build libjpeg-turbo for the iOS simulator on
445 Building libjpeg-turbo for Android
446 ----------------------------------
448 Building libjpeg-turbo for Android platforms requires v13b or later of the
452 ### Armv7 (32-bit)
460 NDK_PATH={full path to the NDK directory-- for example,
461 /opt/android/android-ndk-r16b}
462 TOOLCHAIN={"gcc" or "clang"-- "gcc" must be used with NDK r16b and earlier,
464 ANDROID_VERSION={the minimum version of Android to support-- for example,
468 cmake -G"Unix Makefiles" \
469 -DANDROID_ABI=armeabi-v7a \
470 -DANDROID_ARM_MODE=arm \
471 -DANDROID_PLATFORM=android-${ANDROID_VERSION} \
472 -DANDROID_TOOLCHAIN=${TOOLCHAIN} \
473 -DCMAKE_ASM_FLAGS="--target=arm-linux-androideabi${ANDROID_VERSION}" \
474 -DCMAKE_TOOLCHAIN_FILE=${NDK_PATH}/build/cmake/android.toolchain.cmake \
475 [additional CMake flags] {source_directory}
479 ### Armv8 (64-bit)
487 NDK_PATH={full path to the NDK directory-- for example,
488 /opt/android/android-ndk-r16b}
489 TOOLCHAIN={"gcc" or "clang"-- "gcc" must be used with NDK r14b and earlier,
492 is required for a 64-bit build.}
495 cmake -G"Unix Makefiles" \
496 -DANDROID_ABI=arm64-v8a \
497 -DANDROID_ARM_MODE=arm \
498 -DANDROID_PLATFORM=android-${ANDROID_VERSION} \
499 -DANDROID_TOOLCHAIN=${TOOLCHAIN} \
500 -DCMAKE_ASM_FLAGS="--target=aarch64-linux-android${ANDROID_VERSION}" \
501 -DCMAKE_TOOLCHAIN_FILE=${NDK_PATH}/build/cmake/android.toolchain.cmake \
502 [additional CMake flags] {source_directory}
506 ### x86 (32-bit)
512 NDK_PATH={full path to the NDK directory-- for example,
513 /opt/android/android-ndk-r16b}
514 TOOLCHAIN={"gcc" or "clang"-- "gcc" must be used with NDK r14b and earlier,
516 ANDROID_VERSION={The minimum version of Android to support-- for example,
520 cmake -G"Unix Makefiles" \
521 -DANDROID_ABI=x86 \
522 -DANDROID_PLATFORM=android-${ANDROID_VERSION} \
523 -DANDROID_TOOLCHAIN=${TOOLCHAIN} \
524 -DCMAKE_TOOLCHAIN_FILE=${NDK_PATH}/build/cmake/android.toolchain.cmake \
525 [additional CMake flags] {source_directory}
529 ### x86-64 (64-bit)
535 NDK_PATH={full path to the NDK directory-- for example,
536 /opt/android/android-ndk-r16b}
537 TOOLCHAIN={"gcc" or "clang"-- "gcc" must be used with NDK r14b and earlier,
540 is required for a 64-bit build.}
543 cmake -G"Unix Makefiles" \
544 -DANDROID_ABI=x86_64 \
545 -DANDROID_PLATFORM=android-${ANDROID_VERSION} \
546 -DANDROID_TOOLCHAIN=${TOOLCHAIN} \
547 -DCMAKE_TOOLCHAIN_FILE=${NDK_PATH}/build/cmake/android.toolchain.cmake \
548 [additional CMake flags] {source_directory}
552 Advanced CMake Options
553 ----------------------
555 To list and configure other CMake options not specifically mentioned in this
562 cmake-gui {source_directory}
565 text-based interactive version of CMake, and CMake-GUI is a GUI version. Both
566 will display all variables that are relevant to the libjpeg-turbo build, their
570 Installing libjpeg-turbo
573 You can use the build system to install libjpeg-turbo (as opposed to creating
577 the Visual Studio IDE) will uninstall libjpeg-turbo.
579 The `CMAKE_INSTALL_PREFIX` CMake variable can be modified in order to install
580 libjpeg-turbo into a directory of your choosing. If you don't specify
583 **c:\libjpeg-turbo**<br>
584 Visual Studio 32-bit build
586 **c:\libjpeg-turbo64**<br>
587 Visual Studio 64-bit build
589 **c:\libjpeg-turbo-gcc**<br>
590 MinGW 32-bit build
592 **c:\libjpeg-turbo-gcc64**<br>
593 MinGW 64-bit build
595 **/opt/libjpeg-turbo**<br>
598 The default value of `CMAKE_INSTALL_PREFIX` causes the libjpeg-turbo files to
600 libjpeg-turbo binary packages. Changing the value of `CMAKE_INSTALL_PREFIX`
601 (for instance, to **/usr/local**) causes the libjpeg-turbo files to be
606 `CMAKE_INSTALL_LIBDIR`, and `CMAKE_INSTALL_MANDIR` CMake variables allow a
607 finer degree of control over where specific files in the libjpeg-turbo
611 documentation to be installed in **${CMAKE\_INSTALL\_PREFIX}/doc**.) If a
615 **\<CMAKE\_INSTALL\_DATAROOTDIR\>/man**.
618 CMake command line, you must specify that the variable is of type `PATH`.
621 cmake -G"{generator type}" -DCMAKE_INSTALL_LIBDIR:PATH=lib {source_directory}
623 Otherwise, CMake will assume that the path is relative to the build directory
635 -----
639 Create Red Hat-style binary RPM package. Requires RPM v4 or later.
644 Red Hat-style source RPM package from the tarball. Requires RPM v4 or later.
648 Create Debian-style binary package. Requires dpkg.
652 ---
660 x86-64/Arm binaries, set the following CMake variable:
662 * `ARMV8_BUILD`: Directory containing an Armv8 (64-bit) iOS or macOS build of
663 libjpeg-turbo to include in the universal binaries
665 You should first use CMake to configure an Armv8 sub-build of libjpeg-turbo
666 (see "Building libjpeg-turbo for iOS" above, if applicable) in a build
667 directory that matches the one specified in the aforementioned CMake variable.
668 Next, configure the primary (x86-64) build of libjpeg-turbo as an out-of-tree
669 build, specifying the aforementioned CMake variable, and build it. Once the
671 packaging system will build the sub-build, use lipo to combine it with the
677 -------
691 The installer package (libjpeg-turbo-*{version}*[-gcc|-vc][64].exe) will be
705 The most common way to test libjpeg-turbo is by invoking `make test` (Un*x) or
709 libjpeg-turbo and libjpeg v6b. This also invokes the TurboJPEG unit tests,