aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authordcommander <dcommander@632fc199-4ca6-4c93-a231-07263d6284db>2013-04-23 22:29:00 +0000
committerdcommander <dcommander@632fc199-4ca6-4c93-a231-07263d6284db>2013-04-23 22:29:00 +0000
commit9a4141d2701f66ae1c5624ae91d6630cc1cb3f4b (patch)
tree0ae5d664a2e3d818ba6688873857d5fe36c7abb3 /CMakeLists.txt
parentae39699b76a4e0a8d778ead0c9b4b22ee14c0194 (diff)
Further enhancements/fixes to the packaging system:
-- The Mac and Cygwin packages will now be created with the directory structure defined by the configure variables "prefix", "bindir", "libdir", etc., with the exception that the docs are always installed under /usr/share/doc/{package_name}-{version} on Cygwin and /Library/Documentation/{package_name} on Mac. -- Fixed a duplicate filename warning when generating RPMs with the default prefix of /opt/libjpeg-turbo. -- Moved the TurboJPEG libraries out of the system directory on Windows and Mac. It is no longer necessary to put them there, since we are not trying to be backward compatible with TurboJPEG/IPP anymore. -- Fixed an issue whereby building the "installer" target on Windows would not build the Java JAR file, thus causing an error if the JAR had not been previously built. -- Building the "install" target on Windows will now install libjpeg-turbo into c:\libjpeg-turbo[-gcc][64] (the same directories used by the installers.) This can be overridden by setting CMAKE_INSTALL_PREFIX. -- The Java classes on all platforms will now look for the JNI library in the directory under which the build/packaging system installs it. git-svn-id: svn://svn.code.sf.net/p/libjpeg-turbo/code/trunk@946 632fc199-4ca6-4c93-a231-07263d6284db
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt29
1 files changed, 25 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f1515d0..98fee90 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -122,6 +122,22 @@ else()
message(STATUS "32-bit build")
endif()
+if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+ if(MSVC)
+ set(CMAKE_INSTALL_PREFIX_DEFAULT ${CMAKE_PROJECT_NAME})
+ else()
+ set(CMAKE_INSTALL_PREFIX_DEFAULT ${CMAKE_PROJECT_NAME}-gcc)
+ endif()
+ if(64BIT)
+ set(CMAKE_INSTALL_PREFIX_DEFAULT ${CMAKE_INSTALL_PREFIX_DEFAULT}64)
+ endif()
+ set(CMAKE_INSTALL_PREFIX "c:/${CMAKE_INSTALL_PREFIX_DEFAULT}" CACHE PATH
+ "Directory into which to install libjpeg-turbo (default: c:/${CMAKE_INSTALL_PREFIX_DEFAULT})"
+ FORCE)
+endif()
+
+message(STATUS "Install directory = ${CMAKE_INSTALL_PREFIX}")
+
configure_file(win/jconfig.h.in jconfig.h)
configure_file(win/config.h.in config.h)
@@ -422,18 +438,18 @@ add_custom_target(testclean COMMAND ${CMAKE_COMMAND} -P
if(MSVC)
set(INST_PLATFORM "Visual C++")
set(INST_NAME ${CMAKE_PROJECT_NAME}-${VERSION}-vc)
- set(INST_DIR ${CMAKE_PROJECT_NAME})
+ set(INST_REG_NAME ${CMAKE_PROJECT_NAME})
elseif(MINGW)
set(INST_PLATFORM GCC)
set(INST_NAME ${CMAKE_PROJECT_NAME}-${VERSION}-gcc)
- set(INST_DIR ${CMAKE_PROJECT_NAME}-gcc)
+ set(INST_REG_NAME ${CMAKE_PROJECT_NAME}-gcc)
set(INST_DEFS -DGCC)
endif()
if(64BIT)
set(INST_PLATFORM "${INST_PLATFORM} 64-bit")
set(INST_NAME ${INST_NAME}64)
- set(INST_DIR ${INST_DIR}64)
+ set(INST_REG_NAME ${INST_DIR}64)
set(INST_DEFS ${INST_DEFS} -DWIN64)
endif()
@@ -447,12 +463,17 @@ else()
set(INST_DEFS ${INST_DEFS} "-DBUILDDIR=")
endif()
+STRING(REGEX REPLACE "/" "\\\\" INST_DIR ${CMAKE_INSTALL_PREFIX})
+
configure_file(release/libjpeg-turbo.nsi.in libjpeg-turbo.nsi @ONLY)
+if(WITH_JAVA)
+ set(JAVA_DEPEND java)
+endif()
add_custom_target(installer
makensis -nocd ${INST_DEFS} libjpeg-turbo.nsi
DEPENDS jpeg jpeg-static turbojpeg turbojpeg-static rdjpgcom wrjpgcom
- cjpeg djpeg jpegtran tjbench
+ cjpeg djpeg jpegtran tjbench ${JAVA_DEPEND}
SOURCES libjpeg-turbo.nsi)
install(TARGETS jpeg-static turbojpeg turbojpeg-static rdjpgcom wrjpgcom tjbench