Skip to content

Commit 9fe22da

Browse files
committed
Set the BUILD environment variable properly when building with MinGW implementations that lack a Unix shell (TDM-GCC, for instance); Only set CMP0022 if it is supported (older CMake implementations don't support it); Remove trailing spaces
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.3.x@1238 632fc199-4ca6-4c93-a231-07263d6284db
1 parent 9a341f8 commit 9fe22da

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

CMakeLists.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@
33
#
44

55
cmake_minimum_required(VERSION 2.8.8)
6-
cmake_policy(SET CMP0022 OLD)
6+
# Use LINK_INTERFACE_LIBRARIES instead of INTERFACE_LINK_LIBRARIES
7+
if(POLICY CMP0022)
8+
cmake_policy(SET CMP0022 OLD)
9+
endif()
710

811
project(libjpeg-turbo C)
912
set(VERSION 1.3.1)
1013

11-
if(MINGW OR CYGWIN)
14+
if(CYGWIN OR NOT CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
1215
execute_process(COMMAND "date" "+%Y%m%d" OUTPUT_VARIABLE BUILD)
1316
string(REGEX REPLACE "\n" "" BUILD ${BUILD})
1417
elseif(WIN32)
@@ -469,7 +472,7 @@ else()
469472
set(INST_DEFS ${INST_DEFS} "-DBUILDDIR=")
470473
endif()
471474

472-
STRING(REGEX REPLACE "/" "\\\\" INST_DIR ${CMAKE_INSTALL_PREFIX})
475+
STRING(REGEX REPLACE "/" "\\\\" INST_DIR ${CMAKE_INSTALL_PREFIX})
473476

474477
configure_file(release/libjpeg-turbo.nsi.in libjpeg-turbo.nsi @ONLY)
475478

@@ -489,7 +492,7 @@ install(TARGETS jpeg-static turbojpeg turbojpeg-static rdjpgcom wrjpgcom tjbench
489492
)
490493

491494
install(FILES ${CMAKE_SOURCE_DIR}/README ${CMAKE_SOURCE_DIR}/README-turbo.txt
492-
${CMAKE_SOURCE_DIR}/example.c ${CMAKE_SOURCE_DIR}/libjpeg.txt
495+
${CMAKE_SOURCE_DIR}/example.c ${CMAKE_SOURCE_DIR}/libjpeg.txt
493496
${CMAKE_SOURCE_DIR}/structure.txt ${CMAKE_SOURCE_DIR}/usage.txt
494497
${CMAKE_SOURCE_DIR}/wizard.txt
495498
DESTINATION doc)

0 commit comments

Comments
 (0)