-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
111 lines (94 loc) · 2.52 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
cmake_minimum_required(VERSION 3.14)
project(SteganoPass VERSION 1.0)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# ImGui
include(FetchContent)
FetchContent_Declare(
imgui
GIT_REPOSITORY https://github.com/ocornut/imgui.git
GIT_SHALLOW TRUE
)
FetchContent_MakeAvailable(imgui)
# GLFW
FetchContent_Declare(
glfw
GIT_REPOSITORY https://github.com/glfw/glfw.git
GIT_TAG 3.3.8
)
set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(glfw)
# TinyAES
add_library(tinyaes STATIC
${CMAKE_SOURCE_DIR}/external/tinyaes/aes.c
)
target_include_directories(tinyaes PUBLIC
${CMAKE_SOURCE_DIR}/external/tinyaes
)
target_compile_definitions(tinyaes PUBLIC CBC=1)
# Find OpenGL
find_package(OpenGL REQUIRED)
# Main executable
add_executable(SteganoPass
src/main.cpp
src/Application.cpp
src/Steganography.cpp
src/stb_impl.cpp
src/Crypto.cpp
${imgui_SOURCE_DIR}/imgui.cpp
${imgui_SOURCE_DIR}/imgui_demo.cpp
${imgui_SOURCE_DIR}/imgui_draw.cpp
${imgui_SOURCE_DIR}/imgui_tables.cpp
${imgui_SOURCE_DIR}/imgui_widgets.cpp
${imgui_SOURCE_DIR}/backends/imgui_impl_glfw.cpp
${imgui_SOURCE_DIR}/backends/imgui_impl_opengl3.cpp
)
target_include_directories(SteganoPass PRIVATE
${CMAKE_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/external/stb
${CMAKE_SOURCE_DIR}/external/tinyaes
${imgui_SOURCE_DIR}
${imgui_SOURCE_DIR}/backends
${glfw_SOURCE_DIR}/include
)
target_link_libraries(SteganoPass PRIVATE
tinyaes
glfw
OpenGL::GL
)
# GTest
find_package(GTest QUIET)
if(NOT GTest_FOUND)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
)
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)
endif()
enable_testing()
# Test executable
add_executable(
SteganoPass_test
tests/crypto_test.cpp
tests/steganography_test.cpp
src/Crypto.cpp
src/Steganography.cpp
src/stb_impl.cpp
)
if(GTest_FOUND)
target_link_libraries(SteganoPass_test GTest::gtest_main)
else()
target_link_libraries(SteganoPass_test gtest_main)
endif()
target_link_libraries(SteganoPass_test tinyaes)
target_include_directories(SteganoPass_test PRIVATE
${CMAKE_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/external/stb
${CMAKE_SOURCE_DIR}/external/tinyaes
)
include(GoogleTest)
gtest_discover_tests(SteganoPass_test)