forked from KhronosGroup/OpenCL-Guide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
49 lines (39 loc) · 1.21 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
cmake_minimum_required(VERSION 3.18) # RUBY_ vars
project(OpenCL-Guide
LANGUAGES NONE
)
find_package(Ruby QUIET)
if(NOT EXISTS "${RUBY_EXECUTABLE}")
message(FATAL_ERROR "Ruby not found.")
endif()
if(NOT EXISTS "${AWESOME_BOT_EXECUTABLE}")
get_filename_component(RUBY_EXECUTABLE_DIR "${RUBY_EXECUTABLE}" DIRECTORY)
if(WIN32)
set(AWESOME_BOT_NAMES awesome_bot.cmd awesome_bot.bat awesome_bot.exe)
else()
set(AWESOME_BOT_NAMES awesome_bot)
endif()
find_program(AWESOME_BOT_EXECUTABLE
NAMES ${AWESOME_BOT_NAMES}
HINTS "${RUBY_EXECUTABLE_DIR}"
PATHS ENV MY_RUBY_HOME
PATH_SUFFIXES
bin
Scripts
)
if(NOT EXISTS "${AWESOME_BOT_EXECUTABLE}")
message(FATAL_ERROR "awesome_bot executable not found. Please install or provide path by specifying AWESOME_BOT_EXECUTABLE")
endif()
endif()
include(CTest)
file(GLOB_RECURSE MD_FILES
CONFIGURE_DEPENDS
chapters/*.md
)
foreach(MD_FILE IN LISTS MD_FILES)
get_filename_component(MD_FILE_NAME "${MD_FILE}" NAME)
add_test(
NAME ${MD_FILE_NAME}
COMMAND "${AWESOME_BOT_EXECUTABLE}" --allow-dupe "${MD_FILE}" --white-list https://www.youtube.com/,https://github.com/KhronosGroup,https://github.com/microsoft
)
endforeach()