forked from psiha/build
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathutilities.cmake
28 lines (24 loc) · 945 Bytes
/
utilities.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
################################################################################
#
# T|N.U.N. CMake utilities
#
# Copyright (c) 2016. Domagoj saric. All rights reserved.
#
################################################################################
cmake_minimum_required( VERSION 3.0 )
################################################################################
# TNUN_make_temp_path()
################################################################################
function( TNUN_make_temp_path file_name_variable )
if( EXISTS $ENV{TEMP} )
set( temp_dir "$ENV{TEMP}" )
elseif( EXISTS $ENV{TMP} )
set( temp_dir "$ENV{TMP}" )
elseif( EXISTS $ENV{TMPDIR} )
set( temp_dir "$ENV{TMPDIR}" )
else()
set( temp_dir "${PROJECT_BINARY_DIR}" )
endif()
set( file_name ${${file_name_variable}} )
set( ${file_name_variable} "${temp_dir}/${file_name}" PARENT_SCOPE )
endfunction()