shadow/subsystem: fix windows build
authorBernhard Miklautz <bernhard.miklautz@thincast.com>
Mon, 29 Feb 2016 15:02:13 +0000 (16:02 +0100)
committerBernhard Miklautz <bernhard.miklautz@thincast.com>
Mon, 29 Feb 2016 15:02:13 +0000 (16:02 +0100)
* add dependency to freerdp-client
* add version information to freerdp-shadow-cli

server/shadow/CMakeLists.txt

index 13c0f48..aa1431a 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+# freerdp-shadow  library
+
 set(MODULE_NAME "freerdp-shadow")
 set(MODULE_PREFIX "FREERDP_SERVER_SHADOW")
 
-include_directories(${OPENSSL_INCLUDE_DIR})
-
 set(${MODULE_PREFIX}_SRCS
        shadow_client.c
        shadow_client.h
@@ -75,7 +75,6 @@ list(APPEND ${MODULE_PREFIX}_LIBS freerdp)
 list(APPEND ${MODULE_PREFIX}_LIBS freerdp-server)
 list(APPEND ${MODULE_PREFIX}_LIBS winpr)
 list(APPEND ${MODULE_PREFIX}_LIBS winpr-makecert-tool)
-
 list(APPEND ${MODULE_PREFIX}_LIBS rdtk)
 
 target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
@@ -108,6 +107,20 @@ elseif(APPLE AND NOT IOS)
        set(WITH_SHADOW_MAC 1)
 endif()
 
+if (WIN32)
+  set (RC_VERSION_MAJOR ${FREERDP_VERSION_MAJOR})
+  set (RC_VERSION_MINOR ${FREERDP_VERSION_MINOR})
+  set (RC_VERSION_BUILD ${FREERDP_VERSION_REVISION})
+  set (RC_VERSION_FILE "${MODULE_NAME}${CMAKE_EXECUTABLE_SUFFIX}" )
+
+  configure_file(
+    ${CMAKE_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in
+    ${CMAKE_CURRENT_BINARY_DIR}/version.rc
+    @ONLY)
+
+  set ( ${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
+endif()
+
 # Authentication
 
 if(WITH_SHADOW_X11 OR WITH_SHADOW_MAC)
@@ -219,13 +232,13 @@ if(WITH_SHADOW_X11)
                include_directories(${XRANDR_INCLUDE_DIRS})
                list(APPEND ${MODULE_PREFIX}_X11_LIBS ${XRANDR_LIBRARIES})
        endif()
-endif()
-
-if(WITH_SHADOW_MAC)
+elseif(WITH_SHADOW_MAC)
        find_library(IOKIT IOKit)
        find_library(IOSURFACE IOSurface)
        find_library(CARBON Carbon)
        list(APPEND ${MODULE_PREFIX}_MAC_LIBS ${IOKIT} ${IOSURFACE} ${CARBON})
+elseif(WITH_SHADOW_WIN)
+       list(APPEND ${MODULE_PREFIX}_WIN_LIBS freerdp-client)
 endif()
 
 set(${MODULE_PREFIX}_WIN_SRCS
@@ -273,6 +286,7 @@ if (WITH_LIBRARY_VERSIONING)
 endif()
 
 install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT server)
+
 if (WITH_DEBUG_SYMBOLS AND MSVC)
        install(FILES ${CMAKE_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${CMAKE_INSTALL_LIBDIR}
                COMPONENT symbols)
@@ -288,7 +302,7 @@ set(MODULE_PREFIX "FREERDP_SERVER_SHADOW_CLI")
 set(${MODULE_PREFIX}_SRCS
        shadow.c)
 
-       # On windows create dll version information.
+# On windows create dll version information.
 # Vendor, product and year are already set in top level CMakeLists.txt
 if (WIN32)
   set (RC_VERSION_MAJOR ${FREERDP_VERSION_MAJOR})