Build: Fix issues w/ Ninja Multi-Config generator

- Fix an issue whereby a build with ENABLE_SHARED=0 could not be
  installed when using the Ninja Multi-Config CMake generator.

- Fix an issue whereby a Windows installer could not be built when using
  the Ninja Multi-Config CMake generator.

- Fix an issue whereby the Java regression tests failed when using the
  Ninja Multi-Config CMake generator.

Based on:
4f169deeb0

Closes #626
This commit is contained in:
DRC 2022-11-03 13:37:55 -05:00
Родитель 8c5e78ce29
Коммит 4f7a8afbb7
3 изменённых файлов: 24 добавлений и 4 удалений

Просмотреть файл

@ -40,6 +40,15 @@ set(LIBJPEG_TURBO_VERSION_NUMBER ${VERSION_MAJOR}${VERSION_MINOR}${VERSION_REVIS
# application bundles would break our iOS packages.)
set(CMAKE_MACOSX_BUNDLE FALSE)
get_property(GENERATOR_IS_MULTI_CONFIG GLOBAL PROPERTY
GENERATOR_IS_MULTI_CONFIG)
# If the GENERATOR_IS_MULTI_CONFIG property doesn't exist (CMake < 3.9), then
# set the GENERATOR_IS_MULTI_CONFIG variable manually if the generator is
# Visual Studio or Xcode (the only multi-config generators in CMake < 3.9).
if(NOT GENERATOR_IS_MULTI_CONFIG AND (MSVC_IDE OR XCODE))
set(GENERATOR_IS_MULTI_CONFIG TRUE)
endif()
string(TIMESTAMP DEFAULT_BUILD "%Y%m%d")
set(BUILD ${DEFAULT_BUILD} CACHE STRING "Build string (default: ${DEFAULT_BUILD})")
@ -734,7 +743,7 @@ add_executable(strtest strtest.c)
add_subdirectory(md5)
if(MSVC_IDE OR XCODE)
if(GENERATOR_IS_MULTI_CONFIG)
set(OBJDIR "\${CTEST_CONFIGURATION_TYPE}/")
else()
set(OBJDIR "")
@ -1468,7 +1477,7 @@ if(WITH_TURBOJPEG)
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
if(NOT ENABLE_SHARED)
if(MSVC_IDE OR XCODE)
if(GENERATOR_IS_MULTI_CONFIG)
set(DIR "${CMAKE_CURRENT_BINARY_DIR}/\${CMAKE_INSTALL_CONFIG_NAME}")
else()
set(DIR ${CMAKE_CURRENT_BINARY_DIR})
@ -1486,7 +1495,7 @@ if(ENABLE_STATIC)
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
if(NOT ENABLE_SHARED)
if(MSVC_IDE OR XCODE)
if(GENERATOR_IS_MULTI_CONFIG)
set(DIR "${CMAKE_CURRENT_BINARY_DIR}/\${CMAKE_INSTALL_CONFIG_NAME}")
else()
set(DIR ${CMAKE_CURRENT_BINARY_DIR})

Просмотреть файл

@ -1,3 +1,14 @@
2.1.5
=====
### Significant changes relative to 2.1.4:
1. Fixed issues in the build system whereby, when using the Ninja Multi-Config
CMake generator, a static build of libjpeg-turbo (a build in which
`ENABLE_SHARED` is `0`) could not be installed, a Windows installer could not
be built, and the Java regression tests failed.
2.1.4
=====

Просмотреть файл

@ -90,7 +90,7 @@ if(WITH_JAVA)
set(INST_DEFS ${INST_DEFS} -DJAVA)
endif()
if(MSVC_IDE)
if(GENERATOR_IS_MULTI_CONFIG)
set(INST_DEFS ${INST_DEFS} "-DBUILDDIR=${CMAKE_CFG_INTDIR}\\")
else()
set(INST_DEFS ${INST_DEFS} "-DBUILDDIR=")