|
1 | | -# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. |
| 1 | +# Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. |
2 | 2 | # |
3 | 3 | # This program is free software; you can redistribute it and/or modify |
4 | 4 | # it under the terms of the GNU General Public License as published by |
@@ -38,26 +38,34 @@ FILE(GLOB all_files ${CMAKE_CURRENT_SOURCE_DIR}/*) |
38 | 38 |
|
39 | 39 | FOREACH(file ${all_files}) |
40 | 40 | IF(NOT IS_DIRECTORY ${file} AND NOT ${file} MATCHES "Make|as3ap|/example$" ) |
41 | | - GET_FILENAME_COMPONENT(ext ${file} EXT) |
42 | | - GET_FILENAME_COMPONENT(name ${file} NAME) |
43 | | - SET(target ${name}) |
44 | | - IF(ext MATCHES ".sh$") |
45 | | - # Those are perl files actually |
46 | | - STRING(REPLACE ".sh" "" target ${target} ) |
47 | | - IF(WIN32) |
48 | | - IF(NOT ext MATCHES ".pl") |
49 | | - SET(target "${target}.pl") |
| 41 | + GET_FILENAME_COMPONENT(ext ${file} EXT) |
| 42 | + GET_FILENAME_COMPONENT(name ${file} NAME) |
| 43 | + SET(target ${name}) |
| 44 | + IF(ext MATCHES ".sh$") |
| 45 | + # Those are perl files actually |
| 46 | + STRING(REPLACE ".sh" "" target ${target} ) |
| 47 | + IF(WIN32) |
| 48 | + IF(NOT ext MATCHES ".pl") |
| 49 | + SET(target "${target}.pl") |
| 50 | + ENDIF() |
50 | 51 | ENDIF() |
51 | 52 | ENDIF() |
52 | | - ENDIF() |
53 | | - SET(target "${CMAKE_CURRENT_BINARY_DIR}/${target}") |
54 | | - CONFIGURE_FILE(${file} ${target} COPYONLY) |
55 | | - IF (ext MATCHES ".bat") |
56 | | - IF(WIN32) |
57 | | - INSTALL(FILES ${target} DESTINATION ${prefix}sql-bench COMPONENT SqlBench) |
| 53 | + SET(target "${CMAKE_CURRENT_BINARY_DIR}/${target}") |
| 54 | + CONFIGURE_FILE(${file} ${target} COPYONLY) |
| 55 | + IF (UNIX AND NOT ${name} MATCHES "README") |
| 56 | + EXECUTE_PROCESS(COMMAND chmod +x ${target}) |
| 57 | + ENDIF() |
| 58 | + IF (ext MATCHES ".bat") |
| 59 | + IF(WIN32) |
| 60 | + INSTALL(PROGRAMS ${target} |
| 61 | + DESTINATION ${prefix}sql-bench COMPONENT SqlBench) |
| 62 | + ENDIF() |
| 63 | + ELSEIF(name MATCHES "README") |
| 64 | + INSTALL(FILES ${target} |
| 65 | + DESTINATION ${prefix}sql-bench COMPONENT SqlBench) |
| 66 | + ELSE() |
| 67 | + INSTALL(PROGRAMS ${target} |
| 68 | + DESTINATION ${prefix}sql-bench COMPONENT SqlBench) |
58 | 69 | ENDIF() |
59 | | - ELSE() |
60 | | - INSTALL(FILES ${target} DESTINATION ${prefix}sql-bench COMPONENT SqlBench) |
61 | | - ENDIF() |
62 | 70 | ENDIF() |
63 | 71 | ENDFOREACH() |
0 commit comments