mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-25 06:59:01 +08:00
128 lines
4.3 KiB
Diff
128 lines
4.3 KiB
Diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
index 6d3a4c2..da3bfc5 100644
|
|
--- a/CMakeLists.txt
|
|
+++ b/CMakeLists.txt
|
|
@@ -7,7 +7,7 @@ if(CMAKE_VERSION VERSION_LESS 3.7)
|
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/3.7")
|
|
endif()
|
|
|
|
-find_package(GLib2 REQUIRED)
|
|
+find_package(unofficial-glib CONFIG REQUIRED)
|
|
|
|
# Configuration and utility functions
|
|
include(lcm-cmake/config.cmake NO_POLICY_SCOPE)
|
|
@@ -22,6 +22,11 @@ if (WIN32)
|
|
include_directories(${lcm_SOURCE_DIR})
|
|
add_subdirectory(WinSpecific)
|
|
set(lcm-winport lcm-winport)
|
|
+ if(CMAKE_BUILD_TYPE STREQUAL Debug)
|
|
+ get_target_property(GLIB2_GLIB_RUNTIME unofficial::glib::glib IMPORTED_LOCATION_DEBUG)
|
|
+ elseif(CMAKE_BUILD_TYPE STREQUAL Release)
|
|
+ get_target_property(GLIB2_GLIB_RUNTIME unofficial::glib::glib IMPORTED_LOCATION_RELEASE)
|
|
+ endif()
|
|
get_filename_component(LCM_LCMGEN_PATH ${GLIB2_GLIB_RUNTIME} DIRECTORY)
|
|
set(LCM_USE_GLIB_RUNTIME "set(LCM_LCMGEN_PATH \"${LCM_LCMGEN_PATH}\")")
|
|
else()
|
|
diff --git a/lcm-logger/CMakeLists.txt b/lcm-logger/CMakeLists.txt
|
|
index 9aee9df..253af08 100644
|
|
--- a/lcm-logger/CMakeLists.txt
|
|
+++ b/lcm-logger/CMakeLists.txt
|
|
@@ -1,9 +1,9 @@
|
|
add_executable(lcm-logger lcm_logger.c glib_util.c)
|
|
-target_link_libraries(lcm-logger
|
|
- lcm
|
|
- ${lcm-winport}
|
|
- GLib2::glib
|
|
-)
|
|
+if(WIN32)
|
|
+ target_link_libraries(lcm-logger lcm ${lcm-winport} unofficial::glib::glib ws2_32)
|
|
+else()
|
|
+ target_link_libraries(lcm-logger lcm ${lcm-winport} unofficial::glib::glib)
|
|
+endif()
|
|
|
|
add_executable(lcm-logplayer lcm_logplayer.c)
|
|
target_link_libraries(lcm-logplayer lcm ${lcm-winport})
|
|
diff --git a/lcm/CMakeLists.txt b/lcm/CMakeLists.txt
|
|
index 639ec12..9da0c00 100644
|
|
--- a/lcm/CMakeLists.txt
|
|
+++ b/lcm/CMakeLists.txt
|
|
@@ -60,10 +60,11 @@ foreach(lcm_lib lcm lcm-static)
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
|
|
)
|
|
|
|
- target_link_libraries(${lcm_lib} PRIVATE
|
|
- GLib2::glib
|
|
- ${CMAKE_THREAD_LIBS_INIT}
|
|
- )
|
|
+ if(WIN32)
|
|
+ target_link_libraries(${lcm_lib} PRIVATE unofficial::glib::glib ${CMAKE_THREAD_LIBS_INIT} ws2_32)
|
|
+ else()
|
|
+ target_link_libraries(${lcm_lib} PRIVATE unofficial::glib::glib ${CMAKE_THREAD_LIBS_INIT})
|
|
+ endif()
|
|
endforeach()
|
|
|
|
generate_export_header(lcm STATIC_DEFINE LCM_STATIC)
|
|
diff --git a/lcmgen/CMakeLists.txt b/lcmgen/CMakeLists.txt
|
|
index 29354bb..d848b16 100644
|
|
--- a/lcmgen/CMakeLists.txt
|
|
+++ b/lcmgen/CMakeLists.txt
|
|
@@ -43,7 +43,11 @@ if(_uses_sanitizers AND NOT LCM_SANITIZE_LCMGEN)
|
|
endif()
|
|
|
|
add_executable(lcm-gen ${lcm-gen_sources})
|
|
-target_link_libraries(lcm-gen PRIVATE GLib2::glib)
|
|
+if(WIN32)
|
|
+ target_link_libraries(lcm-gen PRIVATE unofficial::glib::glib ws2_32)
|
|
+else()
|
|
+ target_link_libraries(lcm-gen PRIVATE unofficial::glib::glib)
|
|
+endif()
|
|
|
|
install(TARGETS lcm-gen
|
|
EXPORT lcmTargets
|
|
diff --git a/liblcm-test/CMakeLists.txt b/liblcm-test/CMakeLists.txt
|
|
index bb24675..da041d9 100644
|
|
--- a/liblcm-test/CMakeLists.txt
|
|
+++ b/liblcm-test/CMakeLists.txt
|
|
@@ -5,7 +5,11 @@ add_executable(lcm-source lcm-source.c)
|
|
target_link_libraries(lcm-source lcm ${lcm-winport})
|
|
|
|
add_executable(lcm-tester lcm-tester.c)
|
|
-target_link_libraries(lcm-tester lcm GLib2::glib)
|
|
+if(WIN32)
|
|
+ target_link_libraries(lcm-tester lcm unofficial::glib::glib ws2_32)
|
|
+else()
|
|
+ target_link_libraries(lcm-tester lcm unofficial::glib::glib)
|
|
+endif()
|
|
|
|
add_executable(lcm-example lcm-example.c)
|
|
target_link_libraries(lcm-example lcm)
|
|
@@ -14,13 +18,25 @@ if(WIN32)
|
|
endif()
|
|
|
|
add_executable(lcm-logfilter lcm-logfilter.c)
|
|
-target_link_libraries(lcm-logfilter lcm ${lcm-winport} GLib2::glib)
|
|
+if(WIN32)
|
|
+ target_link_libraries(lcm-logfilter lcm ${lcm-winport} unofficial::glib::glib ws2_32)
|
|
+else()
|
|
+ target_link_libraries(lcm-logfilter lcm ${lcm-winport} unofficial::glib::glib)
|
|
+endif()
|
|
|
|
add_executable(lcm-buftest-receiver buftest-receiver.c)
|
|
-target_link_libraries(lcm-buftest-receiver lcm GLib2::glib)
|
|
+if(WIN32)
|
|
+ target_link_libraries(lcm-buftest-receiver lcm unofficial::glib::glib ws2_32)
|
|
+else()
|
|
+ target_link_libraries(lcm-buftest-receiver lcm unofficial::glib::glib)
|
|
+endif()
|
|
|
|
add_executable(lcm-buftest-sender buftest-sender.c)
|
|
-target_link_libraries(lcm-buftest-sender lcm GLib2::glib)
|
|
+if(WIN32)
|
|
+ target_link_libraries(lcm-buftest-sender lcm unofficial::glib::glib ws2_32)
|
|
+else()
|
|
+ target_link_libraries(lcm-buftest-sender lcm unofficial::glib::glib)
|
|
+endif()
|
|
|
|
install(TARGETS
|
|
lcm-sink
|