From f7680c696d3b62cbd289ff255a6d636eab7e096c Mon Sep 17 00:00:00 2001 From: Kornel Benko Date: Sun, 21 Oct 2012 16:58:45 +0200 Subject: [PATCH] Cmake build: Added dependencies to target `test'. Now all the needed executables are recreated prior to running tests if not already existant. --- CMakeLists.txt | 6 ++++++ src/CMakeLists.txt | 3 +-- src/client/CMakeLists.txt | 2 +- src/support/tests/CMakeLists.txt | 4 ++-- src/tex2lyx/CMakeLists.txt | 2 +- src/tex2lyx/test/CMakeLists.txt | 3 +++ 6 files changed, 14 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b5bb34667a..1e0b9c3ef2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -492,6 +492,12 @@ if(LYX_NLS) endif() endif() +if(LYX_EXTERNAL_LIBINTL) + set(intl_link ${LIBINTL_LIBRARIES}) +else() + set(intl_link intl) +endif() + find_package(ICONV REQUIRED) find_package(ZLIB REQUIRED) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5862136f01..b5a9a29fa6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -126,12 +126,11 @@ target_link_libraries(${_lyx} frontend_qt4 graphics support - ${LIBINTL_LIBRARIES} + ${intl_link} ${ICONV_LIBRARY} ${QT_QTMAIN_LIBRARY} ${vld_dll}) - if(HUNSPELL_FOUND) target_link_libraries(${_lyx} ${HUNSPELL_LIBRARY}) endif() diff --git a/src/client/CMakeLists.txt b/src/client/CMakeLists.txt index 6fe918ce1e..3302437809 100644 --- a/src/client/CMakeLists.txt +++ b/src/client/CMakeLists.txt @@ -29,7 +29,7 @@ add_executable(${_lyxclient} ${_lyxclient_sources} ${_lyxclient_headers}) target_link_libraries(${_lyxclient} support ${Lyx_Boost_Libraries} - ${LIBINTL_LIBRARIES} + ${intl_link} ${ICONV_LIBRARY} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY}) diff --git a/src/support/tests/CMakeLists.txt b/src/support/tests/CMakeLists.txt index 7a25e2ad45..d464c2a63e 100644 --- a/src/support/tests/CMakeLists.txt +++ b/src/support/tests/CMakeLists.txt @@ -13,9 +13,9 @@ macro(sources _program) endforeach() set(${_program}_SOURCES ${_tmplist}) add_executable(${_program} ${_tmplist}) - target_link_libraries(${_program} support + target_link_libraries(${_program} support ${intl_link} ${Lyx_Boost_Libraries} ${QT_QTGUI_LIBRARY} ${QT_QTCORE_LIBRARY} - ${ZLIB_LIBRARY} ${LIBINTL_LIBRARIES} ${ICONV_LIBRARY}) + ${ZLIB_LIBRARY} ${ICONV_LIBRARY}) endmacro() file(GLOB test_sources ${TOP_SRC_DIR}/src/support/tests/${LYX_CPP_FILES}) diff --git a/src/tex2lyx/CMakeLists.txt b/src/tex2lyx/CMakeLists.txt index 1952a81251..496cbdd053 100644 --- a/src/tex2lyx/CMakeLists.txt +++ b/src/tex2lyx/CMakeLists.txt @@ -50,7 +50,7 @@ target_link_libraries(${_tex2lyx} ${Lyx_Boost_Libraries} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} - ${LIBINTL_LIBRARIES} + ${intl_link} ${ICONV_LIBRARY}) if(WIN32) diff --git a/src/tex2lyx/test/CMakeLists.txt b/src/tex2lyx/test/CMakeLists.txt index e85222f070..365d953f69 100644 --- a/src/tex2lyx/test/CMakeLists.txt +++ b/src/tex2lyx/test/CMakeLists.txt @@ -34,6 +34,8 @@ ADD_CUSTOM_COMMAND( add_test(NAME build_tex2lyx COMMAND "${CMAKE_COMMAND}" --build ${CMAKE_BINARY_DIR} --target ${_tex2lyx}) +add_test(NAME build_lyx + COMMAND "${CMAKE_COMMAND}" --build ${CMAKE_BINARY_DIR} --target ${_lyx}) add_test(NAME roundtrip_tex2lyx WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" COMMAND ${LYX_PYTHON_EXECUTABLE} "${TOP_SRC_DIR}/src/tex2lyx/test/runtests.py" @@ -41,5 +43,6 @@ add_test(NAME roundtrip_tex2lyx "${TOP_SRC_DIR}/lib/scripts" "${CMAKE_CURRENT_BINARY_DIR}") +set_tests_properties(build_tex2lyx PROPERTIES DEPENDS build_lyx) set_tests_properties(roundtrip_tex2lyx PROPERTIES DEPENDS build_tex2lyx)