CMake: Use common function for adding samples, tests and demos

This commit is contained in:
Maarten Bent
2021-01-16 01:33:55 +01:00
parent 4a3ff8c180
commit 226a3de596
7 changed files with 112 additions and 186 deletions

View File

@@ -8,12 +8,6 @@
#############################################################################
add_subdirectory(base)
# Build GUI tests
if(wxUSE_GUI AND wxBUILD_TESTS STREQUAL "ALL")
add_subdirectory(drawing)
add_subdirectory(gui)
add_subdirectory(headers)
endif()

View File

@@ -117,14 +117,12 @@ set(TEST_DATA
testdata.fc
)
wx_add_test(test_base ${TEST_SRC}
wx_add_test(test_base CONSOLE ${TEST_SRC}
DATA ${TEST_DATA}
)
target_compile_definitions(test_base PRIVATE wxUSE_GUI=0 wxUSE_BASE=1)
if(wxUSE_SOCKETS)
wx_exe_link_libraries(test_base wxnet)
endif()
if(wxUSE_XML)
wx_exe_link_libraries(test_base wxxml)
endif()
wx_test_enable_precomp(test_base)

View File

@@ -43,8 +43,6 @@ wx_add_test(test_drawing ${TEST_DRAWING_SRC}
if(wxUSE_SOCKETS)
wx_exe_link_libraries(test_drawing wxnet)
endif()
wx_exe_link_libraries(test_drawing wxcore)
wx_test_enable_precomp(test_drawing)
# This is a sample plugin, it simply uses a wxImage based
# wxGraphicsContext. It should render the same as the built-in test. Use

View File

@@ -182,9 +182,7 @@ set(TEST_GUI_DATA
wx_add_test(test_gui ${TEST_GUI_SRC}
DATA ${TEST_GUI_DATA}
RES ../samples/sample.rc
)
wx_exe_link_libraries(test_gui wxcore)
if(wxUSE_AUI)
wx_exe_link_libraries(test_gui wxaui)
endif()
@@ -212,4 +210,3 @@ endif()
if(wxUSE_WEBVIEW)
wx_exe_link_libraries(test_gui wxwebview)
endif()
wx_test_enable_precomp(test_gui)

View File

@@ -18,8 +18,6 @@ set(TEST_SRC
)
wx_add_test(test_headers ${TEST_SRC})
wx_exe_link_libraries(test_headers wxcore)
if(wxUSE_SOCKETS)
wx_exe_link_libraries(test_headers wxnet)
endif()
wx_test_enable_precomp(test_headers)