-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
45 lines (37 loc) · 1.37 KB
/
CMakeLists.txt
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
42
43
44
45
cmake_minimum_required(VERSION 3.5)
project (googlemock_extension)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_C_STANDARD 11)
set(DOBBY_GENERATE_SHARED OFF CACHE BOOL "Build shared library")
set(DOBBY_DEBUG OFF CACHE BOOL "Enable debug logging")
add_subdirectory(thirdparty/Dobby)
add_subdirectory(thirdparty/googletest)
set(ROOT_DIR ${CMAKE_SOURCE_DIR})
set(GOOGLE_TEST_DIR ${CMAKE_SOURCE_DIR}/thirdparty/googletest)
set(GTEST_DIR ${GOOGLE_TEST_DIR}/googletest)
set(GMOCK_DIR ${GOOGLE_TEST_DIR}/googlemock)
include_directories(
${CMAKE_SOURCE_DIR}/gmock-extension/include
${GOOGLE_TEST_DIR}/googletest
${GOOGLE_TEST_DIR}/googletest/include
${GOOGLE_TEST_DIR}/googletest/include/internal
${GOOGLE_TEST_DIR}/googlemock
${GOOGLE_TEST_DIR}/googlemock/include
${GOOGLE_TEST_DIR}/googlemock/include/internal
)
file(GLOB_RECURSE SOURCES RELATIVE
${CMAKE_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/gmock-extension/src/*.cpp
)
add_library(gmock_extension STATIC ${SOURCES})
target_link_libraries(gmock_extension dobby)
set_target_properties(gmock_extension
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
)
add_subdirectory(tests)
add_subdirectory(examples)