hiep fix
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(xmlrpcpp)
|
||||
project(robot_xmlrpcpp)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
@@ -9,7 +9,7 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
add_compile_options(-Wall -Wextra -Wpedantic -fPIC)
|
||||
endif()
|
||||
|
||||
add_library(xmlrpcpp
|
||||
add_library(robot_xmlrpcpp
|
||||
src/XmlRpcClient.cpp
|
||||
src/XmlRpcDispatch.cpp
|
||||
src/XmlRpcServer.cpp
|
||||
@@ -21,15 +21,15 @@ add_library(xmlrpcpp
|
||||
src/XmlRpcValue.cpp
|
||||
)
|
||||
|
||||
target_include_directories(xmlrpcpp
|
||||
target_include_directories(robot_xmlrpcpp
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:include/${PROJECT_NAME}>
|
||||
)
|
||||
|
||||
# --- Cài đặt thư viện vào hệ thống khi chạy make install ---
|
||||
install(TARGETS xmlrpcpp
|
||||
EXPORT xmlrpcpp-targets
|
||||
install(TARGETS robot_xmlrpcpp
|
||||
EXPORT robot_xmlrpcpp-targets
|
||||
ARCHIVE DESTINATION lib # Thư viện tĩnh .a
|
||||
LIBRARY DESTINATION lib # Thư viện động .so
|
||||
RUNTIME DESTINATION bin # File thực thi (nếu có)
|
||||
@@ -41,13 +41,13 @@ install(
|
||||
DESTINATION include/
|
||||
)
|
||||
|
||||
# --- Xuất export set xmlrpcpp-targets thành file CMake module ---
|
||||
# --- Tạo file lib/cmake/xmlrpcpp/xmlrpcpp-targets.cmake ---
|
||||
# --- Xuất export set robot_xmlrpcpp-targets thành file CMake module ---
|
||||
# --- Tạo file lib/cmake/robot_xmlrpcpp/robot_xmlrpcpp-targets.cmake ---
|
||||
# --- File này chứa cấu hình giúp project khác có thể dùng ---
|
||||
# --- Find_package(xmlrpcpp REQUIRED) ---
|
||||
# --- Target_link_libraries(my_app PRIVATE xmlrpcpp::xmlrpcpp) ---
|
||||
install(EXPORT xmlrpcpp-targets
|
||||
FILE xmlrpcpp-targets.cmake
|
||||
NAMESPACE xmlrpcpp::
|
||||
DESTINATION lib/cmake/xmlrpcpp
|
||||
# --- Find_package(robot_xmlrpcpp REQUIRED) ---
|
||||
# --- Target_link_libraries(my_app PRIVATE robot_xmlrpcpp::robot_xmlrpcpp) ---
|
||||
install(EXPORT robot_xmlrpcpp-targets
|
||||
FILE robot_xmlrpcpp-targets.cmake
|
||||
NAMESPACE robot_xmlrpcpp::
|
||||
DESTINATION lib/cmake/robot_xmlrpcpp
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user