Skip to content

Commit 39a2d14

Browse files
author
Tor Didriksen
committed
Bug#16395606 SCRIPTS MISSING EXECUTE BIT
Add execute bit for scripts: - in build directory - in install directory
1 parent aea3d4b commit 39a2d14

1 file changed

Lines changed: 27 additions & 19 deletions

File tree

sql-bench/CMakeLists.txt

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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.
22
#
33
# This program is free software; you can redistribute it and/or modify
44
# 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}/*)
3838

3939
FOREACH(file ${all_files})
4040
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()
5051
ENDIF()
5152
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)
5869
ENDIF()
59-
ELSE()
60-
INSTALL(FILES ${target} DESTINATION ${prefix}sql-bench COMPONENT SqlBench)
61-
ENDIF()
6270
ENDIF()
6371
ENDFOREACH()

0 commit comments

Comments
 (0)