File: functions.cmake

package info (click to toggle)
cadabra2 2.4.3.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 78,796 kB
  • sloc: ansic: 133,450; cpp: 92,064; python: 1,530; javascript: 203; sh: 184; xml: 182; objc: 53; makefile: 51
file content (49 lines) | stat: -rw-r--r-- 1,179 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Prints section headers
macro(print_header TEXT)
	message("")
	message("-------------------------------------------")
	message("  ${TEXT}")
	message("-------------------------------------------")
endmacro()

# Install directory permissions
macro(install_directory_permissions DIR)
	install(
		DIRECTORY DESTINATION ${DIR}
		DIRECTORY_PERMISSIONS 
		OWNER_READ 
		OWNER_WRITE 
		OWNER_EXECUTE 
		GROUP_READ 
		GROUP_EXECUTE 
		WORLD_READ 
		WORLD_EXECUTE
	)
endmacro()

# Executes rm -f on FILENAME
macro(remove_file FILENAME)
	install(CODE "execute_process(COMMAND rm -f ${FILENAME})")
endmacro()
macro(remove_dir DIRNAME)
	install(CODE "execute_process(COMMAND rmdir ${DIRNAME})")
endmacro()

# Inserts an install directive to copy all dlls from
# the build directory of SUBPROJECT to the Install
# bin folder
macro(install_dlls_from SUBPROJECT)
	if(CMAKE_GENERATOR MATCHES "Visual Studio.*")
		install(
			DIRECTORY "${CMAKE_BINARY_DIR}/${SUBPROJECT}/${CMAKE_BUILD_TYPE}/"
			DESTINATION bin
			FILES_MATCHING PATTERN "*.dll"
		)
	else()
		install(
			DIRECTORY "${CMAKE_BINARY_DIR}/${SUBPROJECT}/"
			DESTINATION bin
			FILES_MATCHING PATTERN "*.dll"
		)
	endif()
endmacro()