CMakeLists.txt 1.55 KB
Newer Older
1
cmake_minimum_required(VERSION 3.9)
Graeme Gott's avatar
Graeme Gott committed
2 3 4

project(whiskermenu)

Graeme Gott's avatar
Graeme Gott committed
5
# version number
Graeme Gott's avatar
Graeme Gott committed
6
set(whiskermenu_version_major "2")
Graeme Gott's avatar
Graeme Gott committed
7
set(whiskermenu_version_minor "4")
Graeme Gott's avatar
Graeme Gott committed
8
set(whiskermenu_version_micro "6")
Graeme Gott's avatar
Graeme Gott committed
9
set(whiskermenu_version_tag "")
Graeme Gott's avatar
Graeme Gott committed
10 11 12 13 14 15 16
set(whiskermenu_version "${whiskermenu_version_major}.${whiskermenu_version_minor}.${whiskermenu_version_micro}")
if(${whiskermenu_version_tag} MATCHES "git")
	if(NOT DEFINED whiskermenu_version_build)
		execute_process(COMMAND git describe
			WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
			OUTPUT_VARIABLE whiskermenu_version_build)
		string(REGEX REPLACE "^.*-g" "" whiskermenu_version_build "${whiskermenu_version_build}")
17
		string(REGEX REPLACE "\n" "" whiskermenu_version_build "${whiskermenu_version_build}")
Graeme Gott's avatar
Graeme Gott committed
18 19 20 21
	endif()
	set(whiskermenu_version "${whiskermenu_version}.${whiskermenu_version_tag}-${whiskermenu_version_build}")
endif()

hasufell's avatar
hasufell committed
22
# options
23
option(ENABLE_VISIBILITY "Enable ELF visibility attributes" ON)
24
option(ENABLE_AS_NEEDED "Enable -Wl,--as-needed for the linker" ON)
Graeme Gott's avatar
Graeme Gott committed
25
option(ENABLE_LINKER_OPTIMIZED_HASH_TABLES "Enable -Wl,-O1 for the linker" ON)
26
option(ENABLE_LINK_TIME_OPTIMIZATION "Enable link time optimization" ON)
27
option(ENABLE_DEVELOPER_MODE "Enable strict checks to help with development" OFF)
hasufell's avatar
hasufell committed
28

29
include(GNUInstallDirs)
Graeme Gott's avatar
Graeme Gott committed
30 31

add_subdirectory(icons)
32 33
add_subdirectory(panel-plugin)
add_subdirectory(po)
Graeme Gott's avatar
Graeme Gott committed
34 35 36

# uninstall target
configure_file(
Graeme Gott's avatar
Graeme Gott committed
37 38 39
	${CMAKE_CURRENT_SOURCE_DIR}/cmake/uninstall.cmake.in
	${CMAKE_CURRENT_BINARY_DIR}/cmake/uninstall.cmake
	IMMEDIATE @ONLY)
Graeme Gott's avatar
Graeme Gott committed
40
add_custom_target(uninstall
Graeme Gott's avatar
Graeme Gott committed
41
	${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake/uninstall.cmake)