Merge branch 'connectivity-abstraction' to master
[platform/upstream/iotivity.git] / extlibs / gtest / SConscript
1 ##
2 # 'googletest' script to check if Google Unit Test library is installed.  If not,
3 # get it and install it
4 #
5 ##
6
7 import os
8
9 Import('env')
10
11 target_os = env.get('TARGET_OS')
12 src_dir = env.get('SRC_DIR')
13
14
15 if target_os == 'linux':
16         print '*** Checking for installation of google unit test 1.7.0 ***'     
17
18         gtest_dir      = src_dir + '/extlibs/gtest/gtest-1.7.0'
19         gtest_zip_file = src_dir + '/extlibs/gtest/gtest-1.7.0.zip'
20         gtest_url      = 'https://googletest.googlecode.com/files/gtest-1.7.0.zip'
21
22         if not os.path.exists(gtest_dir):
23                 # If the gtest zip file is not already present, download it
24                 if not os.path.exists(gtest_zip_file):
25                         gtest_zip = env.Download(gtest_zip_file, gtest_url)
26                 else:
27                         gtest_zip = gtest_zip_file
28
29                 # Unzip gtest
30                 print 'Unzipping google unit test'
31                 env.UnpackAll(gtest_dir, gtest_zip)
32
33                 # Run configure on gtest
34                 print 'Configuring google unit test'
35                 env.Configure(gtest_dir, './configure')
36
37                 # Run make on gtest
38                 print 'Making google unit test'
39                 env.Configure(gtest_dir, 'make')
40
41