diff --git a/channels/sample/ChannelOptions.cmake b/channels/sample/ChannelOptions.cmake index 430a072ca..33e50673e 100644 --- a/channels/sample/ChannelOptions.cmake +++ b/channels/sample/ChannelOptions.cmake @@ -5,5 +5,11 @@ set(CHANNEL_LONG_NAME "Sample Virtual Channel Extension") set(CHANNEL_SPECIFICATIONS "") string(TOUPPER "WITH_${CHANNEL_SHORT_NAME}" CHANNEL_OPTION) -option(${CHANNEL_OPTION} "Build ${CHANNEL_SHORT_NAME}" OFF) + +if(WITH_SAMPLE) + option(${CHANNEL_OPTION} "Build ${CHANNEL_SHORT_NAME}" ON) +else() + option(${CHANNEL_OPTION} "Build ${CHANNEL_SHORT_NAME}" OFF) +endif() + diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index 771b25474..d96b77afd 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -1,5 +1,5 @@ # FreeRDP: A Remote Desktop Protocol Implementation -# FreeRDP Client User Interfaces +# FreeRDP Clients # # Copyright 2012 Marc-Andre Moreau # @@ -15,28 +15,29 @@ # See the License for the specific language governing permissions and # limitations under the License. -# User Interfaces +# Clients -if(NOT WIN32) - # Build Sample Client - add_subdirectory(Sample) - - # Build X11 Client - if(WITH_X11) - find_suggested_package(X11) - add_subdirectory(X11) +if(WIN32) + add_subdirectory(Windows) +else() + if(WITH_SAMPLE) + add_subdirectory(Sample) endif() - # Build DirectFB Client + find_optional_package(DirectFB) if(WITH_DIRECTFB) - find_optional_package(DirectFB) add_subdirectory(DirectFB) endif() -else() - # Build Windows Client - add_subdirectory(Windows) +endif() + +if(NOT WIN32 AND (NOT ANDROID)) + find_suggested_package(X11) + if(WITH_X11) + add_subdirectory(X11) + endif() endif() if(APPLE) add_subdirectory(Mac) endif() + diff --git a/cmake/ConfigOptions.cmake b/cmake/ConfigOptions.cmake index fa258a4cc..e434bdc35 100644 --- a/cmake/ConfigOptions.cmake +++ b/cmake/ConfigOptions.cmake @@ -28,6 +28,7 @@ if(MSVC) endif() option(BUILD_TESTING "Build unit tests" OFF) +option(WITH_SAMPLE "Build sample code" OFF) if(${CMAKE_VERSION} VERSION_GREATER 2.8.8) option(MONOLITHIC_BUILD "Use monolithic build" OFF) diff --git a/libfreerdp/locale/CMakeLists.txt b/libfreerdp/locale/CMakeLists.txt index bb0490ef2..438baa296 100644 --- a/libfreerdp/locale/CMakeLists.txt +++ b/libfreerdp/locale/CMakeLists.txt @@ -48,10 +48,9 @@ if(CMAKE_SYSTEM_NAME MATCHES Solaris) set(WITH_SUN true) endif() -if(NOT WIN32) +if(NOT WIN32 AND (NOT ANDROID)) + find_suggested_package(X11) if(WITH_X11) - find_suggested_package(X11) - add_definitions(-DWITH_X11) include_directories(${X11_INCLUDE_DIRS}) set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} ${${MODULE_PREFIX}_X11_SRCS}) diff --git a/server/CMakeLists.txt b/server/CMakeLists.txt index 3897b5f25..12a6733ce 100644 --- a/server/CMakeLists.txt +++ b/server/CMakeLists.txt @@ -18,11 +18,10 @@ # Servers if(NOT WIN32) + if(WITH_SAMPLE) + add_subdirectory(Sample) + endif() - # Build Test Server - add_subdirectory(Sample) - - # Build X11 Server find_suggested_package(X11) if(WITH_X11) add_subdirectory(X11) diff --git a/server/Sample/CMakeLists.txt b/server/Sample/CMakeLists.txt index 4c5cf6dd3..ae67fd621 100644 --- a/server/Sample/CMakeLists.txt +++ b/server/Sample/CMakeLists.txt @@ -40,5 +40,8 @@ set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MODULE winpr MODULES winpr-crt) +target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) +install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR}) + set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Server/Sample")