ENH: add support for g77 extra _ at the end of functions that have an _ in the name...
[cmake.git] / Modules / FindSelfPackers.cmake
blob78d6e195694cea6cedfb279589ba289ca7213016
1 # - Find upx
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.
5 # Examples:
6 #  UPX: http://wildsau.idv.uni-linz.ac.at/mfx/upx.html
8 INCLUDE(FindCygwin)
10 FIND_PROGRAM(SELF_PACKER_FOR_EXECUTABLE
11   upx
12   ${CYGWIN_INSTALL_PATH}/bin
13   /bin
14   /usr/bin 
15   /usr/local/bin
16   /sbin
19 FIND_PROGRAM(SELF_PACKER_FOR_SHARED_LIB
20   upx
21   ${CYGWIN_INSTALL_PATH}/bin
22   /bin
23   /usr/bin 
24   /usr/local/bin
25   /sbin
28 MARK_AS_ADVANCED(
29   SELF_PACKER_FOR_EXECUTABLE
30   SELF_PACKER_FOR_SHARED_LIB
34 # Set flags
36 IF (SELF_PACKER_FOR_EXECUTABLE MATCHES "upx")
37   SET (SELF_PACKER_FOR_EXECUTABLE_FLAGS "-q" CACHE STRING 
38        "Flags for the executable self-packer.")
39 ELSE (SELF_PACKER_FOR_EXECUTABLE MATCHES "upx")
40   SET (SELF_PACKER_FOR_EXECUTABLE_FLAGS "" CACHE STRING 
41        "Flags for the executable self-packer.")
42 ENDIF (SELF_PACKER_FOR_EXECUTABLE MATCHES "upx")
44 IF (SELF_PACKER_FOR_SHARED_LIB MATCHES "upx")
45   SET (SELF_PACKER_FOR_SHARED_LIB_FLAGS "-q" CACHE STRING 
46        "Flags for the shared lib self-packer.")
47 ELSE (SELF_PACKER_FOR_SHARED_LIB MATCHES "upx")
48   SET (SELF_PACKER_FOR_SHARED_LIB_FLAGS "" CACHE STRING 
49        "Flags for the shared lib self-packer.")
50 ENDIF (SELF_PACKER_FOR_SHARED_LIB MATCHES "upx")
52 MARK_AS_ADVANCED(
53   SELF_PACKER_FOR_EXECUTABLE_FLAGS
54   SELF_PACKER_FOR_SHARED_LIB_FLAGS