-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists-template.txt
66 lines (47 loc) · 1.77 KB
/
CMakeLists-template.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
# Below is a template CMake script for creating new projects
# Disable this project if CUDA is unavailable
# disable_if_cuda_not_found()
# Disable this project if OpenCV is unavailable
# disable_if_opencv_not_found()
# Disable this project if the Pthread library is not available
# disable_if_pthread_not_found()
# Disable this project if not built on/for a Unix machine
# enforce_unix()
# This is the name of the executable
set(EXECUTABLE_NAME INSERT_PROJECT_NAME_HERE)
set(PROJECT_CUDA
# Place .cu files here
)
set(PROJECT_SOURCES
#Place .cpp files here
)
set(PROJECT_HEADERS
#Place .h files here
)
# Add source to this project's executable.
add_executable (${EXECUTABLE_NAME} ${PROJECT_SOURCES} ${PROJECT_HEADERS} ${PROJECT_CUDA})
# Add tests and install targets if needed.
# Add or remove project dependencies here and for the testing framework (the next call to target_compile_definitions)
target_link_libraries (${EXECUTABLE_NAME} glad glfw imgui ${OpenCV_LIBS})
# Compile the CUDA files separately. They can still be linked.
set_property(TARGET ${EXECUTABLE_NAME} PROPERTY CUDA_SEPARABLE_COMPILATION ON)
# Below is a template to add unit testing to your project with the Google testing framework
# Refer to their documentation for more details: https://google.github.io/googletest/samples.html
# ------------------ Testing framework via GoogleTest --------------------
enable_testing()
add_executable(
${EXECUTABLE_NAME}_tests
# List test .cpp files here
)
target_link_libraries(
${EXECUTABLE_NAME}_tests
GTest::gtest_main
glad glfw imgui ${OpenCV_LIBS} # again, list libraries to link here
)
target_compile_definitions(
${EXECUTABLE_NAME}_tests
PUBLIC
ASSET_DIR="${PROJECT_SOURCE_DIR}/assets"
)
include(GoogleTest)
gtest_discover_tests(${EXECUTABLE_NAME}_tests)