[cmake] unify windows resource file generation

* use a macro to add resource files for executables and shared libraries
* use that macro to declare targets
* use that macro to set library/binary versioning
* use that macro to set target output name
* use a macro to create manpages and names
This commit is contained in:
akallabeth 2024-03-19 12:19:07 +01:00 committed by akallabeth
parent ea9e219867
commit 678ff144ab
38 changed files with 215 additions and 670 deletions

View File

@ -367,14 +367,6 @@ if(WIN32)
set(CMAKE_DL_LIBS "") set(CMAKE_DL_LIBS "")
set(CMAKE_USE_RELATIVE_PATH ON) set(CMAKE_USE_RELATIVE_PATH ON)
if (${CMAKE_GENERATOR} MATCHES "NMake Makefile*" OR ${CMAKE_GENERATOR} MATCHES "Ninja*" OR ${CMAKE_GENERATOR} MATCHES "Unix Makefiles")
set(CMAKE_PDB_BINARY_DIR ${PROJECT_BINARY_DIR})
elseif (${CMAKE_GENERATOR} MATCHES "Visual Studio*")
set(CMAKE_PDB_BINARY_DIR "${PROJECT_BINARY_DIR}/\${CMAKE_INSTALL_CONFIG_NAME}")
else()
message(FATAL_ERROR "Unknown generator ${CMAKE_GENERATOR}")
endif()
string(TIMESTAMP RC_VERSION_YEAR "%Y") string(TIMESTAMP RC_VERSION_YEAR "%Y")
if(NOT DEFINED CMAKE_WINDOWS_VERSION) if(NOT DEFINED CMAKE_WINDOWS_VERSION)

View File

@ -30,11 +30,6 @@ endforeach()
add_library(${MODULE_NAME} STATIC ${${MODULE_PREFIX}_SRCS}) add_library(${MODULE_NAME} STATIC ${${MODULE_PREFIX}_SRCS})
if (WITH_LIBRARY_VERSIONING)
set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${FREERDP_VERSION} SOVERSION ${FREERDP_API_VERSION})
endif()
set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr freerdp) set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr freerdp)
set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} PARENT_SCOPE) set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} PARENT_SCOPE)

View File

@ -46,7 +46,7 @@ option(WITH_WIN_CONSOLE "Build ${PROJECT_NAME} with console support" ON)
option(WITH_SDL_LINK_SHARED "link SDL dynamic or static" ON) option(WITH_SDL_LINK_SHARED "link SDL dynamic or static" ON)
if(WITH_WIN_CONSOLE) if(WITH_WIN_CONSOLE)
set(WIN32_GUI_FLAG "") set(WIN32_GUI_FLAG "TRUE")
else() else()
set(WIN32_GUI_FLAG "WIN32") set(WIN32_GUI_FLAG "WIN32")
endif() endif()
@ -113,14 +113,8 @@ else()
list(APPEND LIBS ${SDL2_LIBRARIES}) list(APPEND LIBS ${SDL2_LIBRARIES})
endif() endif()
add_executable(${PROJECT_NAME} AddTargetWithResourceFile(${PROJECT_NAME} "${WIN32_GUI_FLAG}" "${PROJECT_VERSION}" SRCS)
${WIN32_GUI_FLAG}
${SRCS}
)
if (WITH_BINARY_VERSIONING)
set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME "${PROJECT_NAME}${PROJECT_VERSION_MAJOR}")
endif()
target_link_libraries(${PROJECT_NAME} PRIVATE ${LIBS}) target_link_libraries(${PROJECT_NAME} PRIVATE ${LIBS})
set_property(TARGET ${PROJECT_NAME} PROPERTY FOLDER "Client/SDL") set_property(TARGET ${PROJECT_NAME} PROPERTY FOLDER "Client/SDL")
install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT client) install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT client)

View File

@ -5,8 +5,4 @@ set(DEPS
sdl-freerdp-envvar.1.xml sdl-freerdp-envvar.1.xml
) )
set(MANPAGE_NAME ${PROJECT_NAME}) generate_and_install_freerdp_man_from_xml(${PROJECT_NAME} "1" "${FREERDP_API_VERSION}" "${DEPS}")
if (WITH_BINARY_VERSIONING)
set(MANPAGE_NAME ${PROJECT_NAME}${PROJECT_VERSION_MAJOR})
endif()
generate_and_install_freerdp_man_from_xml(${PROJECT_NAME}.1 ${MANPAGE_NAME}.1 "${DEPS}")

View File

@ -45,23 +45,7 @@ set(SRCS
tf_freerdp.h tf_freerdp.h
tf_freerdp.c) tf_freerdp.c)
# On windows create dll version information. AddTargetWithResourceFile(${PROJECT_NAME} TRUE "${PROJECT_VERSION}" SRCS)
# Vendor, product and year are already set in top level CMakeLists.txt
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 "${PROJECT_NAME}${CMAKE_EXECUTABLE_SUFFIX}" )
configure_file(
${PROJECT_SOURCE_DIR}/../../cmake/WindowsDLLVersion.rc.in
${CMAKE_CURRENT_BINARY_DIR}/version.rc
@ONLY)
list (APPEND SRCS ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
endif()
add_executable(${PROJECT_NAME} ${SRCS})
set(LIBS set(LIBS
freerdp-client freerdp-client
@ -70,8 +54,5 @@ set(LIBS
) )
target_link_libraries(${PROJECT_NAME} PRIVATE ${LIBS}) target_link_libraries(${PROJECT_NAME} PRIVATE ${LIBS})
if (WITH_BINARY_VERSIONING)
set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME "${PROJECT_NAME}${PROJECT_VERSION_MAJOR}")
endif()
set_property(TARGET ${PROJECT_NAME} PROPERTY FOLDER "Client/Sample") set_property(TARGET ${PROJECT_NAME} PROPERTY FOLDER "Client/Sample")
install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT client) install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT client)

View File

@ -46,17 +46,11 @@ endif()
list (APPEND ${MODULE_PREFIX}_LIBS freerdp-client freerdp uwac) list (APPEND ${MODULE_PREFIX}_LIBS freerdp-client freerdp uwac)
add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) AddTargetWithResourceFile(${MODULE_NAME} TRUE ${FREERDP_VERSION} ${MODULE_PREFIX}_SRCS)
set(MANPAGE_NAME ${MODULE_NAME})
if (WITH_BINARY_VERSIONING)
set_target_properties(${MODULE_NAME} PROPERTIES OUTPUT_NAME "${MODULE_NAME}${FREERDP_API_VERSION}")
set(MANPAGE_NAME ${MODULE_NAME}${FREERDP_API_VERSION})
endif()
target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT client) install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT client)
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Client/Wayland") set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Client/Wayland")
configure_file(wlfreerdp.1.in ${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE_NAME}.1) generate_and_install_freerdp_man_from_template(${MODULE_NAME} "1" "${FREERDP_API_VERSION}")
install_freerdp_man(${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE_NAME}.1 1)

View File

