-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
51 lines (43 loc) · 1.54 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
46
47
48
49
50
51
# We start by saying what version of cmake we're using.
cmake_minimum_required(VERSION 2.8)
# This sets the name of the project.
project(testprog)
# We can manually set compiler flags via cmake's set command.
# -Wall enables all compiler warnings. You should get in the habit of
# using it.
# -g enables debugger symbols.
# -std=c++0x enables C++11.
set(CMAKE_CXX_FLAGS "-g -Wall -std=c++0x")
# We use this line to specify the location of the compiler's output.
# PROJECT_SOURCE_DIR is a cmake variable that specifies the current
# directory.
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
# we use include_directories to tell cmake where our source folders
# are.
include_directories(
${PROJECT_SOURCE_DIR}/include
${PROJECT_SOURCE_DIR}/src/main
${PROJECT_SOURCE_DIR}/src/test
)
# These commands add Google test. The add_subdirectory command is a
# bit like an "include" for building your project. It causes cmake to
# recursively work on creating build files for the specified
# subdirectory.
add_subdirectory(${PROJECT_SOURCE_DIR}/gtest-1.6.0)
include_directories(${PROJECT_SOURCE_DIR}/gtest-1.6.0/include)
# The add_executable command takes an executable name and a list of
# source files. In this case the source files will be compiled into a
# binary named tests
add_executable(tests
src/test/lab4tests.cpp
src/main/Shape.cpp
src/main/Square.cpp
src/main/Circle.cpp
)
# Main
#add_executable(main
# src/main/clock.cpp
# src/main/main.cpp
#)
# The target_link_libraries takes a binary name and a library
target_link_libraries(tests gtest_main)