-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.cmake
41 lines (35 loc) · 1.12 KB
/
config.cmake
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
## This is an stripped version of cmakepp
##
## https://github.com/toeb/cmakepp
##
cmake_minimum_required(VERSION 2.8.7)
get_property(is_included GLOBAL PROPERTY INCLUDE_GUARD)
if(is_included)
_return()
endif()
set_property(GLOBAL PROPERTY INCLUDE_GUARD true)
cmake_policy(SET CMP0007 NEW)
cmake_policy(SET CMP0012 NEW)
cmake_policy(SET CMP0022 NEW)
if(POLICY CMP0054)
cmake_policy(SET CMP0054 OLD)
endif()
# installation dir of cmakepp
set(CMAKE_BASE_DIR "${CMAKE_CURRENT_LIST_DIR}")
# get temp dir which is needed by a couple of functions in cmakepp
# first uses env variable TMP if it does not exists TMPDIR is used
# if both do not exists current_list_dir/tmp is used
if(UNIX)
set(TMP_DIR $ENV{TMPDIR} /var/tmp)
else()
set(TMP_DIR $ENV{TMP} ${CMAKE_CURRENT_LIST_DIR}/tmp)
endif()
list(GET TMP_DIR 0 TMP_DIR)
file(TO_CMAKE_PATH "${TMP_DIR}" TMP_DIR)
# dummy function which is overwritten and in this form just returns the temp_dir
function(config_dir key)
return("${TMP_DIR}")
endfunction()
## includes all cmake files of cmakepp
include("${CMAKE_BASE_DIR}/config/core/require.cmake")
require("${CMAKE_BASE_DIR}/config/*.cmake")