Skip to content

Commit 2681693

Browse files
committed
Add man and libtool file installation
1 parent c45bb36 commit 2681693

File tree

6 files changed

+187
-17
lines changed

6 files changed

+187
-17
lines changed

.gitignore

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,110 @@
1+
## CMake ##
12
build/
3+
CMakeLists.txt.user
4+
CMakeCache.txt
5+
CMakeFiles
6+
CMakeScripts
7+
Testing
8+
Makefile
9+
cmake_install.cmake
10+
install_manifest.txt
11+
compile_commands.json
12+
CTestTestfile.cmake
13+
_deps
14+
15+
## jpeg-cmake ##
216
libjpeg/CMakeLists.txt
317
libjpeg/jconfig.h.in
418
libjpeg/jconfig.h
519
libjpeg/libjpeg.pc.cmakein
20+
libjpeg/libjpeg.pc
21+
libjpeg/libjpeg.la.in
22+
libjpeg/libjpeg.la
23+
24+
## libjpeg ##
25+
.deps/
26+
.libs/
27+
cjpeg
28+
djpeg
29+
jpegtran
30+
rdjpgcom
31+
wrjpgcom
32+
33+
## Autoconf ##
34+
# http://www.gnu.org/software/automake
35+
mdate-sh
36+
py-compile
37+
test-driver
38+
ylwrap
39+
40+
# http://www.gnu.org/software/autoconf
41+
autom4te.cache
42+
autoscan.log
43+
autoscan-*.log
44+
config.h.in
45+
config.log
46+
config.status
47+
configure.scan
48+
stamp-h1
49+
50+
# http://www.gnu.org/software/m4/
51+
libtool.m4
52+
ltoptions.m4
53+
ltsugar.m4
54+
ltversion.m4
55+
lt~obsolete.m4
56+
libtool
57+
58+
## C ##
59+
# Prerequisites
60+
*.d
61+
62+
# Object files
63+
*.o
64+
*.ko
65+
*.obj
66+
*.elf
67+
68+
# Linker output
69+
*.ilk
70+
*.map
71+
*.exp
72+
73+
# Precompiled Headers
74+
*.gch
75+
*.pch
76+
77+
# Libraries
78+
*.lib
79+
*.a
80+
*.la
81+
*.lo
82+
83+
# Shared objects (inc. Windows DLLs)
84+
*.dll
85+
*.so
86+
*.so.*
87+
*.dylib
88+
89+
# Executables
90+
*.exe
91+
*.out
92+
*.app
93+
*.i*86
94+
*.x86_64
95+
*.hex
96+
97+
# Debug files
98+
*.dSYM/
99+
*.su
100+
*.idb
101+
*.pdb
102+
103+
# Kernel Module Compile Results
104+
*.mod*
105+
*.cmd
106+
.tmp_versions/
107+
modules.order
108+
Module.symvers
109+
Mkfile.old
110+
dkms.conf

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ configure_file(
1818
${PROJECT_SOURCE_DIR}/libjpeg/libjpeg.pc.cmakein
1919
COPYONLY
2020
)
21+
configure_file(
22+
resources/libjpeg.la.in
23+
${PROJECT_SOURCE_DIR}/libjpeg/libjpeg.la.in
24+
COPYONLY
25+
)
2126

2227
# Build libjpeg
2328
add_subdirectory(libjpeg)

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
Current Version: `libjpeg 9c (9.3.0)`
33

44
## Usage
5-
This project is meant to provide drop-in CMake support for the IJG's JPEG
6-
library. Simply run CMake as normal:
5+
This project provides drop-in CMake support for the IJG's JPEG library.
6+
Simply run CMake as normal:
77

88
```Shell
99
mkdir build/
@@ -42,7 +42,7 @@ make
4242
### Shared and Static Libraries
4343
`jpeg-cmake` emulates the behavior of `libjpeg` and compiles both static and
4444
shared libraries by default. Selective compilation of shared and static
45-
libraries can be controlled with the `BUILD_*_LIBS` CMake flags:
45+
libraries can be controlled with the `BUILD_<SHARED|STATIC>_LIBS` CMake flags:
4646

4747
```Shell
4848
cmake -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON ..

resources/CMakeLists.txt

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@ set(version ${CMAKE_MATCH_1})
1212
project(libjpeg VERSION ${version} LANGUAGES C)
1313
set(C_STANDARD 99)
1414

15-
### Options ###
15+
### Include extra packages ###
16+
include(CheckIncludeFile)
1617
include(CMakeDependentOption)
18+
include(GNUInstallDirs)
19+
20+
### Options ###
1721
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
1822
option(BUILD_STATIC_LIBS "Build static libraries" ON)
1923
cmake_dependent_option(BUILD_EXECUTABLES "Build JPEG utilities" ON "BUILD_SHARED_LIBS OR BUILD_STATIC_LIBS" OFF)
@@ -26,7 +30,6 @@ if(NOT(BUILD_SHARED_LIBS OR BUILD_STATIC_LIBS))
2630
endif()
2731

