commit 1b0cbb6932376821ba1848bedcfad476bddb294d
Author: Enrico Forestieri <for...@lyx.org>
Date:   Fri Dec 26 17:00:23 2014 +0100

    Fix building with cmake on cygwin.
    
    Add required libraries for the link stage.

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 31b5bfd..c15f098 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 926eebc..f1e51a2 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 2d19989..4e1ff5d 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 52ca1e3..a32499b 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 38ae574..09bcc2b 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()

Reply via email to