876560d70490ce79dc6baa2c3fc4950c6c881d95
[platform/upstream/freerdp.git] / client / common / CMakeLists.txt
1 # FreeRDP: A Remote Desktop Protocol Implementation
2 # FreeRDP Client Common
3 #
4 # Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
5 #
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 #
10 #     http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17
18 set(MODULE_NAME "freerdp-client")
19 set(MODULE_PREFIX "FREERDP_CLIENT")
20
21 set(${MODULE_PREFIX}_SRCS
22         client.c
23         cmdline.c
24         file.c)
25
26 set(FREERDP_CHANNELS_CLIENT_PATH "../../channels/client")
27 foreach(FREERDP_CHANNELS_CLIENT_SRC ${FREERDP_CHANNELS_CLIENT_SRCS})
28         set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} "${FREERDP_CHANNELS_CLIENT_PATH}/${FREERDP_CHANNELS_CLIENT_SRC}")
29 endforeach()
30
31 if(MSVC)
32         set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} module.def)
33 endif()
34
35 add_library(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
36
37 set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${FREERDP_VERSION} SOVERSION ${FREERDP_API_VERSION} PREFIX "lib")
38
39 set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS}
40         ${FREERDP_CHANNELS_CLIENT_LIBS})
41         
42 set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MONOLITHIC ${MONOLITHIC_BUILD}
43         MODULE freerdp
44         MODULES freerdp-core)
45
46 set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MONOLITHIC ${MONOLITHIC_BUILD}
47         MODULE winpr
48         MODULES winpr-crt winpr-utils)
49
50 target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
51
52 set_target_properties(${MODULE_NAME} PROPERTIES LINK_INTERFACE_LIBRARIES "")
53
54 install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries)
55
56 set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Client/Common")
57
58 if(BUILD_TESTING)
59         add_subdirectory(test)
60 endif()
61