2832
### Configure jconfig.h ###
29-
include(CheckIncludeFile)
3033
check_include_file(stddef.h HAVE_STDDEF_H)
3134
check_include_file(stdlib.h HAVE_STDLIB_H)
3235
if(WIN32 AND NOT CYGWIN)
@@ -84,22 +87,34 @@ if(BUILD_STATIC_LIBS)
8487
install(TARGETS jpeg_static)
8588
endif()
8689

87-
# Configure and install pkg-config file
90+
# Configure and install pkg-config and libtool files
8891
if(BUILD_STATIC_LIBS OR BUILD_SHARED_LIBS)
89-
include(GNUInstallDirs)
90-
# Handle the pc file's weird version number
91-
math(EXPR pc_vers_major "${PROJECT_VERSION_MAJOR} + ${PROJECT_VERSION_MINOR}")
92-
set(JPEG_LIB_VERSION "${pc_vers_major}:0:${PROJECT_VERSION_MINOR}")
93-
# Get the appropriate variables
94-
set(prefix ${CMAKE_INSTALL_PREFIX})
95-
set(libdir ${CMAKE_INSTALL_LIBDIR})
96-
set(includedir ${CMAKE_INSTALL_INCLUDEDIR})
92+
# Compute the pc file's weird version number
93+
math(EXPR JPEG_CONF_VER_MAJOR "${PROJECT_VERSION_MAJOR} + ${PROJECT_VERSION_MINOR}")
94+
set(JPEG_LIB_VERSION "${JPEG_CONF_VER_MAJOR}:0:${PROJECT_VERSION_MINOR}")
95+
96+
# Create library file names for libtool file
97+
if(BUILD_SHARED_LIBS)
98+
set(DYN_LIB_FILE_VERSIONED ${CMAKE_SHARED_LIBRARY_PREFIX}jpeg.${PROJECT_VERSION_MAJOR}${CMAKE_SHARED_LIBRARY_SUFFIX})
99+
set(DYN_LIB_FILES "${DYN_LIB_FILE_VERSIONED} ${CMAKE_SHARED_LIBRARY_PREFIX}jpeg${CMAKE_SHARED_LIBRARY_SUFFIX}")
100+
endif()
101+
102+
if(BUILD_STATIC_LIBS)
103+
set(STATIC_LIB_FILE "${CMAKE_STATIC_LIBRARY_PREFIX}jpeg${CMAKE_STATIC_LIBRARY_SUFFIX}")
104+
endif()
105+
97106
# Configure and install
98107
configure_file(libjpeg.pc.cmakein libjpeg.pc @ONLY)
99108
install(FILES
100109
${CMAKE_CURRENT_BINARY_DIR}/libjpeg.pc
101110
DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig
102111
)
112+
113+
configure_file(libjpeg.la.in libjpeg.la @ONLY)
114+
install(FILES
115+
${CMAKE_CURRENT_BINARY_DIR}/libjpeg.la
116+
DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/
117+
)
103118
endif()
104119

105120
### Build executables
@@ -123,4 +138,8 @@ if(BUILD_EXECUTABLES)
123138
target_link_libraries(jpegtran ${LINKED_JPEG_LIB})
124139

125140
install(TARGETS cjpeg djpeg jpegtran rdjpgcom wrjpgcom)
141+
install(
142+
FILES cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 wrjpgcom.1
143+
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
144+
)
126145
endif()

resources/libjpeg.la.in

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# libjpeg.la - a libtool library file
2+
# Configured from libjpeg.la.in using CMake
3+
#
4+
# Please DO NOT delete this file!
5+
# It is necessary for linking the library.
6+
7+
# The name that we can dlopen(3).
8+
dlname='@DYN_LIB_FILE_VERSIONED@'
9+
10+
# Names of this library.
11+
library_names='@DYN_LIB_FILES@'
12+
13+
# The name of the static archive.
14+
old_library='@STATIC_LIB_FILE@'
15+
16+
# Linker flags that cannot go in dependency_libs.
17+
inherited_linker_flags=' '
18+
19+
# Libraries that this one depends upon.
20+
dependency_libs=''
21+
22+
# Names of additional weak libraries provided by this library
23+
weak_library_names=''
24+
25+
# Version information for libjpeg.
26+
current=@JPEG_CONF_VER_MAJOR@
27+
age=@PROJECT_VERSION_MINOR@
28+
revision=@PROJECT_VERSION_PATCH@
29+
30+
# Is this an already installed library?
31+
installed=yes
32+
33+
# Should we warn about portability when linking against -modules?
34+
shouldnotlink=no
35+
36+
# Files to dlopen/dlpreopen
37+
dlopen=''
38+
dlpreopen=''
39+
40+
# Directory that this library needs to be installed in:
41+
libdir='@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@'

resources/libjpeg.pc.cmakein

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
prefix=@prefix@
1+
prefix=@CMAKE_INSTALL_PREFIX@
22
exec_prefix=${prefix}
3-
libdir=${exec_prefix}/@libdir@
4-
includedir=${prefix}/@includedir@
3+
libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
4+
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
55

66
Name: libjpeg
77
Description: Reads and writes JPEG files

0 commit comments

Comments
 (0)