CMake/Modules/FindSelfPackers.cmake

76 lines
1.9 KiB
CMake
Raw Normal View History

#.rst:
# FindSelfPackers
# ---------------
#
# Find upx
#
# This module looks for some executable packers (i.e. software that
2001-11-09 21:15:58 +00:00
# compress executables or shared libs into on-the-fly self-extracting
# executables or shared libs. Examples:
#
# ::
#
# UPX: http://wildsau.idv.uni-linz.ac.at/mfx/upx.html
2001-11-09 21:15:58 +00: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.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
include(${CMAKE_CURRENT_LIST_DIR}/FindCygwin.cmake)
2001-11-09 21:15:58 +00:00
find_program(SELF_PACKER_FOR_EXECUTABLE
upx
${CYGWIN_INSTALL_PATH}/bin
/bin
/usr/bin
/usr/local/bin
/sbin
)
find_program(SELF_PACKER_FOR_SHARED_LIB
upx
${CYGWIN_INSTALL_PATH}/bin
/bin
/usr/bin
/usr/local/bin
/sbin
)
mark_as_advanced(
SELF_PACKER_FOR_EXECUTABLE
SELF_PACKER_FOR_SHARED_LIB
)
2001-11-09 21:15:58 +00:00
#
# Set flags
#
if (SELF_PACKER_FOR_EXECUTABLE MATCHES "upx")
set (SELF_PACKER_FOR_EXECUTABLE_FLAGS "-q" CACHE STRING
2001-11-09 21:15:58 +00:00
"Flags for the executable self-packer.")
else ()
set (SELF_PACKER_FOR_EXECUTABLE_FLAGS "" CACHE STRING
2001-11-09 21:15:58 +00:00
"Flags for the executable self-packer.")
endif ()
2001-11-09 21:15:58 +00:00
if (SELF_PACKER_FOR_SHARED_LIB MATCHES "upx")
set (SELF_PACKER_FOR_SHARED_LIB_FLAGS "-q" CACHE STRING
2001-11-09 21:15:58 +00:00
"Flags for the shared lib self-packer.")
else ()
set (SELF_PACKER_FOR_SHARED_LIB_FLAGS "" CACHE STRING
2001-11-09 21:15:58 +00:00
"Flags for the shared lib self-packer.")
endif ()
mark_as_advanced(
SELF_PACKER_FOR_EXECUTABLE_FLAGS
SELF_PACKER_FOR_SHARED_LIB_FLAGS
)