@@ -104,24 +104,6 @@ if (NOT CPPKAFKA_PKGCONFIG_DIR)
104
104
set (CPPKAFKA_PKGCONFIG_DIR share/pkgconfig)
105
105
endif ()
106
106
107
- # Look for Boost (just need boost.optional headers here)
108
- find_package (Boost REQUIRED ${FIND_PACKAGE_QUIET} )
109
-
110
- if (Boost_FOUND)
111
- find_package (Boost COMPONENTS program_options ${FIND_PACKAGE_QUIET} )
112
- set (Boost_USE_STATIC_LIBS ${CPPKAFKA_BOOST_STATIC_LIBS} )
113
- set (Boost_USE_MULTITHREADED ${CPPKAFKA_BOOST_USE_MULTITHREADED} )
114
- include_directories (${Boost_INCLUDE_DIRS} )
115
- link_directories (${Boost_LIBRARY_DIRS} )
116
- if (CPPKAFKA_CMAKE_VERBOSE)
117
- message (STATUS "Boost include dir: ${Boost_INCLUDE_DIRS} " )
118
- message (STATUS "Boost library dir: ${Boost_LIBRARY_DIRS} " )
119
- message (STATUS "Boost use static libs: ${Boost_USE_STATIC_LIBS} " )
120
- message (STATUS "Boost is multi-threaded: ${CPPKAFKA_BOOST_USE_MULTITHREADED} " )
121
- message (STATUS "Boost libraries: ${Boost_LIBRARIES} " )
122
- endif ()
123
- endif ()
124
-
125
107
# Try to find the RdKafka configuration file if present.
126
108
# This will search default system locations as well as RdKafka_ROOT and RdKafka_Dir paths if specified.
127
109
find_package (RdKafka ${FIND_PACKAGE_QUIET} CONFIG)
@@ -142,10 +124,28 @@ add_subdirectory(src)
142
124
add_subdirectory (include /cppkafka)
143
125
144
126
# Examples target
145
- if (NOT CPPKAFKA_DISABLE_EXAMPLES AND Boost_PROGRAM_OPTIONS_FOUND)
146
- add_subdirectory (examples)
147
- else ()
148
- message (STATUS "Disabling examples" )
127
+ if (NOT CPPKAFKA_DISABLE_EXAMPLES)
128
+ # Look for Boost (just need boost.optional headers here)
129
+ find_package (Boost ${FIND_PACKAGE_QUIET} CONFIG)
130
+ if (Boost_FOUND)
131
+ option (CPPKAFKA_BOOST_STATIC_LIBS "Link with Boost static libraries." ON )
132
+ option (CPPKAFKA_BOOST_USE_MULTITHREADED "Use Boost multithreaded libraries." ON )
133
+ find_package (Boost COMPONENTS program_options ${FIND_PACKAGE_QUIET} )
134
+ set (Boost_USE_STATIC_LIBS ${CPPKAFKA_BOOST_STATIC_LIBS} )
135
+ set (Boost_USE_MULTITHREADED ${CPPKAFKA_BOOST_USE_MULTITHREADED} )
136
+ include_directories (${Boost_INCLUDE_DIRS} )
137
+ link_directories (${Boost_LIBRARY_DIRS} )
138
+ if (CPPKAFKA_CMAKE_VERBOSE)
139
+ message (STATUS "Boost include dir: ${Boost_INCLUDE_DIRS} " )
140
+ message (STATUS "Boost library dir: ${Boost_LIBRARY_DIRS} " )
141
+ message (STATUS "Boost use static libs: ${Boost_USE_STATIC_LIBS} " )
142
+ message (STATUS "Boost is multi-threaded: ${CPPKAFKA_BOOST_USE_MULTITHREADED} " )
143
+ message (STATUS "Boost libraries: ${Boost_LIBRARIES} " )
144
+ endif ()
145
+ add_subdirectory (examples)
146
+ else ()
147
+ message (STATUS "Disabling examples" )
148
+ endif ()
149
149
endif ()
150
150
151
151
# Add a target to generate API documentation using Doxygen
0 commit comments