diff options
| author | Andreas Schneider <asn@cynapses.org> | 2010-07-13 13:19:06 +0200 |
|---|---|---|
| committer | Andreas Schneider <asn@cynapses.org> | 2010-07-13 13:19:06 +0200 |
| commit | 3a61d55f27ec0db6b845287d80f6532a230829f7 (patch) | |
| tree | 8a2dcd391fe21afe40ec85c946f4c5b614bbfd14 | |
| parent | c4d1d8b684d14d854aa83e830be8912e8d3bbdf5 (diff) | |
build: Added a check for NSIS.
| -rw-r--r-- | CPackConfig.cmake | 14 | ||||
| -rw-r--r-- | cmake/Modules/FindNSIS.cmake | 31 |
2 files changed, 40 insertions, 5 deletions
diff --git a/CPackConfig.cmake b/CPackConfig.cmake index 3c1ed6bd..65de9c96 100644 --- a/CPackConfig.cmake +++ b/CPackConfig.cmake @@ -24,13 +24,17 @@ set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSIO ### nsis generator -set(CPACK_GENERATOR "NSIS") +set(CPACK_GENERATOR "ZIP") -set(CPACK_PACKAGE_INSTALL_DIRECTORY "libssh") +find_package(NSIS) +if (HAVE_NSIS) + set(CPACK_GENERATOR "${CPACK_GENERATOR};NSIS") + set(CPACK_NSIS_DISPLAY_NAME "The SSH Library") + set(CPACK_NSIS_COMPRESSOR "/SOLID zlib") + set(CPACK_NSIS_MENU_LINKS "http://www.libssh.org/" "libssh homepage") +if (HAVE_NSIS) -set(CPACK_NSIS_DISPLAY_NAME "The SSH Library") -set(CPACK_NSIS_COMPRESSOR "/SOLID zlib") -set(CPACK_NSIS_MENU_LINKS "http://www.libssh.org/" "libssh homepage") +set(CPACK_PACKAGE_INSTALL_DIRECTORY "libssh") set(CPACK_PACKAGE_FILE_NAME ${APPLICATION_NAME}-${CPACK_PACKAGE_VERSION}) diff --git a/cmake/Modules/FindNSIS.cmake b/cmake/Modules/FindNSIS.cmake new file mode 100644 index 00000000..c3910435 --- /dev/null +++ b/cmake/Modules/FindNSIS.cmake @@ -0,0 +1,31 @@ +# - Try to find NSIS +# Once done this will define +# +# NSIS_FOUND - system has NSIS +# NSIS_MAKE - NSIS creator executable +# +# Copyright (c) 2010 Andreas Schneider <mail@cynapses.org> +# +# Redistribution and use is allowed according to the terms of the New +# BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +# + +if (NSIS_MAKE) + # in cache already + set(NSIS_FOUND TRUE) +elseif (NSIS_MAKE) + find_program(NSIS_MAKE + NAMES + makensis + PATHS + ${_NSIS_DIR} + ${_NSIS_DIR}/Bin + $ENV{PROGRAMFILES}/NSIS + ) + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(NSIS DEFAULT_MSG NSIS_MAKE) + + mark_as_advanced(NSIS_MAKE) +endif (NSIS_MAKE) |
