From 1b0cbb6932376821ba1848bedcfad476bddb294d Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Fri, 26 Dec 2014 17:00:23 +0100 Subject: [PATCH] Fix building with cmake on cygwin. Add required libraries for the link stage. --- src/CMakeLists.txt | 4 ++++ src/client/CMakeLists.txt | 4 ++++ src/support/tests/CMakeLists.txt | 3 +++ src/tests/CMakeLists.txt | 3 +++ src/tex2lyx/CMakeLists.txt | 4 ++++ 5 files changed, 18 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 31b5bfd32f..c15f09852b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -149,6 +149,10 @@ if(MINGW) target_link_libraries(${_lyx} ole32) endif() +if(CYGWIN) + target_link_libraries(${_lyx} gdi32 shlwapi ole32) +endif() + project_source_group("${GROUP_CODE}" lyx_sources lyx_headers) install(TARGETS ${_lyx} diff --git a/src/client/CMakeLists.txt b/src/client/CMakeLists.txt index 926eebc436..f1e51a2e50 100644 --- a/src/client/CMakeLists.txt +++ b/src/client/CMakeLists.txt @@ -38,5 +38,9 @@ if(APPLE) target_link_libraries(${_lyxclient} "-framework AppKit") endif() +if(CYGWIN) + target_link_libraries(${_lyxclient} shlwapi) +endif() + install(TARGETS ${_lyxclient} DESTINATION ${LYX_UTILITIES_INSTALL_PATH}) diff --git a/src/support/tests/CMakeLists.txt b/src/support/tests/CMakeLists.txt index 2d1998927f..4e1ff5d4e6 100644 --- a/src/support/tests/CMakeLists.txt +++ b/src/support/tests/CMakeLists.txt @@ -17,6 +17,9 @@ macro(sources _program) ${Lyx_Boost_Libraries} ${QT_QTGUI_LIBRARY} ${QT_QTCORE_LIBRARY} ${ZLIB_LIBRARY} ${ICONV_LIBRARY}) lyx_target_link_libraries(${_program} Magic) + if(CYGWIN) + target_link_libraries(${_program} shlwapi) + endif() endmacro() file(GLOB test_sources ${TOP_SRC_DIR}/src/support/tests/${LYX_CPP_FILES}) diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 52ca1e3ff0..a32499bf55 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -19,6 +19,9 @@ add_executable(check_layout ${check_layout_SOURCES}) target_link_libraries(check_layout support ${Lyx_Boost_Libraries} ${QT_QTGUI_LIBRARY} ${QT_QTCORE_LIBRARY} ${ZLIB_LIBRARY} ${ICONV_LIBRARY}) +if(CYGWIN) + target_link_libraries(check_layout shlwapi) +endif() lyx_target_link_libraries(check_layout Magic) add_dependencies(lyx_run_tests check_layout) diff --git a/src/tex2lyx/CMakeLists.txt b/src/tex2lyx/CMakeLists.txt index 38ae574c31..09bcc2bf36 100644 --- a/src/tex2lyx/CMakeLists.txt +++ b/src/tex2lyx/CMakeLists.txt @@ -58,6 +58,10 @@ if(WIN32) target_link_libraries(${_tex2lyx} shlwapi ole32 psapi) endif() +if(CYGWIN) + target_link_libraries(${_tex2lyx} shlwapi ole32) +endif() + if(APPLE) target_link_libraries(${_tex2lyx} "-framework AppKit") endif()