1 # This file is part of LyX, the document processor.
2 # Licence details can be found in the file COPYING.
4 # Copyright (c) 2013 Kornel Benko kornel@lyx.org
7 set(check_layout_SOURCES)
8 foreach(_f insets/InsetLayout.cpp Color.cpp Counters.cpp Floating.cpp
9 FloatList.cpp FontInfo.cpp Layout.cpp LayoutFile.cpp Lexer.cpp
10 ModuleList.cpp Spacing.cpp TextClass.cpp tests/check_layout.cpp
11 support/tests/boost.cpp support/tests/dummy_functions.cpp)
12 list(APPEND check_layout_SOURCES "${TOP_SRC_DIR}/src/${_f}")
15 add_definitions(-DNO_LAYOUT_CSS)
16 add_executable(check_layout ${check_layout_SOURCES})
18 if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
19 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--allow-multiple-definition")
21 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /FORCE:MULTIPLE")
23 message(STATUS "Allow multiple definitions for cxx-compiler ${CMAKE_CXX_COMPILER_ID} not handled")
26 target_link_libraries(check_layout support ${QT_QTMAIN_LIBRARY} ${intl_link})
27 add_dependencies(lyx_run_tests check_layout)
28 set_target_properties(check_layout PROPERTIES FOLDER "tests/src")
30 file(GLOB layout_files RELATIVE "${TOP_SRC_DIR}/lib/layouts" "${TOP_SRC_DIR}/lib/layouts/*.layout")
31 list(SORT layout_files)
32 foreach(bns ${layout_files})
33 string(REPLACE ".layout" "" bn ${bns})
35 add_test(NAME "check_layout/${bns}"
36 COMMAND check_layout "${TOP_SRC_DIR}/lib/layouts/${bn}")