@ -40,26 +40,6 @@ set(${MODULE_PREFIX}_SRCS
resource/wfreerdp.rc resource/wfreerdp.rc
resource/resource.h) resource/resource.h)
# On windows create dll version information.
# Vendor, product and year are already set in top level CMakeLists.txt
if (WIN32 AND BUILD_SHARED_LIBS)
set (RC_VERSION_MAJOR ${FREERDP_VERSION_MAJOR})
set (RC_VERSION_MINOR ${FREERDP_VERSION_MINOR})
set (RC_VERSION_BUILD ${FREERDP_VERSION_REVISION})
if(WITH_CLIENT_INTERFACE)
set (RC_VERSION_FILE "${CMAKE_SHARED_LIBRARY_PREFIX}${MODULE_NAME}${FREERDP_API_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}" )
else()
set (RC_VERSION_FILE "${MODULE_NAME}${CMAKE_EXECUTABLE_SUFFIX}" )
endif()
configure_file(
${PROJECT_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()
option(WITH_WINDOWS_CERT_STORE "Build ${MODULE_NAME} with additional certificate validation against windows certificate store" ON) option(WITH_WINDOWS_CERT_STORE "Build ${MODULE_NAME} with additional certificate validation against windows certificate store" ON)
if(WITH_WINDOWS_CERT_STORE) if(WITH_WINDOWS_CERT_STORE)
add_definitions("-DWITH_WINDOWS_CERT_STORE") add_definitions("-DWITH_WINDOWS_CERT_STORE")
@ -68,7 +48,7 @@ endif()
option(WITH_WIN_CONSOLE "Build ${MODULE_NAME} with console support" OFF) option(WITH_WIN_CONSOLE "Build ${MODULE_NAME} with console support" OFF)
if(WITH_WIN_CONSOLE) if(WITH_WIN_CONSOLE)
add_definitions("-DWITH_WIN_CONSOLE") add_definitions("-DWITH_WIN_CONSOLE")
set(WIN32_GUI_FLAG "") set(WIN32_GUI_FLAG "TRUE")
else() else()
set(WIN32_GUI_FLAG "WIN32") set(WIN32_GUI_FLAG "WIN32")
endif() endif()
@ -78,27 +58,12 @@ if(WITH_PROGRESS_BAR)
add_definitions("-DWITH_PROGRESS_BAR") add_definitions("-DWITH_PROGRESS_BAR")
endif() endif()
if(WITH_CLIENT_INTERFACE) if(CLIENT_INTERFACE_SHARED)
if(CLIENT_INTERFACE_SHARED) AddTargetWithResourceFile(${MODULE_NAME} "SHARED" "${FREERDP_VERSION}" ${MODULE_PREFIX}_SRCS)
add_library(${MODULE_NAME} SHARED ${${MODULE_PREFIX}_SRCS})
else()
add_library(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
endif()
if (WITH_LIBRARY_VERSIONING)
set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${FREERDP_VERSION} SOVERSION ${FREERDP_API_VERSION})
endif()
set_target_properties(${MODULE_NAME} PROPERTIES OUTPUT_NAME ${MODULE_NAME}${FREERDP_API_VERSION})
target_include_directories(${MODULE_NAME} INTERFACE $<INSTALL_INTERFACE:include>)
else() else()
set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} cli/wfreerdp.c cli/wfreerdp.h) AddTargetWithResourceFile(${MODULE_NAME} FALSE "${FREERDP_VERSION}" ${MODULE_PREFIX}_SRCS)
add_executable(${MODULE_NAME} ${WIN32_GUI_FLAG} ${${MODULE_PREFIX}_SRCS})
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
if (WITH_BINARY_VERSIONING)
set_target_properties(${MODULE_NAME} PROPERTIES OUTPUT_NAME "wfreerdp${FREERDP_API_VERSION}")
else()
set_target_properties(${MODULE_NAME} PROPERTIES OUTPUT_NAME "wfreerdp")
endif()
endif() endif()
target_include_directories(${MODULE_NAME} INTERFACE $<INSTALL_INTERFACE:include>)
list(APPEND LIBS freerdp-client) list(APPEND LIBS freerdp-client)
list(APPEND LIBS winpr freerdp) list(APPEND LIBS winpr freerdp)
@ -112,16 +77,7 @@ target_link_libraries(${MODULE_NAME} PRIVATE ${LIBS})
if(WITH_CLIENT_INTERFACE) if(WITH_CLIENT_INTERFACE)
install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries) install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries)
if (WITH_DEBUG_SYMBOLS AND MSVC AND BUILD_SHARED_LIBS)
install(FILES ${CMAKE_PDB_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT symbols)
endif()
add_subdirectory(cli)
else()
install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT client)
if (WITH_DEBUG_SYMBOLS AND MSVC)
get_target_property(OUTPUT_FILENAME ${MODULE_NAME} OUTPUT_NAME)
install(FILES ${CMAKE_PDB_BINARY_DIR}/${OUTPUT_FILENAME}.pdb DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT symbols)
endif()
endif() endif()
add_subdirectory(cli)
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Client/Windows") set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Client/Windows")

View File

@ -25,33 +25,11 @@ set(${MODULE_PREFIX}_SRCS
wfreerdp.h wfreerdp.h
../resource/wfreerdp.rc) ../resource/wfreerdp.rc)
# On windows create dll version information. AddTargetWithResourceFile(${MODULE_NAME} "${WIN32_GUI_FLAG}" "${FREERDP_VERSION}" ${MODULE_PREFIX}_SRCS)
# Vendor, product and year are already set in top level CMakeLists.txt
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(
${PROJECT_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()
add_executable(${MODULE_NAME} ${WIN32_GUI_FLAG} ${${MODULE_PREFIX}_SRCS})
if (WITH_BINARY_VERSIONING)
set_target_properties(${MODULE_NAME} PROPERTIES OUTPUT_NAME "${MODULE_NAME}${PROJECT_VERSION_MAJOR}")
endif()
set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} wfreerdp-client) set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} wfreerdp-client)
target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
install(TARGETS ${MODULE_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT client) install(TARGETS ${MODULE_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT client)
if (WITH_DEBUG_SYMBOLS AND MSVC)
install(FILES ${CMAKE_PDB_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT symbols)
endif()
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Client/Windows") set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Client/Windows")

View File

@ -21,7 +21,7 @@ if (NOT FREERDP_DEFAULT_PROJECT_VERSION)
set(FREERDP_DEFAULT_PROJECT_VERSION "1.0.0.0") set(FREERDP_DEFAULT_PROJECT_VERSION "1.0.0.0")
endif() endif()
project(xfreerdp project(xfreerdp-client
LANGUAGES C LANGUAGES C
VERSION ${FREERDP_DEFAULT_PROJECT_VERSION} VERSION ${FREERDP_DEFAULT_PROJECT_VERSION}
) )
@ -84,27 +84,12 @@ if (CHANNEL_TSMF_CLIENT)
) )
endif() endif()
if(WITH_CLIENT_INTERFACE) if(CLIENT_INTERFACE_SHARED)
if(CLIENT_INTERFACE_SHARED) AddTargetWithResourceFile(${PROJECT_NAME} "SHARED" "${PROJECT_VERSION}" SRCS)
add_library(${PROJECT_NAME} SHARED ${SRCS})
if (WITH_LIBRARY_VERSIONING)
set_target_properties(${PROJECT_NAME} PROPERTIES VERSION ${FREERDP_VERSION} SOVERSION ${FREERDP_API_VERSION})
endif()
else()
add_library(${PROJECT_NAME} ${SRCS})
endif()
target_include_directories(${PROJECT_NAME} INTERFACE $<INSTALL_INTERFACE:include>)
else() else()
list(APPEND SRCS AddTargetWithResourceFile(${PROJECT_NAME} "STATIC" "${PROJECT_VERSION}" SRCS)
cli/xfreerdp.c xfreerdp.h
)
add_executable(${PROJECT_NAME} ${SRCS})
if (WITH_BINARY_VERSIONING)
set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME "${PROJECT_NAME}${PROJECT_VERSION_MAJOR}")
endif()
include_directories(..)
endif() endif()
target_include_directories(${PROJECT_NAME} INTERFACE $<INSTALL_INTERFACE:include>)
set(LIBS set(LIBS
${X11_LIBRARIES} ${X11_LIBRARIES}
@ -233,13 +218,10 @@ if(WITH_IPP)
target_link_libraries(${PROJECT_NAME} PRIVATE ${IPP_LIBRARY_LIST}) target_link_libraries(${PROJECT_NAME} PRIVATE ${IPP_LIBRARY_LIST})
endif() endif()
option(WITH_CLIENT_INTERFACE "Build clients as a library with an interface" OFF)
if(WITH_CLIENT_INTERFACE) if(WITH_CLIENT_INTERFACE)
install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries) install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries)
add_subdirectory(cli)
else()
install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT client)
endif() endif()
add_subdirectory(cli)
set_property(TARGET ${PROJECT_NAME} PROPERTY FOLDER "Client/X11") set_property(TARGET ${PROJECT_NAME} PROPERTY FOLDER "Client/X11")

View File

