ENH: move EstimateFormatLength to kwsys
[cmake.git] / Modules / FindSelfPackers.cmake
blobe0e2cf3b389393e7a0b0a393abeb4279c23d8224
1
2 # this module looks for some executable packers (i.e. softwares that
3 # compress executables or shared libs into on-the-fly self-extracting
4 # executables or shared libs.
6 # Examples:
7 # UPX: http://wildsau.idv.uni-linz.ac.at/mfx/upx.html
9 INCLUDE(FindCygwin)
11 FIND_PROGRAM(SELF_PACKER_FOR_EXECUTABLE
12   upx
13   ${CYGWIN_INSTALL_PATH}/bin
14   /bin
15   /usr/bin 
16   /usr/local/bin
17   /sbin
20 FIND_PROGRAM(SELF_PACKER_FOR_SHARED_LIB
21   upx
22   ${CYGWIN_INSTALL_PATH}/bin
23   /bin
24   /usr/bin 
25   /usr/local/bin
26   /sbin
29 MARK_AS_ADVANCED(
30   SELF_PACKER_FOR_EXECUTABLE
31   SELF_PACKER_FOR_SHARED_LIB
35 # Set flags
37 IF (SELF_PACKER_FOR_EXECUTABLE MATCHES "upx")
38   SET (SELF_PACKER_FOR_EXECUTABLE_FLAGS "-q" CACHE STRING 
39        "Flags for the executable self-packer.")
40 ELSE (SELF_PACKER_FOR_EXECUTABLE MATCHES "upx")
41   SET (SELF_PACKER_FOR_EXECUTABLE_FLAGS "" CACHE STRING 
42        "Flags for the executable self-packer.")
43 ENDIF (SELF_PACKER_FOR_EXECUTABLE MATCHES "upx")
45 IF (SELF_PACKER_FOR_SHARED_LIB MATCHES "upx")
46   SET (SELF_PACKER_FOR_SHARED_LIB_FLAGS "-q" CACHE STRING 
47        "Flags for the shared lib self-packer.")
48 ELSE (SELF_PACKER_FOR_SHARED_LIB MATCHES "upx")
49   SET (SELF_PACKER_FOR_SHARED_LIB_FLAGS "" CACHE STRING 
50        "Flags for the shared lib self-packer.")
51 ENDIF (SELF_PACKER_FOR_SHARED_LIB MATCHES "upx")
53 MARK_AS_ADVANCED(
54   SELF_PACKER_FOR_EXECUTABLE_FLAGS
55   SELF_PACKER_FOR_SHARED_LIB_FLAGS