Skip to content

Commit 91eda39

Browse files
committed
add ctest tests
1 parent 9bc8237 commit 91eda39

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

CMakeLists.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,16 @@ if (NOT CMAKE_SYSTEM_NAME STREQUAL "Windows")
2626
endif()
2727

2828
install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_BINARY_DIR})
29+
30+
# find_package(PkgConfig REQUIRED)
31+
# pkg_check_modules(examiner REQUIRED libexaminer)
32+
find_package(examiner REQUIRED)
33+
# add_subdirectory(examiner)
34+
35+
add_executable(${PROJECT_NAME}_test test/test.c)
36+
target_link_libraries(${PROJECT_NAME}_test PRIVATE ${PROJECT_NAME} examiner)
37+
# target_link_libraries(${PROJECT_NAME}_test PRIVATE ${PROJECT_NAME} ${examiner_LINK_LIBRARIES})
38+
# target_include_directories(${PROJECT_NAME}_test PRIVATE ${examiner_INCLUDE_DIRS})
39+
40+
include(CTest)
41+
add_test(NAME ${PROJECT_NAME}_test COMMAND ${PROJECT_NAME}_test)

CMakePresets.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"hidden": true,
1212
"binaryDir": "${sourceDir}/build",
1313
"cacheVariables": {
14-
"CMAKE_BUILD_TYPE": "Release"
14+
"CMAKE_BUILD_TYPE": "Release",
15+
"CMAKE_PREFIX_PATH": "${sourceDir}/examiner-install"
1516
}
1617
},
1718
{

0 commit comments

Comments
 (0)