2022-02-07 17:35:25 +01:00
|
|
|
qt_wrap_cpp(test-projectfile_SRC testprojectfile.h ${CMAKE_SOURCE_DIR}/gui/projectfile.h)
|
2021-12-17 21:49:32 +01:00
|
|
|
add_custom_target(build-projectfile-deps SOURCES ${test-projectfile_SRC})
|
|
|
|
add_dependencies(gui-build-deps build-projectfile-deps)
|
|
|
|
add_executable(test-projectfile
|
|
|
|
${test-projectfile_SRC}
|
|
|
|
testprojectfile.cpp
|
|
|
|
${CMAKE_SOURCE_DIR}/gui/projectfile.cpp
|
|
|
|
)
|
|
|
|
target_include_directories(test-projectfile PRIVATE ${CMAKE_SOURCE_DIR}/gui ${CMAKE_SOURCE_DIR}/lib)
|
|
|
|
target_compile_definitions(test-projectfile PRIVATE SRCDIR="${CMAKE_CURRENT_SOURCE_DIR}")
|
2022-03-13 20:07:58 +01:00
|
|
|
target_link_libraries(test-projectfile ${QT_CORE_LIB} ${QT_TEST_LIB})
|
|
|
|
|
|
|
|
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
|
|
|
# Q_UNUSED() in generated code
|
|
|
|
target_compile_options_safe(test-projectfile -Wno-extra-semi-stmt)
|
2023-01-27 19:43:08 +01:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if (REGISTER_GUI_TESTS)
|
|
|
|
add_test(NAME test-projectfile COMMAND $<TARGET_FILE:test-projectfile>)
|
2022-03-13 20:07:58 +01:00
|
|
|
endif()
|