This repository has been archived by the owner on Oct 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 123
/
CMakeLists.txt
50 lines (41 loc) · 2.03 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
include (LibAddMacros)
add_plugin (
specload
SOURCES specload.h specload.c
LINK_ELEKTRA elektra-ease elektra-invoke
TEST_README COMPONENT libelektra${SO_VERSION})
if (DEPENDENCY_PHASE AND BUILD_SHARED)
add_dependencies (elektra-specload elektra-quickdump)
endif ()
if (ADDTESTING_PHASE)
add_executable (elektra-specload-testapp "${CMAKE_CURRENT_SOURCE_DIR}/testapp.c")
target_link_elektra (elektra-specload-testapp elektra-core elektra-invoke)
set (TESTAPP_NAME "elektra-specload-testapp")
configure_file ("${CMAKE_CURRENT_SOURCE_DIR}/config.c.in" "${CMAKE_CURRENT_BINARY_DIR}/config.c" @ONLY)
set (TEST_SOURCES $<TARGET_OBJECTS:cframework> ${ARG_OBJECT_SOURCES})
list (APPEND TEST_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/test_testapp.c")
add_headers (TEST_SOURCES)
add_testheaders (TEST_SOURCES)
add_executable (test_elektra-specload-testapp ${TEST_SOURCES})
target_link_elektra (test_elektra-specload-testapp elektra-core elektra-invoke)
target_include_directories (test_elektra-specload-testapp PRIVATE "${CMAKE_SOURCE_DIR}/tests/cframework")
target_include_directories (test_elektra-specload-testapp PRIVATE "${CMAKE_CURRENT_BINARY_DIR}")
add_test (
NAME test_elektra-specload-testapp
COMMAND "${CMAKE_BINARY_DIR}/bin/test_elektra-specload-testapp" "${CMAKE_CURRENT_SOURCE_DIR}"
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
set_tests_properties (test_elektra-specload-testapp PROPERTIES TIMEOUT 30)
set_property (TEST test_elektra-specload-testapp PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib"
"KDB_TEST_BIN_DIR=${CMAKE_BINARY_DIR}/bin")
add_plugintest (
specload INSTALL_TEST_DATA
INCLUDE_DIRECTORIES ${CMAKE_CURRENT_BINARY_DIR} EXTRA_EXECUTABLES elektra-specload-testapp
TIMEOUT 120)
if (BUILD_SHARED)
add_dependencies (elektra-specload-testapp elektra-quickdump)
if (NOT ENABLE_ASAN)
add_dependencies (test_elektra-specload-testapp elektra-specload-testapp)
endif (NOT ENABLE_ASAN)
add_dependencies (testmod_specload elektra-specload-testapp)
endif (BUILD_SHARED)
endif (ADDTESTING_PHASE)