2005-12-14 21:51:08 +03:00
|
|
|
# - Find upx
|
2012-08-04 16:44:38 +04:00
|
|
|
# This module looks for some executable packers (i.e. software that
|
2001-11-10 00:15:58 +03:00
|
|
|
# compress executables or shared libs into on-the-fly self-extracting
|
|
|
|
# executables or shared libs.
|
|
|
|
# Examples:
|
2005-12-14 21:51:08 +03:00
|
|
|
# UPX: http://wildsau.idv.uni-linz.ac.at/mfx/upx.html
|
2001-11-10 00:15:58 +03:00
|
|
|
|
2009-09-28 19:45:50 +04:00
|
|
|
#=============================================================================
|
|
|
|
# Copyright 2001-2009 Kitware, Inc.
|
|
|
|
#
|
|
|
|
# Distributed under the OSI-approved BSD License (the "License");
|
|
|
|
# see accompanying file Copyright.txt for details.
|
|
|
|
#
|
|
|
|
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
|
|
|
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
# See the License for more information.
|
|
|
|
#=============================================================================
|
2010-08-07 04:48:47 +04:00
|
|
|
# (To distribute this file outside of CMake, substitute the full
|
2009-09-28 19:45:50 +04:00
|
|
|
# License text for the above reference.)
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
include(FindCygwin)
|
2001-11-10 00:15:58 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
find_program(SELF_PACKER_FOR_EXECUTABLE
|
2001-12-04 18:55:17 +03:00
|
|
|
upx
|
|
|
|
${CYGWIN_INSTALL_PATH}/bin
|
|
|
|
/bin
|
2012-08-13 21:42:58 +04:00
|
|
|
/usr/bin
|
2001-12-04 18:55:17 +03:00
|
|
|
/usr/local/bin
|
|
|
|
/sbin
|
|
|
|
)
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
find_program(SELF_PACKER_FOR_SHARED_LIB
|
2001-12-04 18:55:17 +03:00
|
|
|
upx
|
|
|
|
${CYGWIN_INSTALL_PATH}/bin
|
|
|
|
/bin
|
2012-08-13 21:42:58 +04:00
|
|
|
/usr/bin
|
2001-12-04 18:55:17 +03:00
|
|
|
/usr/local/bin
|
|
|
|
/sbin
|
|
|
|
)
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
mark_as_advanced(
|
2001-12-04 18:55:17 +03:00
|
|
|
SELF_PACKER_FOR_EXECUTABLE
|
|
|
|
SELF_PACKER_FOR_SHARED_LIB
|
|
|
|
)
|
2001-11-10 00:15:58 +03:00
|
|
|
|
|
|
|
#
|
|
|
|
# Set flags
|
|
|
|
#
|
2012-08-13 21:47:32 +04:00
|
|
|
if (SELF_PACKER_FOR_EXECUTABLE MATCHES "upx")
|
|
|
|
set (SELF_PACKER_FOR_EXECUTABLE_FLAGS "-q" CACHE STRING
|
2001-11-10 00:15:58 +03:00
|
|
|
"Flags for the executable self-packer.")
|
2012-08-13 21:50:14 +04:00
|
|
|
else ()
|
2012-08-13 21:47:32 +04:00
|
|
|
set (SELF_PACKER_FOR_EXECUTABLE_FLAGS "" CACHE STRING
|
2001-11-10 00:15:58 +03:00
|
|
|
"Flags for the executable self-packer.")
|
2012-08-13 21:50:14 +04:00
|
|
|
endif ()
|
2001-11-10 00:15:58 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
if (SELF_PACKER_FOR_SHARED_LIB MATCHES "upx")
|
|
|
|
set (SELF_PACKER_FOR_SHARED_LIB_FLAGS "-q" CACHE STRING
|
2001-11-10 00:15:58 +03:00
|
|
|
"Flags for the shared lib self-packer.")
|
2012-08-13 21:50:14 +04:00
|
|
|
else ()
|
2012-08-13 21:47:32 +04:00
|
|
|
set (SELF_PACKER_FOR_SHARED_LIB_FLAGS "" CACHE STRING
|
2001-11-10 00:15:58 +03:00
|
|
|
"Flags for the shared lib self-packer.")
|
2012-08-13 21:50:14 +04:00
|
|
|
endif ()
|
2001-12-04 18:55:17 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
mark_as_advanced(
|
2001-12-04 18:55:17 +03:00
|
|
|
SELF_PACKER_FOR_EXECUTABLE_FLAGS
|
|
|
|
SELF_PACKER_FOR_SHARED_LIB_FLAGS
|
|
|
|
)
|