-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
78 lines (60 loc) · 2.02 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
CMAKE_MINIMUM_REQUIRED(VERSION 3.5)
project(Final-Project)
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y")
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS --coverage)
# Add the include directory for libqrencode
include_directories(
${CMAKE_SOURCE_DIR}/external/libqrencode/
${CMAKE_SOURCE_DIR}/src
)
# Find and link against the libqrencode library
find_library(QRENCODE_LIB qrencode HINTS ${CMAKE_SOURCE_DIR}/external/libqrencode/)
# # Ensure libqrencode library is found
if(NOT QRENCODE_LIB)
message(FATAL_ERROR "libqrencode library not found")
endif()
# # Test QRCode backend code
ADD_EXECUTABLE(QRCodeGenerator tests/testQRCode.cpp)
# # Testing Testing everything is good
ADD_EXECUTABLE(QRCodeRestaurant
tests/testQRCodeVRes.cpp
src/restaurant.cpp
)
# # Link against libqrencode
target_link_libraries(QRCodeGenerator PRIVATE ${QRENCODE_LIB})
target_link_libraries(QRCodeRestaurant PRIVATE ${QRENCODE_LIB})
# Add the include directory for googletest
ADD_SUBDIRECTORY(tests/googletest)
# Testing Algorithm
ADD_EXECUTABLE(Algorithm
tests/testAlgorithm.cpp
src/restaurant.cpp
src/recommendation.cpp
src/buffetRestaurants.cpp
src/vRestaurants.cpp
)
set(SOURCE_FILES
src/restaurant.cpp
src/recommendation.cpp
src/buffetRestaurants.cpp
src/vRestaurants.cpp)
add_executable(main src/main.cpp ${SOURCE_FILES})
set(TEST_FILES
tests/testConstructors.cpp
tests/testEta.cpp
tests/testMenu.cpp)
add_executable(test ${TEST_FILES} ${SOURCE_FILES})
# Link against librect (your restaurant library) for main
target_link_libraries(main PRIVATE librect)
# For some reason, tests/test.cpp does not exist
# ADD_EXECUTABLE(test1
# tests/test.cpp
# )
# Link against libqrencode
target_link_libraries(QRCodeGenerator PRIVATE ${QRENCODE_LIB})
target_link_libraries(QRCodeRestaurant PRIVATE ${QRENCODE_LIB})
target_link_libraries(main PRIVATE ${QRENCODE_LIB})
add_library(librect STATIC src/restaurant.cpp)
TARGET_LINK_LIBRARIES(test gtest_main librect)
TARGET_COMPILE_DEFINITIONS(test PRIVATE gtest_disable_pthreads=ON)