@ -15,32 +15,21 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
set(MODULE_NAME "xfreerdp-cli") set(MODULE_NAME "xfreerdp")
set(MODULE_PREFIX "FREERDP_CLIENT_X11") set(MODULE_PREFIX "FREERDP_CLIENT_X11")
set(SRCS set(SRCS
xfreerdp.c xfreerdp.c
) )
add_executable(${MODULE_NAME} ${SRCS}) AddTargetWithResourceFile(${MODULE_NAME} TRUE "${PROJECT_VERSION}" SRCS)
if (WITH_BINARY_VERSIONING)
set_target_properties(${MODULE_NAME} PROPERTIES OUTPUT_NAME "xfreerdp${PROJECT_VERSION_MAJOR}")
else()
set_target_properties(${MODULE_NAME} PROPERTIES OUTPUT_NAME "xfreerdp")
endif()
set_target_properties(${MODULE_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "..") set_target_properties(${MODULE_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "..")
list(APPEND LIBS list(APPEND LIBS
xfreerdp-client freerdp-client xfreerdp-client
freerdp-client
) )
if(OPENBSD)
list(APPEND LIBS
ossaudio
)
endif()
target_link_libraries(${MODULE_NAME} PRIVATE ${LIBS}) target_link_libraries(${MODULE_NAME} PRIVATE ${LIBS})
install(TARGETS ${MODULE_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT client) install(TARGETS ${MODULE_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT client)

View File

@ -5,8 +5,4 @@ set(DEPS
xfreerdp-envvar.1.xml xfreerdp-envvar.1.xml
) )
set(MANPAGE_NAME ${PROJECT_NAME}) generate_and_install_freerdp_man_from_xml("xfreerdp" "1" "${FREERDP_API_VERSION}" ${DEPS})
if (WITH_BINARY_VERSIONING)
set(MANPAGE_NAME ${PROJECT_NAME}${PROJECT_VERSION_MAJOR})
endif()
generate_and_install_freerdp_man_from_xml(${PROJECT_NAME}.1 ${MANPAGE_NAME}.1 ${DEPS})

View File

@ -58,30 +58,9 @@ if(WITH_FUSE)
add_definitions(-D_FILE_OFFSET_BITS=64) add_definitions(-D_FILE_OFFSET_BITS=64)
endif() endif()
# On windows create dll version information.
# Vendor, product and year are already set in top level CMakeLists.txt
if (WIN32 AND BUILD_SHARED_LIBS)
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 "${CMAKE_SHARED_LIBRARY_PREFIX}${MODULE_NAME}${FREERDP_API_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}" )
configure_file(
${PROJECT_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in
${CMAKE_CURRENT_BINARY_DIR}/version.rc
@ONLY)
list (APPEND SRCS ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
endif()
include_directories(${OPENSSL_INCLUDE_DIR}) include_directories(${OPENSSL_INCLUDE_DIR})
add_library(${MODULE_NAME} ${SRCS}) AddTargetWithResourceFile(${MODULE_NAME} FALSE "${FREERDP_VERSION}" SRCS)
set_target_properties(${MODULE_NAME} PROPERTIES OUTPUT_NAME ${MODULE_NAME}${FREERDP_API_VERSION})
if (WITH_LIBRARY_VERSIONING)
set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${FREERDP_VERSION} SOVERSION ${FREERDP_API_VERSION})
endif()
list(APPEND LIBS freerdp winpr) list(APPEND LIBS freerdp winpr)
@ -94,11 +73,6 @@ install(TARGETS ${MODULE_NAME} COMPONENT libraries EXPORT FreeRDP-ClientTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
if (WITH_DEBUG_SYMBOLS AND MSVC AND BUILD_SHARED_LIBS)
get_target_property(OUTPUT_FILENAME ${MODULE_NAME} OUTPUT_NAME)
install(FILES ${CMAKE_PDB_BINARY_DIR}/${OUTPUT_FILENAME}.pdb DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT symbols)
endif()
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Client/Common") set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Client/Common")
if(BUILD_TESTING) if(BUILD_TESTING)

View File

@ -0,0 +1,120 @@
set(add_resource_macro_internal_dir ${CMAKE_CURRENT_LIST_DIR} CACHE INTERNAL "")
macro(AddTargetWithResourceFile nameAndTarget is_exe version sources)
list(LENGTH ${nameAndTarget} target_length)
if (target_length GREATER 1)
list(GET ${nameAndTarget} 1 name)
list(GET ${nameAndTarget} 0 target)
else()
set(name ${nameAndTarget})
set(target ${nameAndTarget})
endif()
set(VERSIONING OFF)
set(IS_EXE OFF)
if ("${is_exe}" MATCHES "TRUE")
set(IS_EXE ON)
elseif ("${is_exe}" MATCHES "WIN32")
set(IS_EXE ON)
set(exe_options "WIN32")
elseif ("${is_exe}" MATCHES "SHARED")
set(lib_options "SHARED")
elseif ("${is_exe}" MATCHES "STATIC")
set(lib_options "STATIC")
endif()
if (IS_EXE AND WITH_BINARY_VERSIONING)
set(VERSIONING ON)
elseif (NOT IS_EXE AND WITH_LIBRARY_VERSIONING)
set(VERSIONING ON)
endif()
if (${ARGC} GREATER 4)
set(VERSIONING ${ARGV5})
endif()
string(REGEX MATCH "^([0-9]+)\\.([0-9]+)\\.([0-9]+).*"
RC_PROGRAM_VERSION_MATCH ${version})
set (RC_VERSION_MAJOR ${CMAKE_MATCH_1})
set (RC_VERSION_MINOR ${CMAKE_MATCH_2})
set (RC_VERSION_BUILD ${CMAKE_MATCH_3})
if (WIN32)
if (IS_EXE)
if (VERSIONING)
set (RC_VERSION_FILE "${name}${RC_VERSION_MAJOR}${CMAKE_EXECUTABLE_SUFFIX}" )
else()
set (RC_VERSION_FILE "${name}${CMAKE_EXECUTABLE_SUFFIX}" )
endif()
else()
if (VERSIONING)
set (RC_VERSION_FILE "${CMAKE_SHARED_LIBRARY_PREFIX}${name}${RC_VERSION_MAJOR}${CMAKE_SHARED_LIBRARY_SUFFIX}" )
else()
set (RC_VERSION_FILE "${CMAKE_SHARED_LIBRARY_PREFIX}${name}${CMAKE_SHARED_LIBRARY_SUFFIX}" )
endif()
endif()
configure_file(
${add_resource_macro_internal_dir}/WindowsDLLVersion.rc.in
${CMAKE_CURRENT_BINARY_DIR}/version.rc
@ONLY
)
list(APPEND ${sources} ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
endif()
set(OUTPUT_FILENAME "${name}")
if (VERSIONING)
set(OUTPUT_FILENAME "${name}${RC_VERSION_MAJOR}")
endif()
if (IS_EXE)
message("add_executable(${target}) [${exe_options}]")
add_executable(
${target}
${exe_options}
${${sources}}
)
set_target_properties(
${target}
PROPERTIES
OUTPUT_NAME ${OUTPUT_FILENAME}
)
set (OUTPUT_FILENAME "${OUTPUT_FILENAME}${CMAKE_EXECUTABLE_SUFFIX}" )
else()
message("add_library(${target}) [${lib_options}]")
add_library(${target}
${lib_options}
${${sources}})
if (VERSIONING)
set_target_properties(
${target}
PROPERTIES
VERSION ${version}
SOVERSION ${RC_VERSION_MAJOR}
)
else()
set_target_properties(${target} PROPERTIES PREFIX "")
set_target_properties(${target} PROPERTIES NO_SONAME 1)
endif()
set_target_properties(
${target}
PROPERTIES
OUTPUT_NAME ${OUTPUT_FILENAME}
)
set (OUTPUT_FILENAME "${CMAKE_SHARED_LIBRARY_PREFIX}${OUTPUT_FILENAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" )
endif()
if (WITH_DEBUG_SYMBOLS AND MSVC AND (is_exe OR BUILD_SHARED_LIBS))
message("add PDB for ${OUTPUT_FILENAME}")
set_target_properties(
${target}
PROPERTIES
PDB_NAME ${OUTPUT_FILENAME}
)
install(FILES $<TARGET_PDB_FILE:${target}> DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT symbols)
endif()
endmacro()

View File

@ -34,4 +34,4 @@ include(GNUInstallDirsWrapper)
include(MSVCRuntime) include(MSVCRuntime)
include(ConfigureRPATH) include(ConfigureRPATH)
include(ClangTidy) include(ClangTidy)
include(AddTargetWithResourceFile)

View File

@ -80,6 +80,7 @@ endif()
option(WITH_THIRD_PARTY "Build third-party components" OFF) option(WITH_THIRD_PARTY "Build third-party components" OFF)
option(WITH_CLIENT_INTERFACE "Build clients as a library with an interface" OFF) option(WITH_CLIENT_INTERFACE "Build clients as a library with an interface" OFF)
CMAKE_DEPENDENT_OPTION(CLIENT_INTERFACE_SHARED "Build clients as a shared library with an interface" OFF "WITH_CLIENT_INTERFACE" OFF)
option(WITH_SERVER_INTERFACE "Build servers as a library with an interface" ON) option(WITH_SERVER_INTERFACE "Build servers as a library with an interface" ON)
option(WITH_DEBUG_ALL "Print all debug messages." OFF) option(WITH_DEBUG_ALL "Print all debug messages." OFF)

View File

@ -3,14 +3,14 @@ option(CMAKE_SKIP_BUILD_RPATH "skip build RPATH" OFF)
option(CMAKE_BUILD_WITH_INSTALL_RPATH "build with install RPATH" OFF) option(CMAKE_BUILD_WITH_INSTALL_RPATH "build with install RPATH" OFF)
option(CMAKE_INSTALL_RPATH_USE_LINK_PATH "build with link RPATH" OFF) option(CMAKE_INSTALL_RPATH_USE_LINK_PATH "build with link RPATH" OFF)
if (BUILD_SHARED_LIBS)
option(CMAKE_MACOSX_RPATH "MacOSX RPATH" ON)
endif()
if (APPLE) if (APPLE)
if (BUILD_SHARED_LIBS)
option(CMAKE_MACOSX_RPATH "MacOSX RPATH" ON)
endif()
file(RELATIVE_PATH FRAMEWORK_PATH ${CMAKE_INSTALL_FULL_BINDIR} ${CMAKE_INSTALL_FULL_LIBDIR}) file(RELATIVE_PATH FRAMEWORK_PATH ${CMAKE_INSTALL_FULL_BINDIR} ${CMAKE_INSTALL_FULL_LIBDIR})
set(CFG_INSTALL_RPATH "@loader_path/${FRAMEWORK_PATH}") set(CFG_INSTALL_RPATH "@loader_path/${FRAMEWORK_PATH}")
else (APPLE) elseif(NOT WIN32)
if (NOT FREEBSD) if (NOT FREEBSD)
option(WITH_ADD_PLUGIN_TO_RPATH "Add extension and plugin path to RPATH" OFF) option(WITH_ADD_PLUGIN_TO_RPATH "Add extension and plugin path to RPATH" OFF)
if (WITH_ADD_PLUGIN_TO_RPATH) if (WITH_ADD_PLUGIN_TO_RPATH)

View File

@ -7,11 +7,27 @@ function(install_freerdp_man manpage section)
endif() endif()
endfunction() endfunction()
function(generate_and_install_freerdp_man_from_xml template manpage dependencies) function(generate_and_install_freerdp_man_from_template name_base section api)
if(WITH_MANPAGES) if(WITH_MANPAGES)
find_program(XSLTPROC_EXECUTABLE NAMES xsltproc REQUIRED) if (WITH_BINARY_VERSIONING)
if (NOT DOCBOOKXSL_FOUND) set(manpage "${CMAKE_CURRENT_BINARY_DIR}/${name_base}${api}.${section}")
message(FATAL_ERROR "docbook xsl not found but required for manpage generation") else()
set(manpage "${CMAKE_CURRENT_BINARY_DIR}/${name_base}.${section}")
endif()
configure_file(${name_base}.${section}.in ${manpage})
install_freerdp_man(${manpage} ${section})
endif()
endfunction()
function(generate_and_install_freerdp_man_from_xml name_base section api dependencies)
if(WITH_MANPAGES)
set(template "${name_base}.${section}")
if (WITH_BINARY_VERSIONING)
set(MANPAGE_NAME "${name_base}${api}")
set(manpage "${name_base}${api}.${section}")
else()
set(MANPAGE_NAME "${name_base}")
set(manpage "${name_base}.${section}")
endif() endif()
# We need the variable ${MAN_TODAY} to contain the current date in ISO # We need the variable ${MAN_TODAY} to contain the current date in ISO
@ -34,8 +50,13 @@ function(generate_and_install_freerdp_man_from_xml template manpage dependencies
endif() endif()
endforeach() endforeach()
find_program(XSLTPROC_EXECUTABLE NAMES xsltproc REQUIRED)
if (NOT DOCBOOKXSL_FOUND)
message(FATAL_ERROR "docbook xsl not found but required for manpage generation")
endif()
add_custom_command( add_custom_command(
OUTPUT ${manpage} OUTPUT "${manpage}"
COMMAND ${CMAKE_BINARY_DIR}/client/common/man/generate_argument_docbook COMMAND ${CMAKE_BINARY_DIR}/client/common/man/generate_argument_docbook
COMMAND ${XSLTPROC_EXECUTABLE} --path "${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}" ${DOCBOOKXSL_DIR}/manpages/docbook.xsl ${manpage}.xml COMMAND ${XSLTPROC_EXECUTABLE} --path "${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}" ${DOCBOOKXSL_DIR}/manpages/docbook.xsl ${manpage}.xml
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
@ -50,6 +71,6 @@ function(generate_and_install_freerdp_man_from_xml template manpage dependencies
DEPENDS DEPENDS
${manpage} ${manpage}
) )
install_freerdp_man(${CMAKE_CURRENT_BINARY_DIR}/${manpage} 1) install_freerdp_man(${CMAKE_CURRENT_BINARY_DIR}/${manpage} ${section})
endif() endif()
endfunction() endfunction()

View File

@ -433,32 +433,10 @@ list(REMOVE_DUPLICATES LIBFREERDP_DEFINITIONS)
list(REMOVE_DUPLICATES LIBFREERDP_INCLUDES) list(REMOVE_DUPLICATES LIBFREERDP_INCLUDES)
include_directories(${LIBFREERDP_INCLUDES}) include_directories(${LIBFREERDP_INCLUDES})
# On windows create dll version information. AddTargetWithResourceFile(${MODULE_NAME} FALSE "${FREERDP_VERSION}" LIBFREERDP_SRCS)
# Vendor, product and year are already set in top level CMakeLists.txt
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 "${CMAKE_SHARED_LIBRARY_PREFIX}${MODULE_NAME}${FREERDP_API_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}" )
configure_file(
${PROJECT_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in
${CMAKE_CURRENT_BINARY_DIR}/version.rc
@ONLY)
set (LIBFREERDP_SRCS ${LIBFREERDP_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
endif()
add_library(${MODULE_NAME} ${LIBFREERDP_SRCS})
add_definitions(${LIBFREERDP_DEFINITIONS}) add_definitions(${LIBFREERDP_DEFINITIONS})
set_target_properties(${MODULE_NAME} PROPERTIES LINKER_LANGUAGE C)
set_target_properties(${MODULE_NAME} PROPERTIES OUTPUT_NAME ${MODULE_NAME}${FREERDP_VERSION_MAJOR})
if (WITH_LIBRARY_VERSIONING)
set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${FREERDP_VERSION} SOVERSION ${FREERDP_API_VERSION})
endif()
target_include_directories(${MODULE_NAME} INTERFACE $<INSTALL_INTERFACE:include>) target_include_directories(${MODULE_NAME} INTERFACE $<INSTALL_INTERFACE:include>)
target_link_libraries(${MODULE_NAME} PRIVATE ${LIBFREERDP_LIBS}) target_link_libraries(${MODULE_NAME} PRIVATE ${LIBFREERDP_LIBS})
target_link_libraries(${MODULE_NAME} PUBLIC ${LIBFREERDP_PUB_LIBS}) target_link_libraries(${MODULE_NAME} PUBLIC ${LIBFREERDP_PUB_LIBS})
@ -467,11 +445,6 @@ install(TARGETS ${MODULE_NAME} COMPONENT libraries EXPORT FreeRDPTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
if (WITH_DEBUG_SYMBOLS AND MSVC AND BUILD_SHARED_LIBS)
get_target_property(OUTPUT_FILENAME ${MODULE_NAME} OUTPUT_NAME)
install(FILES ${CMAKE_PDB_BINARY_DIR}/${OUTPUT_FILENAME}.pdb DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT symbols)
endif()
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "FreeRDP/libfreerdp") set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "FreeRDP/libfreerdp")
include(pkg-config-install-prefix) include(pkg-config-install-prefix)

View File

@ -36,35 +36,13 @@ set(${MODULE_PREFIX}_SRCS
rdtk_engine.c rdtk_engine.c
rdtk_engine.h) rdtk_engine.h)
# On windows create dll version information. AddTargetWithResourceFile(${MODULE_NAME} FALSE "${RDTK_VERSION}" ${MODULE_PREFIX}_SRCS)
# Vendor, product and year are already set in top level CMakeLists.txt
if (WIN32)
set (RC_VERSION_MAJOR ${RDTK_VERSION_MAJOR})
set (RC_VERSION_MINOR ${RDTK_VERSION_MINOR})
set (RC_VERSION_BUILD ${RDTK_VERSION_REVISION})
set (RC_VERSION_FILE "${CMAKE_SHARED_LIBRARY_PREFIX}${MODULE_NAME}${RDTK_API_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}" )
configure_file(
${PROJECT_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in
${CMAKE_CURRENT_BINARY_DIR}/version.rc
@ONLY)
list (APPEND ${MODULE_PREFIX}_SRCS ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
endif()
add_library(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
list(APPEND ${MODULE_PREFIX}_LIBS winpr) list(APPEND ${MODULE_PREFIX}_LIBS winpr)
target_include_directories(${MODULE_NAME} INTERFACE $<INSTALL_INTERFACE:include>) target_include_directories(${MODULE_NAME} INTERFACE $<INSTALL_INTERFACE:include>)
target_link_libraries(${MODULE_NAME} PRIVATE ${${MODULE_PREFIX}_LIBS}) target_link_libraries(${MODULE_NAME} PRIVATE ${${MODULE_PREFIX}_LIBS})
set_target_properties(${MODULE_NAME} PROPERTIES LINKER_LANGUAGE C)
set_target_properties(${MODULE_NAME} PROPERTIES OUTPUT_NAME ${MODULE_NAME}${RDTK_API_VERSION})
if (WITH_LIBRARY_VERSIONING)
set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${RDTK_VERSION} SOVERSION ${RDTK_API_VERSION})
endif()
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "RdTk") set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "RdTk")
if(BUILD_TESTING) if(BUILD_TESTING)
@ -76,9 +54,4 @@ if (NOT RDTK_FORCE_STATIC_BUILD)
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
if (WITH_DEBUG_SYMBOLS AND MSVC AND BUILD_SHARED_LIBS)
get_target_property(OUTPUT_FILENAME ${MODULE_NAME} OUTPUT_NAME)
install(FILES ${CMAKE_PDB_BINARY_DIR}/${OUTPUT_FILENAME}.pdb DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT symbols)
endif()
endif() endif()

View File

@ -25,10 +25,7 @@ include_directories(${X11_INCLUDE_DIR})
set(SRCS set(SRCS
rdtk_x11.c) rdtk_x11.c)
add_executable(${MODULE_NAME} ${SRCS}) AddTargetWithResourceFile(${MODULE_NAME} TRUE "${RDTK_VERSION}" SRCS)
if (WITH_BINARY_VERSIONING)
set_target_properties(${MODULE_NAME} PROPERTIES OUTPUT_NAME "${MODULE_NAME}${RDTK_API_VERSION}")
endif()
set(LIBS rdtk) set(LIBS rdtk)

View File

@ -32,22 +32,6 @@ if (CHANNEL_AINPUT_SERVER)
list(APPEND SRCS sf_ainput.c sf_ainput.h) list(APPEND SRCS sf_ainput.c sf_ainput.h)
endif() endif()
# 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})
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(
${PROJECT_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in
${CMAKE_CURRENT_BINARY_DIR}/version.rc
@ONLY)
set ( SRCS ${SRCS} ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
endif()
if (WITH_BINARY_VERSIONING) if (WITH_BINARY_VERSIONING)
set(SAMPLE_RESOURCE_ROOT ${CMAKE_INSTALL_FULL_DATAROOTDIR}/FreeRDP${FREERDP_VERSION_MAJOR}/images) set(SAMPLE_RESOURCE_ROOT ${CMAKE_INSTALL_FULL_DATAROOTDIR}/FreeRDP${FREERDP_VERSION_MAJOR}/images)
else() else()
@ -65,10 +49,7 @@ install(FILES ${SAMPLE_ICONS} DESTINATION ${SAMPLE_RESOURCE_ROOT})
# We need this in runtime path for TestConnect # We need this in runtime path for TestConnect
file(COPY test_icon.bmp DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) file(COPY test_icon.bmp DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
add_executable(${MODULE_NAME} ${SRCS}) AddTargetWithResourceFile(${MODULE_NAME} TRUE "${FREERDP_VERSION}" SRCS)
if (WITH_BINARY_VERSIONING)
set_target_properties(${MODULE_NAME} PROPERTIES OUTPUT_NAME "${MODULE_NAME}${FREERDP_API_VERSION}")
endif()
target_compile_definitions(${MODULE_NAME} target_compile_definitions(${MODULE_NAME}
PRIVATE PRIVATE
@ -79,8 +60,5 @@ list(APPEND LIBS winpr freerdp)
target_link_libraries(${MODULE_NAME} ${LIBS}) target_link_libraries(${MODULE_NAME} ${LIBS})
install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT server) install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT server)
if (WITH_DEBUG_SYMBOLS AND MSVC)
install(FILES ${CMAKE_PDB_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT symbols)
endif()
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Server/Sample") set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Server/Sample")

View File

@ -61,37 +61,12 @@ if(CHANNEL_RDPSND AND WITH_RDPSND_DSOUND)
) )
endif() endif()
# On windows create dll version information.
# Vendor, product and year are already set in top level CMakeLists.txt
set (RC_VERSION_MAJOR ${FREERDP_VERSION_MAJOR})
set (RC_VERSION_MINOR ${FREERDP_VERSION_MINOR})
set (RC_VERSION_BUILD ${FREERDP_VERSION_REVISION})
if(WITH_SERVER_INTERFACE) if(WITH_SERVER_INTERFACE)
set (RC_VERSION_FILE "${CMAKE_SHARED_LIBRARY_PREFIX}${MODULE_NAME}${FREERDP_API_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) AddTargetWithResourceFile(${MODULE_NAME} FALSE "${FREERDP_VERSION}" ${MODULE_PREFIX}_SRCS)
else()
set (RC_VERSION_FILE "${MODULE_NAME}${CMAKE_EXECUTABLE_SUFFIX}" )
endif()
configure_file(
${PROJECT_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)
if(WITH_SERVER_INTERFACE)
add_library(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
set_target_properties(${MODULE_NAME} PROPERTIES OUTPUT_NAME ${MODULE_NAME}${FREERDP_API_VERSION})
if (WITH_LIBRARY_VERSIONING)
set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${FREERDP_VERSION} SOVERSION ${FREERDP_API_VERSION})
endif()
target_include_directories(${MODULE_NAME} INTERFACE $<INSTALL_INTERFACE:include>) target_include_directories(${MODULE_NAME} INTERFACE $<INSTALL_INTERFACE:include>)
else() else()
set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} cli/wfreerdp.c cli/wfreerdp.h) list(APPEND ${MODULE_PREFIX}_SRCS cli/wfreerdp.c cli/wfreerdp.h)
add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) AddTargetWithResourceFile(${MODULE_NAME} TRUE "${FREERDP_VERSION}" ${MODULE_PREFIX}_SRCS)
if (WITH_BINARY_VERSIONING)
set_target_properties(${MODULE_NAME} PROPERTIES OUTPUT_NAME "${MODULE_NAME}${FREERDP_API_VERSION}")
endif()
endif() endif()
@ -109,16 +84,8 @@ if(WITH_SERVER_INTERFACE)
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
if (WITH_DEBUG_SYMBOLS AND MSVC AND BUILD_SHARED_LIBS)
install(FILES ${PROJECT_BINARY_DIR}/${MODULE_NAME}${FREERDP_VERSION_MAJOR}.pdb DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT symbols)
endif()
else() else()
install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT server) install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT server)
if (WITH_DEBUG_SYMBOLS AND MSVC)
install(FILES ${PROJECT_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT symbols)
endif()
endif() endif()
if(WITH_SERVER_INTERFACE) if(WITH_SERVER_INTERFACE)

View File

@ -25,29 +25,7 @@ set(${MODULE_PREFIX}_SRCS
wfreerdp.c wfreerdp.c
wfreerdp.h) wfreerdp.h)
# On windows create dll version information. AddTargetWithResourceFile(${MODULE_NAME} TRUE "${FREERDP_VERSION}" ${MODULE_PREFIX}_SRCS)
# Vendor, product and year are already set in top level CMakeLists.txt
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(
${PROJECT_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)
add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
if (WITH_BINARY_VERSIONING)
set_target_properties(${MODULE_NAME} PROPERTIES OUTPUT_NAME "${OUTPUT_NAME}${FREERDP_API_VERSION}")
set_target_properties(${MODULE_NAME} PROPERTIES PDB_NAME "${OUTPUT_NAME}${FREERDP_API_VERSION}${CMAKE_EXECUTABLE_SUFFIX}")
else()
set_target_properties(${MODULE_NAME} PROPERTIES OUTPUT_NAME "${OUTPUT_NAME}")
set_target_properties(${MODULE_NAME} PROPERTIES PDB_NAME "${OUTPUT_NAME}${CMAKE_EXECUTABLE_SUFFIX}")
endif()
set(${MODULE_PREFIX}_LIBS wfreerdp-server) set(${MODULE_PREFIX}_LIBS wfreerdp-server)
@ -55,8 +33,4 @@ target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT server) install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT server)
if (WITH_DEBUG_SYMBOLS AND MSVC)
install(FILES ${PROJECT_BINARY_DIR}/${OUTPUT_NAME}.pdb DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT symbols)
endif()
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Server/Windows") set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Server/Windows")

View File

@ -36,29 +36,7 @@ if(MSVC)
set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS}) set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS})
endif() endif()
AddTargetWithResourceFile(${MODULE_NAME} FALSE "${FREERDP_VERSION}" ${MODULE_PREFIX}_SRCS)
# 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})
set (RC_VERSION_MINOR ${FREERDP_VERSION_MINOR})
set (RC_VERSION_BUILD ${FREERDP_VERSION_REVISION})
set (RC_VERSION_FILE "${CMAKE_SHARED_LIBRARY_PREFIX}${MODULE_NAME}${FREERDP_API_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}" )
configure_file(
${PROJECT_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()
add_library(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
set_target_properties(${MODULE_NAME} PROPERTIES OUTPUT_NAME ${MODULE_NAME}${FREERDP_API_VERSION})
if (WITH_LIBRARY_VERSIONING)
set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${FREERDP_VERSION} SOVERSION ${FREERDP_API_VERSION})
endif()
target_include_directories(${MODULE_NAME} INTERFACE $<INSTALL_INTERFACE:include>) target_include_directories(${MODULE_NAME} INTERFACE $<INSTALL_INTERFACE:include>)
target_link_libraries(${MODULE_NAME} PRIVATE ${FREERDP_CHANNELS_SERVER_LIBS}) target_link_libraries(${MODULE_NAME} PRIVATE ${FREERDP_CHANNELS_SERVER_LIBS})
@ -69,9 +47,4 @@ install(TARGETS ${MODULE_NAME} COMPONENT libraries EXPORT FreeRDP-ServerTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
if (WITH_DEBUG_SYMBOLS AND MSVC AND BUILD_SHARED_LIBS)
get_target_property(OUTPUT_FILENAME ${MODULE_NAME} OUTPUT_NAME)
install(FILES ${CMAKE_PDB_BINARY_DIR}/${OUTPUT_FILENAME}.pdb DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT symbols)
endif()
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Server/Common") set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Server/Common")

View File

@ -47,29 +47,7 @@ set(PROXY_APP_SRCS freerdp_proxy.c)
option(WITH_PROXY_EMULATE_SMARTCARD "Compile proxy smartcard emulation" OFF) option(WITH_PROXY_EMULATE_SMARTCARD "Compile proxy smartcard emulation" OFF)
add_subdirectory("channels") add_subdirectory("channels")
# On windows create dll version information. AddTargetWithResourceFile(${MODULE_NAME} FALSE "${FREERDP_VERSION}" ${MODULE_PREFIX}_SRCS)
# Vendor, product and year are already set in top level CMakeLists.txt
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(
${PROJECT_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)
list(APPEND PROXY_APP_SRCS ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
endif()
add_library(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
set_target_properties(${MODULE_NAME} PROPERTIES OUTPUT_NAME ${MODULE_NAME}${FREERDP_API_VERSION})
if (WITH_LIBRARY_VERSIONING)
set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${FREERDP_VERSION} SOVERSION ${FREERDP_API_VERSION})
endif()
set(PRIVATE_LIBS set(PRIVATE_LIBS
freerdp-client freerdp-client
@ -89,11 +67,6 @@ install(TARGETS ${MODULE_NAME} COMPONENT server EXPORT FreeRDP-ProxyTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
if (WITH_DEBUG_SYMBOLS AND MSVC AND BUILD_SHARED_LIBS)
get_target_property(OUTPUT_FILENAME ${MODULE_NAME} OUTPUT_NAME)
install(FILES ${CMAKE_PDB_BINARY_DIR}/${OUTPUT_FILENAME}.pdb DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT symbols)
endif()
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Server/Proxy") set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Server/Proxy")
# pkg-config # pkg-config

View File

@ -18,43 +18,12 @@
set(PROXY_APP_SRCS freerdp_proxy.c) set(PROXY_APP_SRCS freerdp_proxy.c)
# 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})
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(
${PROJECT_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in
${CMAKE_CURRENT_BINARY_DIR}/version.rc
@ONLY)
list(APPEND PROXY_APP_SRCS ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
endif()
set(APP_NAME "freerdp-proxy") set(APP_NAME "freerdp-proxy")
add_executable(${APP_NAME} AddTargetWithResourceFile(${APP_NAME} TRUE "${FREERDP_VERSION}" PROXY_APP_SRCS)
${PROXY_APP_SRCS}
)
set(MANPAGE_NAME ${APP_NAME}.1)
if (WITH_BINARY_VERSIONING)
set_target_properties(${APP_NAME}
PROPERTIES
OUTPUT_NAME "${APP_NAME}${FREERDP_API_VERSION}"
)
set(MANPAGE_NAME ${APP_NAME}${FREERDP_API_VERSION}.1)
endif()
target_link_libraries(${APP_NAME} ${MODULE_NAME}) target_link_libraries(${APP_NAME} ${MODULE_NAME})
install(TARGETS ${APP_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT server) install(TARGETS ${APP_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT server)
if (WITH_DEBUG_SYMBOLS AND MSVC)
install(FILES ${CMAKE_PDB_BINARY_DIR}/${APP_NAME}.pdb DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT symbols)
endif()
set_property(TARGET ${APP_NAME} PROPERTY FOLDER "Server/proxy") set_property(TARGET ${APP_NAME} PROPERTY FOLDER "Server/proxy")
configure_file(${APP_NAME}.1.in ${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE_NAME}) generate_and_install_freerdp_man_from_template(${APP_NAME} "1" "${FREERDP_API_VERSION}")
install_freerdp_man(${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE_NAME} 1)

View File

@ -48,13 +48,11 @@ include(CommonConfigOptions)
set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_library(${PROJECT_NAME} SHARED set(SRCS
bitmap-filter.cpp bitmap-filter.cpp
) )
AddTargetWithResourceFile(${PROJECT_NAME} FALSE "${PROJECT_VERSION}" SRCS FALSE)
target_link_libraries(${PROJECT_NAME} winpr freerdp) target_link_libraries(${PROJECT_NAME} winpr freerdp)
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
set_target_properties(${PROJECT_NAME} PROPERTIES NO_SONAME 1)
install(TARGETS ${PROJECT_NAME} DESTINATION ${FREERDP_PROXY_PLUGINDIR}) install(TARGETS ${PROJECT_NAME} DESTINATION ${FREERDP_PROXY_PLUGINDIR})

View File

@ -41,13 +41,11 @@ include(CommonConfigOptions)
set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_library(${PROJECT_NAME} SHARED set(SRCS
demo.cpp demo.cpp
) )
AddTargetWithResourceFile(${PROJECT_NAME} FALSE "${PROJECT_VERSION}" SRCS FALSE)
target_link_libraries(${PROJECT_NAME} winpr) target_link_libraries(${PROJECT_NAME} winpr)
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
set_target_properties(${PROJECT_NAME} PROPERTIES NO_SONAME 1)
install(TARGETS ${PROJECT_NAME} DESTINATION ${FREERDP_PROXY_PLUGINDIR}) install(TARGETS ${PROJECT_NAME} DESTINATION ${FREERDP_PROXY_PLUGINDIR})

View File

@ -40,9 +40,10 @@ include(CommonConfigOptions)
set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_library(${PROJECT_NAME} SHARED set(SRCS
dyn-channel-dump.cpp dyn-channel-dump.cpp
) )
AddTargetWithResourceFile(${PROJECT_NAME} FALSE "${PROJECT_VERSION}" SRCS FALSE)
target_link_libraries(${PROJECT_NAME} PRIVATE target_link_libraries(${PROJECT_NAME} PRIVATE
winpr winpr
@ -52,7 +53,4 @@ target_link_libraries(${PROJECT_NAME} PRIVATE
freerdp-server-proxy freerdp-server-proxy
) )
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
set_target_properties(${PROJECT_NAME} PROPERTIES NO_SONAME 1)
install(TARGETS ${PROJECT_NAME} DESTINATION ${FREERDP_PROXY_PLUGINDIR}) install(TARGETS ${PROJECT_NAME} DESTINATION ${FREERDP_PROXY_PLUGINDIR})

View File

@ -64,24 +64,7 @@ else()
include_directories(${PROJECT_BINARY_DIR}/rdtk/include) include_directories(${PROJECT_BINARY_DIR}/rdtk/include)
endif() endif()
# On windows create dll version information. AddTargetWithResourceFile(${MODULE_NAME} "FALSE" "${FREERDP_VERSION}" SRCS)
# Vendor, product and year are already set in top level CMakeLists.txt
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_PATCH 0)
set (RC_VERSION_FILE "${CMAKE_SHARED_LIBRARY_PREFIX}${MODULE_NAME}${FREERDP_API_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}" )
configure_file(
${PROJECT_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in
${CMAKE_CURRENT_BINARY_DIR}/version.rc
@ONLY)
list (APPEND SRCS ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
endif()
add_library(${MODULE_NAME} ${SRCS})
list(APPEND LIBS list(APPEND LIBS
freerdp freerdp
@ -94,21 +77,11 @@ list(APPEND LIBS
target_include_directories(${MODULE_NAME} INTERFACE $<INSTALL_INTERFACE:include>) target_include_directories(${MODULE_NAME} INTERFACE $<INSTALL_INTERFACE:include>)
target_link_libraries(${MODULE_NAME} PRIVATE ${LIBS}) target_link_libraries(${MODULE_NAME} PRIVATE ${LIBS})
set_target_properties(${MODULE_NAME} PROPERTIES OUTPUT_NAME ${MODULE_NAME}${FREERDP_VERSION_MAJOR})
if (WITH_LIBRARY_VERSIONING)
set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${FREERDP_VERSION} SOVERSION ${FREERDP_API_VERSION})
endif()
install(TARGETS ${MODULE_NAME} COMPONENT server EXPORT FreeRDP-ShadowTargets install(TARGETS ${MODULE_NAME} COMPONENT server EXPORT FreeRDP-ShadowTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
if (WITH_DEBUG_SYMBOLS AND MSVC)
get_target_property(OUTPUT_FILENAME ${MODULE_NAME} OUTPUT_NAME)
install(FILES ${PROJECT_BINARY_DIR}/${OUTPUT_FILENAME}.pdb DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT symbols)
endif()
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Server/shadow") set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Server/shadow")
# subsystem library # subsystem library
@ -126,21 +99,7 @@ elseif(APPLE AND NOT IOS)
add_subdirectory(Mac) add_subdirectory(Mac)
endif() endif()
if (WIN32) AddTargetWithResourceFile(${MODULE_NAME} FALSE "${FREERDP_VERSION}" SRCS)
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(
${PROJECT_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in
${CMAKE_CURRENT_BINARY_DIR}/version.rc
@ONLY)
set ( SRCS ${SRCS} ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
endif()
add_library(${MODULE_NAME} ${SRCS})
list(APPEND LIBS list(APPEND LIBS
freerdp-shadow-subsystem-impl freerdp-shadow-subsystem-impl
@ -152,11 +111,6 @@ list(APPEND LIBS
target_include_directories(${MODULE_NAME} INTERFACE $<INSTALL_INTERFACE:include>) target_include_directories(${MODULE_NAME} INTERFACE $<INSTALL_INTERFACE:include>)
target_link_libraries(${MODULE_NAME} PRIVATE ${LIBS}) target_link_libraries(${MODULE_NAME} PRIVATE ${LIBS})
set_target_properties(${MODULE_NAME} PROPERTIES OUTPUT_NAME ${MODULE_NAME}${FREERDP_API_VERSION})
if (WITH_LIBRARY_VERSIONING)
set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${FREERDP_VERSION} SOVERSION ${FREERDP_API_VERSION})
endif()
if (NOT BUILD_SHARED_LIBS) if (NOT BUILD_SHARED_LIBS)
install(TARGETS freerdp-shadow-subsystem-impl install(TARGETS freerdp-shadow-subsystem-impl
DESTINATION ${CMAKE_INSTALL_LIBDIR} DESTINATION ${CMAKE_INSTALL_LIBDIR}
@ -169,12 +123,6 @@ install(TARGETS ${MODULE_NAME} COMPONENT server EXPORT FreeRDP-ShadowTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
if (WITH_DEBUG_SYMBOLS AND MSVC)
get_target_property(OUTPUT_FILENAME ${MODULE_NAME} OUTPUT_NAME)
install(FILES ${PROJECT_BINARY_DIR}/${OUTPUT_FILENAME}.pdb DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT symbols)
endif()
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Server/shadow") set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Server/shadow")
# command-line executable # command-line executable
@ -184,46 +132,20 @@ set(MODULE_NAME "freerdp-shadow-cli")
set(SRCS set(SRCS
shadow.c) shadow.c)
# On windows create dll version information. AddTargetWithResourceFile(${MODULE_NAME} TRUE "${FREERDP_VERSION}" SRCS)
# Vendor, product and year are already set in top level CMakeLists.txt
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(
${PROJECT_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in
${CMAKE_CURRENT_BINARY_DIR}/version.rc
@ONLY)
set ( SRCS ${SRCS} ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
endif()
add_executable(${MODULE_NAME} ${SRCS})
set(MANPAGE_NAME "${MODULE_NAME}")
if (WITH_BINARY_VERSIONING)
set_target_properties(${MODULE_NAME} PROPERTIES OUTPUT_NAME "${MODULE_NAME}${FREERDP_API_VERSION}")
set(MANPAGE_NAME "${MODULE_NAME}${FREERDP_API_VERSION}")
endif()
list(APPEND LIBS freerdp-shadow-subsystem freerdp-shadow freerdp winpr) list(APPEND LIBS freerdp-shadow-subsystem freerdp-shadow freerdp winpr)
target_link_libraries(${MODULE_NAME} PRIVATE ${LIBS}) target_link_libraries(${MODULE_NAME} PRIVATE ${LIBS})
install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT server) install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT server)
if (WITH_DEBUG_SYMBOLS AND MSVC)
install(FILES ${PROJECT_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${CMAKE_INSTALL_BINDIR}
COMPONENT symbols)
endif()
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Server/shadow") set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Server/shadow")
include(pkg-config-install-prefix) include(pkg-config-install-prefix)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/freerdp-shadow.pc.in ${CMAKE_CURRENT_BINARY_DIR}/freerdp-shadow${FREERDP_VERSION_MAJOR}.pc @ONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/freerdp-shadow.pc.in ${CMAKE_CURRENT_BINARY_DIR}/freerdp-shadow${FREERDP_VERSION_MAJOR}.pc @ONLY)
configure_file(freerdp-shadow-cli.1.in ${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE_NAME}.1)
install_freerdp_man(${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE_NAME}.1 1) generate_and_install_freerdp_man_from_template(${MODULE_NAME} "1" "${FREERDP_API_VERSION}")
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/freerdp-shadow${FREERDP_VERSION_MAJOR}.pc DESTINATION ${PKG_CONFIG_PC_INSTALL_DIR}) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/freerdp-shadow${FREERDP_VERSION_MAJOR}.pc DESTINATION ${PKG_CONFIG_PC_INSTALL_DIR})

View File

@ -341,12 +341,7 @@ endif()
add_subdirectory(include) add_subdirectory(include)
set(MANPAGE_NAME wlog) generate_and_install_freerdp_man_from_template("wlog" "7" "${WINPR_API_VERSION}")
if (WITH_BINARY_VERSIONING)
set(MANPAGE_NAME wlog${WINPR_API_VERSION})
endif()
configure_file(wlog.7.in ${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE_NAME}.7 @ONLY)
install_freerdp_man(${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE_NAME}.7 7)
# Exporting # Exporting
export(PACKAGE winpr) export(PACKAGE winpr)

View File

@ -159,32 +159,11 @@ list(REMOVE_DUPLICATES WINPR_LINK_OPTIONS)
list(REMOVE_DUPLICATES WINPR_LINK_DIRS) list(REMOVE_DUPLICATES WINPR_LINK_DIRS)
list(REMOVE_DUPLICATES WINPR_INCLUDES) list(REMOVE_DUPLICATES WINPR_INCLUDES)
# On windows create dll version information. AddTargetWithResourceFile(${MODULE_NAME} FALSE "${WINPR_VERSION}" WINPR_SRCS)
# Vendor, product and year are already set in top level CMakeLists.txt
if (WIN32)
set (RC_VERSION_MAJOR ${WINPR_VERSION_MAJOR})
set (RC_VERSION_MINOR ${WINPR_VERSION_MINOR})
set (RC_VERSION_BUILD ${WINPR_VERSION_REVISION})
set (RC_VERSION_FILE "${CMAKE_SHARED_LIBRARY_PREFIX}${MODULE_NAME}${WINPR_API_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}" )
configure_file(
${PROJECT_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in
${CMAKE_CURRENT_BINARY_DIR}/version.rc
@ONLY)
set (WINPR_SRCS ${WINPR_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
winpr_library_add_public("shlwapi")
endif()
add_library(${MODULE_NAME} ${WINPR_SRCS})
if (APPLE) if (APPLE)
set_target_properties(${MODULE_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION FALSE) set_target_properties(${MODULE_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION FALSE)
endif() endif()
set_target_properties(${MODULE_NAME} PROPERTIES LINKER_LANGUAGE C)
set_target_properties(${MODULE_NAME} PROPERTIES OUTPUT_NAME ${MODULE_NAME}${WINPR_API_VERSION})
if (WITH_LIBRARY_VERSIONING)
set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION} SOVERSION ${WINPR_API_VERSION})
endif()
if (NOT BUILD_SHARED_LIBS) if (NOT BUILD_SHARED_LIBS)
set(LINK_OPTS_MODE PUBLIC) set(LINK_OPTS_MODE PUBLIC)
@ -204,8 +183,4 @@ install(TARGETS ${MODULE_NAME} COMPONENT libraries EXPORT WinPRTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
if (WITH_DEBUG_SYMBOLS AND MSVC AND BUILD_SHARED_LIBS)
get_target_property(OUTPUT_FILENAME ${MODULE_NAME} OUTPUT_NAME)
install(FILES ${CMAKE_PDB_BINARY_DIR}/${OUTPUT_FILENAME}.pdb DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT symbols)
endif()
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR/libwinpr") set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR/libwinpr")

View File

@ -17,6 +17,10 @@
winpr_module_add(path.c shell.c) winpr_module_add(path.c shell.c)
if (MSVC)
winpr_library_add_public(shlwapi)
endif()
if (IOS) if (IOS)
winpr_module_add(shell_ios.m) winpr_module_add(shell_ios.m)
endif (IOS) endif (IOS)

View File

@ -670,12 +670,6 @@ fail:
return ret; return ret;
} }
#else
#ifdef _MSC_VER
#pragma comment(lib, "shlwapi.lib")
#endif
#endif #endif
BOOL winpr_MoveFile(LPCSTR lpExistingFileName, LPCSTR lpNewFileName) BOOL winpr_MoveFile(LPCSTR lpExistingFileName, LPCSTR lpNewFileName)

View File

@ -85,28 +85,7 @@ list(REMOVE_DUPLICATES WINPR_TOOLS_DEFINITIONS)
list(REMOVE_DUPLICATES WINPR_TOOLS_INCLUDES) list(REMOVE_DUPLICATES WINPR_TOOLS_INCLUDES)
include_directories(${WINPR_TOOLS_INCLUDES}) include_directories(${WINPR_TOOLS_INCLUDES})
# On windows create dll version information. AddTargetWithResourceFile(${MODULE_NAME} FALSE "${WINPR_VERSION}" WINPR_TOOLS_SRCS)
# Vendor, product and year are already set in top level CMakeLists.txt
if (WIN32)
set (RC_VERSION_MAJOR ${WINPR_VERSION_MAJOR})
set (RC_VERSION_MINOR ${WINPR_VERSION_MINOR})
set (RC_VERSION_BUILD ${WINPR_VERSION_REVISION})
set (RC_VERSION_FILE "${CMAKE_SHARED_LIBRARY_PREFIX}${MODULE_NAME}${WINPR_TOOLS_API_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}" )
configure_file(
${PROJECT_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in
${CMAKE_CURRENT_BINARY_DIR}/version.rc
@ONLY)
set (WINPR_TOOLS_SRCS ${WINPR_TOOLS_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
endif()
add_library(${MODULE_NAME} ${WINPR_TOOLS_SRCS})
set_target_properties(${MODULE_NAME} PROPERTIES LINKER_LANGUAGE C)
set_target_properties(${MODULE_NAME} PROPERTIES OUTPUT_NAME ${MODULE_NAME}${WINPR_TOOLS_API_VERSION})
if (WITH_LIBRARY_VERSIONING)
set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_TOOLS_VERSION} SOVERSION ${WINPR_TOOLS_API_VERSION})
endif()
add_definitions(${WINPR_DEFINITIONS}) add_definitions(${WINPR_DEFINITIONS})
target_include_directories(${MODULE_NAME} INTERFACE $<INSTALL_INTERFACE:include/winpr${WINPR_VERSION_MAJOR}>) target_include_directories(${MODULE_NAME} INTERFACE $<INSTALL_INTERFACE:include/winpr${WINPR_VERSION_MAJOR}>)
@ -117,10 +96,6 @@ install(TARGETS ${MODULE_NAME} COMPONENT libraries EXPORT WinPR-toolsTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
if (WITH_DEBUG_SYMBOLS AND MSVC AND BUILD_SHARED_LIBS)
get_target_property(OUTPUT_FILENAME ${MODULE_NAME} OUTPUT_NAME)
install(FILES ${CMAKE_PDB_BINARY_DIR}/${OUTPUT_FILENAME}.pdb DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT symbols)
endif()
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR/Tools") set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR/Tools")
# Add all command line utilities # Add all command line utilities

View File

@ -21,39 +21,13 @@ set(MODULE_PREFIX "WINPR_TOOLS_HASH")
set(${MODULE_PREFIX}_SRCS set(${MODULE_PREFIX}_SRCS
hash.c) hash.c)
# On windows create dll version information. AddTargetWithResourceFile(${MODULE_NAME} TRUE "${WINPR_VERSION}" ${MODULE_PREFIX}_SRCS)
# Vendor, product and year are already set in top level CMakeLists.txt
if (WIN32)
set(RC_VERSION_MAJOR ${WINPR_VERSION_MAJOR})
set(RC_VERSION_MINOR ${WINPR_VERSION_MINOR})
set(RC_VERSION_BUILD ${WINPR_VERSION_REVISION})
set(RC_VERSION_FILE "${MODULE_NAME}${CMAKE_EXECUTABLE_SUFFIX}")
configure_file(
${PROJECT_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()
add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
set(${MODULE_PREFIX}_LIBS winpr) set(${MODULE_PREFIX}_LIBS winpr)
set(MANPAGE_NAME "${MODULE_NAME}")
if (WITH_BINARY_VERSIONING)
set_target_properties(${MODULE_NAME} PROPERTIES OUTPUT_NAME "${MODULE_NAME}${WINPR_API_VERSION}")
set(MANPAGE_NAME "${MODULE_NAME}${WINPR_API_VERSION}")
endif()
target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT tools EXPORT WinPRTargets) install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT tools EXPORT WinPRTargets)
if (WITH_DEBUG_SYMBOLS AND MSVC)
install(FILES ${PROJECT_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT symbols)
endif()
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR/Tools") set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR/Tools")
configure_file(winpr-hash.1.in ${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE_NAME}.1) generate_and_install_freerdp_man_from_template(${MODULE_NAME} "1" "${WINPR_API_VERSION}")
install_freerdp_man(${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE_NAME}.1 1)

View File

@ -22,42 +22,14 @@ set(MODULE_PREFIX "WINPR_MAKECERT")
set(${MODULE_PREFIX}_SRCS set(${MODULE_PREFIX}_SRCS
main.c) main.c)
# On windows create dll version information. AddTargetWithResourceFile(${MODULE_NAME} TRUE "${WINPR_VERSION}" ${MODULE_PREFIX}_SRCS)
# Vendor, product and year are already set in top level CMakeLists.txt
if (WIN32)
set(RC_VERSION_MAJOR ${WINPR_VERSION_MAJOR})
set(RC_VERSION_MINOR ${WINPR_VERSION_MINOR})
set(RC_VERSION_BUILD ${WINPR_VERSION_REVISION})
set(RC_VERSION_FILE "${MODULE_NAME}${CMAKE_EXECUTABLE_SUFFIX}")
configure_file(
${PROJECT_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()
add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
set(${MODULE_PREFIX}_LIBS winpr-tools) set(${MODULE_PREFIX}_LIBS winpr-tools)
target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS} winpr) target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS} winpr)
set(MANPAGE_NAME ${MODULE_NAME})
if (WITH_BINARY_VERSIONING)
set_target_properties(${MODULE_NAME}
PROPERTIES
OUTPUT_NAME "${MODULE_NAME}${WINPR_API_VERSION}"
)
set(MANPAGE_NAME ${MODULE_NAME}${WINPR_API_VERSION})
endif()
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR/Tools") set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR/Tools")
install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT tools EXPORT WinPRTargets) install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT tools EXPORT WinPRTargets)
if (WITH_DEBUG_SYMBOLS AND MSVC)
install(FILES ${CMAKE_PDB_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT symbols)
endif()
configure_file(winpr-makecert.1.in ${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE_NAME}.1) generate_and_install_freerdp_man_from_template(${MODULE_NAME} "1" "${WINPR_API_VERSION}")
install_freerdp_man(${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE_NAME}.1 1)

View File

@ -32,13 +32,7 @@ endif()
winpr_tools_module_add(${${MODULE_PREFIX}_SRCS}) winpr_tools_module_add(${${MODULE_PREFIX}_SRCS})
if(OPENSSL_FOUND) if(OPENSSL_FOUND)
if(WIN32)
list(APPEND ${MODULE_PREFIX}_LIBS ${OPENSSL_LIBRARIES}) list(APPEND ${MODULE_PREFIX}_LIBS ${OPENSSL_LIBRARIES})
else()
# if ${OPENSSL_LIBRARIES} libssl and libcrypto is linked
# therefor explicitly link against libcrypto
list(APPEND ${MODULE_PREFIX}_LIBS ${OPENSSL_CRYPTO_LIBRARIES})
endif()
endif() endif()
if(MBEDTLS_FOUND) if(MBEDTLS_FOUND)