diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index b8b769922..37a811db2 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -19,7 +19,7 @@ add_subdirectory(common) -if(FREERDP_VENDOR) +if(FREERDP_VENDOR AND WITH_CLIENT) if(WIN32) add_subdirectory(Windows) else() @@ -58,28 +58,28 @@ if(FREERDP_VENDOR) endif() # Pick up other clients +if(WITH_CLIENT) + set(FILENAME "ModuleOptions.cmake") + file(GLOB FILEPATHS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*/${FILENAME}") -set(FILENAME "ModuleOptions.cmake") -file(GLOB FILEPATHS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*/${FILENAME}") - -foreach(FILEPATH ${FILEPATHS}) - if(${FILEPATH} MATCHES "^([^/]*)/+${FILENAME}") - string(REGEX REPLACE "^([^/]*)/+${FILENAME}" "\\1" FREERDP_CLIENT ${FILEPATH}) - set(FREERDP_CLIENT_ENABLED 0) - include(${FILEPATH}) - if(FREERDP_CLIENT_ENABLED) - if(NOT (${FREERDP_CLIENT_VENDOR} MATCHES "FreeRDP")) - list(APPEND FREERDP_EXTRA_CLIENTS ${FREERDP_CLIENT}) - if(${FREERDP_CLIENT_VENDOR} MATCHES "${VENDOR}") - set(CLIENT_VENDOR_PATH "client/${FREERDP_CLIENT}" PARENT_SCOPE) + foreach(FILEPATH ${FILEPATHS}) + if(${FILEPATH} MATCHES "^([^/]*)/+${FILENAME}") + string(REGEX REPLACE "^([^/]*)/+${FILENAME}" "\\1" FREERDP_CLIENT ${FILEPATH}) + set(FREERDP_CLIENT_ENABLED 0) + include(${FILEPATH}) + if(FREERDP_CLIENT_ENABLED) + if(NOT (${FREERDP_CLIENT_VENDOR} MATCHES "FreeRDP")) + list(APPEND FREERDP_EXTRA_CLIENTS ${FREERDP_CLIENT}) + if(${FREERDP_CLIENT_VENDOR} MATCHES "${VENDOR}") + set(CLIENT_VENDOR_PATH "client/${FREERDP_CLIENT}" PARENT_SCOPE) + endif() endif() endif() endif() - endif() -endforeach() - -foreach(FREERDP_CLIENT ${FREERDP_EXTRA_CLIENTS}) - add_subdirectory(${FREERDP_CLIENT}) -endforeach() + endforeach() + foreach(FREERDP_CLIENT ${FREERDP_EXTRA_CLIENTS}) + add_subdirectory(${FREERDP_CLIENT}) + endforeach() +endif()