LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File dynamic_library_build.diff of Package tidy (Project devel:tools)

---
 CMakeLists.txt |   22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

Index: tidy-html5-5.6.0/CMakeLists.txt
===================================================================
--- tidy-html5-5.6.0.orig/CMakeLists.txt
+++ tidy-html5-5.6.0/CMakeLists.txt
@@ -75,15 +75,15 @@ endif ()
 #   shared library can be turned off if not needed. The console program
 #   can be configured for static linking or dynamic linking.
 #------------------------------------------------------------------------
-set( LIB_TYPE STATIC )  # set default message
+option( BUILD_STATIC_LIBS "Set ON to build static library"         ON )
 
-option( BUILD_SHARED_LIB "Set OFF to NOT build shared library"     ON  )
+option( BUILD_SHARED_LIBS "Set OFF to NOT build shared library"     ON  )
 
 # Issue #326 - Allow linkage choice of console app tidy
-option( TIDY_CONSOLE_SHARED "Set ON to link with shared(DLL) lib." OFF )
+option( TIDY_CONSOLE_SHARED "Set OFF to link with static lib." ON )
 
 if (TIDY_CONSOLE_SHARED)
-    if (NOT BUILD_SHARED_LIB)
+    if (NOT BUILD_SHARED_LIBS)
         message(FATAL_ERROR "Enable shared build for this tidy linkage!")
     endif ()
 endif ()
@@ -310,7 +310,7 @@ endif ()
 # Shared Library
 #   Setup whether or not we will build the shared library.
 #------------------------------------------------------------------------
-if(BUILD_SHARED_LIB)
+if(BUILD_SHARED_LIBS)
    set(LIB_TYPE SHARED)
    message(STATUS "*** Also building DLL library ${LIB_TYPE}, version ${LIBTIDY_VERSION}, date ${LIBTIDY_DATE}")
 else()
@@ -379,28 +379,30 @@ endif ()
 
 #------------------------------------------------------------------------
 # Static Library
-#   The static library always builds.
 #------------------------------------------------------------------------
+if (BUILD_STATIC_LIBS)
 set(name tidy-static)
 add_library ( ${name} STATIC ${CFILES} ${HFILES} ${LIBHFILES} )
 set_target_properties( ${name} PROPERTIES 
                        OUTPUT_NAME ${LIB_NAME}s )
-if (NOT TIDY_CONSOLE_SHARED) # user wants default static linkage
+if (NOT TIDY_CONSOLE_SHARED) # user wants static linkage
     list ( APPEND add_LIBS ${name} )
 endif ()    
 install(TARGETS ${name}
-        RUNTIME DESTINATION ${BIN_INSTALL_DIR}
         ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
         LIBRARY DESTINATION ${LIB_INSTALL_DIR}
         )
+endif()
+install(TARGETS ${name}
+        RUNTIME DESTINATION ${BIN_INSTALL_DIR}
+        )
 install( FILES ${HFILES} DESTINATION ${INCLUDE_INSTALL_DIR} )
 
 
 #------------------------------------------------------------------------
 # Dynamic Library
-#   If the user option is still on.
 #------------------------------------------------------------------------
-if (BUILD_SHARED_LIB)
+if (BUILD_SHARED_LIBS)
     set(name tidy-share)
     if (UNIX AND APPLE)
         set(CMAKE_MACOSX_RPATH 1)