]> granicus.if.org Git - libjpeg-turbo/commitdiff
Build: Fix install of static build w/ VStudio IDE
authorDRC <information@libjpeg-turbo.org>
Fri, 25 Jan 2019 22:46:02 +0000 (16:46 -0600)
committerDRC <information@libjpeg-turbo.org>
Mon, 25 Feb 2019 17:24:19 +0000 (11:24 -0600)
Unfortunately, this hack is necessary because:
- install(TARGETS, ...) doesn't support the RENAME option.
- We can't modify OUTPUT_NAME for the "-static" targets without breaking
  the regression tests.
- ${CMAKE_CFG_INTDIR} doesn't seem to work properly in an install()
  command.

Refer to #307

CMakeLists.txt
ChangeLog.md

index 296e408ba254b845ad19e01fe41f54c9a6088fb2..0a26504167774bd22a549298107bc9da19ba06f8 100644 (file)
@@ -925,7 +925,12 @@ if(WITH_TURBOJPEG)
   if(ENABLE_STATIC)
     install(TARGETS turbojpeg-static ARCHIVE DESTINATION lib)
     if(NOT ENABLE_SHARED)
-      install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/tjbench-static.exe
+      if(MSVC_IDE)
+        set(DIR "${CMAKE_CURRENT_BINARY_DIR}/\${CMAKE_INSTALL_CONFIG_NAME}")
+      else()
+        set(DIR ${CMAKE_CURRENT_BINARY_DIR})
+      endif()
+      install(PROGRAMS ${DIR}/tjbench-static.exe
         DESTINATION bin RENAME tjbench.exe)
     endif()
   endif()
@@ -935,11 +940,16 @@ endif()
 if(ENABLE_STATIC)
   install(TARGETS jpeg-static ARCHIVE DESTINATION lib)
   if(NOT ENABLE_SHARED)
-    install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/cjpeg-static.exe
+    if(MSVC_IDE)
+      set(DIR "${CMAKE_CURRENT_BINARY_DIR}/\${CMAKE_INSTALL_CONFIG_NAME}")
+    else()
+      set(DIR ${CMAKE_CURRENT_BINARY_DIR})
+    endif()
+    install(PROGRAMS ${DIR}/cjpeg-static.exe
       DESTINATION bin RENAME cjpeg.exe)
-    install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/djpeg-static.exe
+    install(PROGRAMS ${DIR}/djpeg-static.exe
       DESTINATION bin RENAME djpeg.exe)
-    install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/jpegtran-static.exe
+    install(PROGRAMS ${DIR}/jpegtran-static.exe
       DESTINATION bin RENAME jpegtran.exe)
   endif()
 endif()
index 4b4b2ea7aec9479b690374e6af3683114b2d5411..9f93fbf509a35606cf8372221d61318e5d9f5473 100644 (file)
@@ -73,6 +73,9 @@ of specifying 1x subsampling (normally 4:4:4 JPEGs have 1x1 luminance and
 chrominance sampling factors), but the JPEG format and the libjpeg API both
 allow it.
 
+13. Fixed an issue whereby a static build of libjpeg-turbo (a build in which
+`ENABLE_SHARED` is `0`) could not be installed using the Visual Studio IDE.
+
 
 1.5.3
 =====