@@ -100,6 +100,7 @@ if (BUILD_SHARED_LIBS AND WIN32 AND HTTPLIB_COMPILE)
100
100
endif ()
101
101
102
102
# Threads needed for <thread> on some systems, and for <pthread.h> on Linux
103
+ set (THREADS_PREFER_PTHREAD_FLAG true )
103
104
find_package (Threads REQUIRED)
104
105
# Since Cmake v3.11, Crypto & SSL became optional when not specified as COMPONENTS.
105
106
if (HTTPLIB_REQUIRE_OPENSSL)
@@ -160,7 +161,7 @@ if(HTTPLIB_COMPILE)
160
161
ERROR_VARIABLE _httplib_split_error
161
162
)
162
163
if (_httplib_split_error)
163
- message (FATAL_ERROR "Failed when trying to split Cpp -httplib with the Python script.\n ${_httplib_split_error} " )
164
+ message (FATAL_ERROR "Failed when trying to split cpp -httplib with the Python script.\n ${_httplib_split_error} " )
164
165
endif ()
165
166
166
167
# split.py puts output in "out"
@@ -187,19 +188,9 @@ endif()
187
188
# Only useful if building in-tree, versus using it from an installation.
188
189
add_library (${PROJECT_NAME} ::${PROJECT_NAME} ALIAS ${PROJECT_NAME} )
189
190
190
- # Might be missing some, but this list is somewhat comprehensive
191
+ # Require C++11
191
192
target_compile_features (${PROJECT_NAME} ${_INTERFACE_OR_PUBLIC}
192
193
cxx_std_11
193
- cxx_nullptr
194
- cxx_lambdas
195
- cxx_override
196
- cxx_defaulted_functions
197
- cxx_attribute_deprecated
198
- cxx_auto_type
199
- cxx_decltype
200
- cxx_deleted_functions
201
- cxx_range_for
202
- cxx_sizeof_member
203
194
)
204
195
205
196
target_include_directories (${PROJECT_NAME} ${_INTERFACE_OR_PUBLIC}
@@ -274,11 +265,9 @@ endif()
274
265
# and linkage information (doesn't find deps though).
275
266
install (TARGETS ${PROJECT_NAME}
276
267
EXPORT httplibTargets
277
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
278
- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
279
268
)
280
269
281
- install (FILES "${_httplib_build_includedir} /httplib.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} )
270
+ install (FILES "${_httplib_build_includedir} /httplib.h" TYPE INCLUDE )
282
271
283
272
install (FILES
284
273
"${CMAKE_CURRENT_BINARY_DIR} /${PROJECT_NAME} Config.cmake"
0 commit comments