[Spice-devel] [vdagent-win PATCH 13/13] build: Base cmake support
Frediano Ziglio
fziglio at redhat.com
Mon May 28 08:58:06 UTC 2018
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
CMakeLists.txt | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
Makefile.am | 3 ++-
2 files changed, 50 insertions(+), 1 deletion(-)
create mode 100644 CMakeLists.txt
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..c4b8b95
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,48 @@
+cmake_minimum_required(VERSION 2.6)
+
+# TODO missing libpng flags
+# EXPERIMENTAL
+#set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
+
+set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static -s")
+
+find_package(PNG REQUIRED)
+
+include_directories(common . spice-protocol ${PNG_INCLUDE_DIR})
+add_definitions(-DUNICODE -D_UNICODE -DOLDMSVCRT)
+add_executable(vdagent
+ common/vdcommon.cpp
+ common/vdcommon.h
+ common/vdlog.cpp
+ common/vdlog.h
+ vdagent/display_configuration.cpp
+ vdagent/display_configuration.h
+ vdagent/desktop_layout.cpp
+ vdagent/desktop_layout.h
+ vdagent/display_setting.cpp
+ vdagent/display_setting.h
+ vdagent/file_xfer.cpp
+ vdagent/file_xfer.h
+ vdagent/vdagent.cpp
+ vdagent/as_user.cpp
+ vdagent/as_user.h
+ vdagent/image.cpp
+ vdagent/image.h
+ vdagent/imagepng.cpp
+ vdagent/imagepng.h
+ vdagent/vdagent.rc
+)
+target_link_libraries(vdagent ${PNG_LIBRARY} ${ZLIB_LIBRARY} wtsapi32)
+set_target_properties(vdagent PROPERTIES LINK_FLAGS -mwindows)
+
+add_executable(vdservice
+ common/stdint.h
+ common/vdcommon.cpp
+ common/vdcommon.h
+ common/vdlog.cpp
+ common/vdlog.h
+ vdservice/vdservice.cpp
+ vdservice/vdservice.rc
+)
+target_link_libraries(vdservice wtsapi32)
+set_target_properties(vdservice PROPERTIES LINK_FLAGS -mconsole)
diff --git a/Makefile.am b/Makefile.am
index 3020824..79f6951 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -129,7 +129,8 @@ EXTRA_DIST += \
vdagent/vdagent.vcproj \
vdservice/resource.h \
vdservice/vdservice.rc \
- vdservice/vdservice.vcproj
+ vdservice/vdservice.vcproj \
+ CMakeLists.txt
# see git-version-gen
dist-hook:
--
2.17.0
More information about the Spice-devel
mailing list