summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRex Dieter <rdieter@gmail.com>2011-01-13 19:29:18 +0000
committerRex Dieter <rdieter@gmail.com>2011-01-13 19:29:18 +0000
commitd2d6e1fd6ff9a09631cb7c7353cbdfb74f1ccc4e (patch)
treee6e71a7b27133e490fd23830c457c43e85c78d3b
parent08459fd94478e2f260abab8d5ac1808bae3e4180 (diff)
add pkg-config support to cmake
-rw-r--r--CHANGES3
-rw-r--r--CMakeLists.txt7
-rw-r--r--libopenjpeg1.pc.cmake12
3 files changed, 22 insertions, 0 deletions
diff --git a/CHANGES b/CHANGES
index c1a83433..58adf5e1 100644
--- a/CHANGES
+++ b/CHANGES
@@ -5,6 +5,9 @@ What's New for OpenJPEG
! : changed
+ : added
+January 13, 2001
++ [rdieter] add pkg-config support to cmake
+
January 9, 2011
- [antonin] removed forgotten debug info in imagetopnm().
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 52150f5f..4df951a3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -144,6 +144,13 @@ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/openjpeg_mangle.h.in
ENDIF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/openjpeg_mangle.h.in)
#-----------------------------------------------------------------------------
+# pkgconfig support
+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/libopenjpeg1.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/libopenjpeg1.pc )
+INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/libopenjpeg1.pc DESTINATION ${OPENJPEG_INSTALL_LIB_DIR}/pkgconfig )
+INSTALL( CODE
+ "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink \"libopenjpeg1.pc\" \"\$ENV{DESTDIR}${OPENJPEG_INSTALL_LIB_DIR}/pkgconfig/libopenjpeg.pc\")")
+
+#-----------------------------------------------------------------------------
# Always build the library
INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
SUBDIRS(libopenjpeg)
diff --git a/libopenjpeg1.pc.cmake b/libopenjpeg1.pc.cmake
new file mode 100644
index 00000000..2caa0fa3
--- /dev/null
+++ b/libopenjpeg1.pc.cmake
@@ -0,0 +1,12 @@
+prefix=${CMAKE_INSTALL_PREFIX}
+bindir=${OPENJPEG_INSTALL_BIN_DIR}
+datadir=${OPENJPEG_INSTALL_DATA_DIR}
+libdir=${OPENJPEG_INSTALL_LIB_DIR}
+includedir=${OPENJPEG_INSTALL_INCLUDE_DIR}
+
+Name: openjpeg
+Description: JPEG2000 files library
+URL: http://www.openjpeg.org/
+Version: ${OPENJPEG_VERSION}
+Libs: -L${libdir} -lopenjpeg
+Cflags: -I${includedir}