0001-cmake-use-the-standard-CMake-flag-to-drive-the-share.patch 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. From 7e57ff280b55b45e74329b9988279e8831d32eab Mon Sep 17 00:00:00 2001
  2. From: Samuel Martin <s.martin49@gmail.com>
  3. Date: Sun, 25 Jan 2015 09:45:04 +0100
  4. Subject: [PATCH] cmake: use the standard CMake flag to drive the shared
  5. object build
  6. Remove the STATICLIBS CMake option (and the code handling it) and let
  7. the standard CMake flags drive the shared object build.
  8. Signed-off-by: Samuel Martin <s.martin49@gmail.com>
  9. [Fabrice: update for 1.5]
  10. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  11. ---
  12. CMakeOptions.txt | 1 -
  13. ftdipp/CMakeLists.txt | 14 +-------------
  14. src/CMakeLists.txt | 13 +------------
  15. 3 files changed, 2 insertions(+), 26 deletions(-)
  16. diff --git a/CMakeOptions.txt b/CMakeOptions.txt
  17. index 07b5887..b780ffd 100644
  18. --- a/CMakeOptions.txt
  19. +++ b/CMakeOptions.txt
  20. @@ -1,4 +1,3 @@
  21. -option ( STATICLIBS "Build static libraries" ON )
  22. option ( BUILD_TESTS "Build unit tests with Boost Unit Test framework" OFF )
  23. option ( DOCUMENTATION "Generate API documentation with Doxygen" OFF )
  24. option ( EXAMPLES "Build example programs" ON )
  25. diff --git a/ftdipp/CMakeLists.txt b/ftdipp/CMakeLists.txt
  26. index fac5bcc..a06edf1 100644
  27. --- a/ftdipp/CMakeLists.txt
  28. +++ b/ftdipp/CMakeLists.txt
  29. @@ -12,7 +12,7 @@ include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}
  30. include_directories(${Boost_INCLUDE_DIRS})
  31. # Shared library
  32. -add_library(ftdipp1 SHARED ${cpp_sources})
  33. +add_library(ftdipp1 ${cpp_sources})
  34. math(EXPR VERSION_FIXUP "${MAJOR_VERSION} + 1") # Compatibility with previous releases
  35. set_target_properties(ftdipp1 PROPERTIES VERSION ${VERSION_FIXUP}.${MINOR_VERSION}.0 SOVERSION 3)
  36. @@ -29,18 +29,6 @@ install ( TARGETS ftdipp1
  37. ARCHIVE DESTINATION lib${LIB_SUFFIX}
  38. )
  39. -# Static library
  40. -if ( STATICLIBS )
  41. - add_library(ftdipp1-static STATIC ${cpp_sources})
  42. - set_target_properties(ftdipp1-static PROPERTIES OUTPUT_NAME "ftdipp1")
  43. - set_target_properties(ftdipp1-static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
  44. -
  45. - install ( TARGETS ftdipp1-static
  46. - ARCHIVE DESTINATION lib${LIB_SUFFIX}
  47. - COMPONENT staticlibs
  48. - )
  49. -endif ()
  50. -
  51. install ( FILES ${cpp_headers}
  52. DESTINATION include/${PROJECT_NAME}
  53. COMPONENT headers
  54. diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
  55. index 17b3617..ae4fc61 100644
  56. --- a/src/CMakeLists.txt
  57. +++ b/src/CMakeLists.txt
  58. @@ -21,7 +21,7 @@ configure_file(ftdi_version_i.h.in "${CMAKE_CURRENT_BINARY_DIR}/ftdi_version_i.h
  59. set(c_sources ${CMAKE_CURRENT_SOURCE_DIR}/ftdi.c ${CMAKE_CURRENT_SOURCE_DIR}/ftdi_stream.c CACHE INTERNAL "List of c sources" )
  60. set(c_headers ${CMAKE_CURRENT_SOURCE_DIR}/ftdi.h CACHE INTERNAL "List of c headers" )
  61. -add_library(ftdi1 SHARED ${c_sources})
  62. +add_library(ftdi1 ${c_sources})
  63. math(EXPR VERSION_FIXUP "${MAJOR_VERSION} + 1") # Compatibility with previous releases
  64. set_target_properties(ftdi1 PROPERTIES VERSION ${VERSION_FIXUP}.${MINOR_VERSION}.0 SOVERSION 2)
  65. @@ -38,17 +38,6 @@ install ( TARGETS ftdi1
  66. ARCHIVE DESTINATION lib${LIB_SUFFIX}
  67. )
  68. -if ( STATICLIBS )
  69. - add_library(ftdi1-static STATIC ${c_sources})
  70. - target_link_libraries(ftdi1-static ${LIBUSB_LIBRARIES})
  71. - set_target_properties(ftdi1-static PROPERTIES OUTPUT_NAME "ftdi1")
  72. - set_target_properties(ftdi1-static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
  73. - install ( TARGETS ftdi1-static
  74. - ARCHIVE DESTINATION lib${LIB_SUFFIX}
  75. - COMPONENT staticlibs
  76. - )
  77. -endif ()
  78. -
  79. install ( FILES ${c_headers}
  80. DESTINATION include/${PROJECT_NAME}
  81. COMPONENT headers
  82. --
  83. 2.27.0