File: CMakeLists.txt

package info (click to toggle)
icewm 1.3.8+mod+20161220-1
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 7,160 kB
  • ctags: 5,575
  • sloc: cpp: 48,848; ansic: 1,813; makefile: 1,129; sh: 339; xml: 48
file content (58 lines) | stat: -rw-r--r-- 2,074 bytes parent folder | download
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
50
51
52
53
54
55
56
57
58
cmake_minimum_required(VERSION 2.6)
IF (POLICY CMP0053) # in CMake 3.1.0+
  CMAKE_POLICY (SET CMP0053 OLD) # keep old-style @VAR@ expansion
ENDIF (POLICY CMP0053)
PROJECT(ICEWM CXX C)

set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR})

set(PROJECT_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/src)
include_directories(${CMAKE_BINARY_DIR})
include_directories(${PROJECT_SOURCE_DIR})

IF(NOT DEFINED(CMAKE_INSTALL_PREFIX))
set(CMAKE_INSTALL_PREFIX "/usr/local" CACHE STRING "Target file space")
ENDIF()
# iiieh, neeing to add some guards, since having this nested construct
# interacts badly when changing a variable afterwards cmake also insists on
# overwritting that variables later :-( if not protected
IF(NOT DEFINED(DATADIR))
set(DATADIR "${CMAKE_INSTALL_PREFIX}/share" CACHE STRING "Shared data files directory")
ENDIF()
IF(NOT DEFINED(LIBDIR))
	set(LIBDIR "${DATADIR}/icewm" CACHE STRING "Location of icewm meta data")
ENDIF()
IF(NOT DEFINED(DOCDIR))
	set(DOCDIR "${DATADIR}/doc/icewm" CACHE STRING "Location of documentation files")
ENDIF()
IF(NOT DEFINED(LOCDIR))
	set(LOCDIR "${DATADIR}/locale" CACHE STRING "System locale data directory")
ENDIF()
IF(NOT DEFINED(CFGDIR))
	set(CFGDIR "${CMAKE_INSTALL_PREFIX}/etc/icewm" CACHE STRING "Location of system-wide configuration files")
ENDIF()
IF(NOT DEFINED(ICEHELPIDX))
	set(ICEHELPIDX "${DOCDIR}/icewm.html" CACHE STRING "Location of HTML manual entry page")
ENDIF()
IF(NOT DEFINED(BINDIR))
set(BINDIR "${CMAKE_INSTALL_PREFIX}/bin")
ENDIF()

FILE(READ "${CMAKE_SOURCE_DIR}/VERSION" vfilecontents)
STRING(REGEX REPLACE "\n" ";" vfilecontents "${vfilecontents}")
foreach (line ${vfilecontents})
	STRING(REGEX REPLACE "=" ";" keyval "${line}")
	list(GET keyval 0 _key)
	IF(NOT DEFINED ${_key})
		list(GET keyval 1 ${_key})
	ENDIF()
endforeach()

add_subdirectory(src)
add_subdirectory(po)
add_subdirectory(lib)
add_subdirectory(doc)

install(FILES icewm-set-gnomewm DESTINATION ${BINDIR} PERMISSIONS WORLD_EXECUTE OWNER_EXECUTE GROUP_EXECUTE WORLD_READ OWNER_READ OWNER_WRITE GROUP_READ)