1
1
include_directories (. ${CMAKE_CURRENT_SOURCE_DIR} /../lib/include/public ${CMAKE_CURRENT_SOURCE_DIR} /../lib/include/mat ${CMAKE_CURRENT_SOURCE_DIR} /../lib/decoder ${CMAKE_CURRENT_SOURCE_DIR} /../sqlite )
2
-
3
- include_directories (
4
- ${CMAKE_CURRENT_SOURCE_DIR} /../third_party/googletest/googletest/include
5
- ${CMAKE_CURRENT_SOURCE_DIR} /../third_party/googletest/googlemock/include
6
- )
2
+ message ("-->Lalit tests" )
7
3
8
4
include_directories (../lib )
9
5
@@ -14,23 +10,33 @@ set(TESTS_COMMON_SRCS
14
10
../../lib/decoder/PayloadDecoder.cpp
15
11
)
16
12
13
+ if (BUILD_FUNC_TESTS OR BUILD_UNIT_TEST )
14
+ if (WIN32 )
15
+ find_package (GTest )
16
+ if (NOT (GTEST_FOUND OR GTest_FOUND ))
17
+ install_windows_deps ()
18
+ if (NOT DEFINED CMAKE_TOOLCHAIN_FILE )
19
+ message (STATUS_FATAL "Windows dependency installation failed!" )
20
+ endif ()
21
+ message (STATUS ${CMAKE_TOOLCHAIN_FILE} )
22
+ find_package (GTest REQUIRED )
23
+ endif ()
24
+ else ()
25
+ message ("Adding gtest" )
26
+ add_library (gtest STATIC IMPORTED GLOBAL )
27
+ message ("Adding gmock" )
28
+ add_library (gmock STATIC IMPORTED GLOBAL )
29
+ include_directories (
30
+ ${CMAKE_CURRENT_SOURCE_DIR} /../third_party/googletest/googletest/include
31
+ ${CMAKE_CURRENT_SOURCE_DIR} /../third_party/googletest/googlemock/include
32
+ )
33
+ endif ()
34
+ endif ()
35
+
17
36
if (BUILD_FUNC_TESTS )
18
37
add_subdirectory (functests )
19
38
endif ()
20
-
21
39
if (BUILD_UNIT_TESTS )
22
40
include_directories (${CMAKE_CURRENT_SOURCE_DIR} /unittests )
23
41
add_subdirectory (unittests )
24
42
endif ()
25
-
26
- if (WIN32 AND (BUILD_FUNC_TESTS OR BUILD_UNIT_TEST ))
27
- find_package (GTest )
28
- if (NOT (GTEST_FOUND OR GTest_FOUND ))
29
- install_windows_deps ()
30
- if (NOT DEFINED CMAKE_TOOLCHAIN_FILE )
31
- message (STATUS_FATAL "Windows dependency installation failed!" )
32
- endif ()
33
- message (STATUS ${CMAKE_TOOLCHAIN_FILE} )
34
- find_package (GTest REQUIRED )
35
- endif ()
36
- endif ()
0 commit comments