FreeRDP/uwac/templates/CMakeLists.txt
2024-10-24 11:26:17 +02:00

55 lines
2.0 KiB
CMake

set(UWAC_INCLUDE_DIR "include/uwac${UWAC_VERSION_MAJOR}")
if (NOT UWAC_FORCE_STATIC_BUILD)
# cmake package
export(PACKAGE uwac)
SetFreeRDPCMakeInstallDir(UWAC_CMAKE_INSTALL_DIR "uwac${UWAC_VERSION_MAJOR}")
configure_package_config_file(
${CMAKE_CURRENT_SOURCE_DIR}/uwacConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/uwacConfig.cmake
INSTALL_DESTINATION ${UWAC_CMAKE_INSTALL_DIR}
PATH_VARS UWAC_INCLUDE_DIR)
write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/uwacConfigVersion.cmake
VERSION ${UWAC_VERSION}
COMPATIBILITY SameMajorVersion)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/uwacConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/uwacConfigVersion.cmake
DESTINATION ${UWAC_CMAKE_INSTALL_DIR})
install(EXPORT uwac DESTINATION ${UWAC_CMAKE_INSTALL_DIR})
endif()
set(UWAC_BUILD_CONFIG_LIST "")
GET_CMAKE_PROPERTY(res VARIABLES)
FOREACH(var ${res})
IF (var MATCHES "^WITH_*|^BUILD_TESTING*|^UWAC_HAVE_*")
LIST(APPEND UWAC_BUILD_CONFIG_LIST "${var}=${${var}}")
ENDIF()
ENDFOREACH()
set(C_FLAGS ${CMAKE_C_FLAGS})
if (CMAKE_BUILD_TYPE)
string(TOUPPER "${CMAKE_BUILD_TYPE}" CAPS_BUILD_TYPE)
string(APPEND C_FLAGS " ${CMAKE_C_FLAGS_${CAPS_BUILD_TYPE}}")
endif()
string(REPLACE ";" " " UWAC_BUILD_CONFIG "${UWAC_BUILD_CONFIG_LIST}")
cleaning_configure_file(version.h.in ${CMAKE_CURRENT_BINARY_DIR}/../include/uwac/version.h)
cleaning_configure_file(buildflags.h.in ${CMAKE_CURRENT_BINARY_DIR}/../include/uwac/buildflags.h)
cleaning_configure_file(build-config.h.in ${CMAKE_CURRENT_BINARY_DIR}/../include/uwac/build-config.h)
cleaning_configure_file(config.h.in ${CMAKE_CURRENT_BINARY_DIR}/../include/uwac/config.h)
if (NOT UWAC_FORCE_STATIC_BUILD)
include(pkg-config-install-prefix)
cleaning_configure_file(uwac.pc.in ${CMAKE_CURRENT_BINARY_DIR}/uwac${UWAC_VERSION_MAJOR}.pc @ONLY)
set(UWAC_INSTALL_INCLUDE_DIR ${UWAC_INCLUDE_DIR}/uwac)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/uwac${UWAC_VERSION_MAJOR}.pc DESTINATION ${PKG_CONFIG_PC_INSTALL_DIR})
endif()