summaryrefslogtreecommitdiff
path: root/Utilities/Release/Cygwin/CMakeLists.txt
blob: 6a453615feefb7339433344147279baccce7759f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
file(GLOB INSTALLED_CURSES /usr/bin/cygncurses-*.dll)
set(MAX 0)
foreach(f ${INSTALLED_CURSES})
  if(NOT "${f}" MATCHES "\\+")
    string(REGEX REPLACE ".*-([0-9]*).dll" "\\1" NUMBER "${f}")
    if(NUMBER GREATER MAX)
      set(MAX ${NUMBER})
    endif(NUMBER GREATER MAX)
  endif(NOT "${f}" MATCHES "\\+")
endforeach(f)
string(REGEX REPLACE "/usr/bin/" "\\1" NUMBER "${f}")
set(CMAKE_NCURSES_VERSION "libncurses${MAX}")
message(STATUS "Using curses version: libncurses${MAX}")
configure_file("${CMake_SOURCE_DIR}/Utilities/Release/Cygwin/cygwin-setup.hint.in"
  "${CMake_BINARY_DIR}/setup.hint")
configure_file("${CMake_SOURCE_DIR}/Utilities/Release/Cygwin/README.cygwin.in"
  "${CMake_BINARY_DIR}/Docs/@CPACK_PACKAGE_FILE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@.README")
install_files(/share/doc/Cygwin FILES
  ${CMake_BINARY_DIR}/Docs/@CPACK_PACKAGE_FILE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@.README
  )
configure_file("${CMake_SOURCE_DIR}/Utilities/Release/Cygwin/cygwin-package.sh.in"
  ${CPACK_CYGWIN_BUILD_SCRIPT})
configure_file("${CMake_SOURCE_DIR}/Utilities/Release/Cygwin/cygwin-patch.diff.in"
  ${CPACK_CYGWIN_PATCH_FILE})