[cmake] add UWAC_FORCE_STATIC_BUILD
since uwac is only used by wlfreerdp add an option to directly link it with -DUWAC_FORCE_STATIC_BUILD=ON without installing any header or library
This commit is contained in:
parent
e8f5f90603
commit
e67b6765a1
@ -54,6 +54,7 @@ if (NOT FREERDP_UNIFIED_BUILD)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
option(UWAC_FORCE_STATIC_BUILD "Force UWAC to be build as static libary" OFF)
|
||||
option(UWAC_HAVE_PIXMAN_REGION "Use PIXMAN or FreeRDP for region calculations" "NOT FREERDP_UNIFIED_BUILD")
|
||||
|
||||
# Include our extra modules
|
||||
@ -70,6 +71,13 @@ if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "project default" FORCE)
|
||||
endif()
|
||||
|
||||
if (UWAC_FORCE_STATIC_BUILD)
|
||||
set(BUILD_SHARED_LIBS OFF)
|
||||
else()
|
||||
include(SetFreeRDPCMakeInstallDir)
|
||||
include(CMakePackageConfigHelpers)
|
||||
endif()
|
||||
|
||||
if (NOT IOS)
|
||||
include(CheckIncludeFiles)
|
||||
check_include_files(stdbool.h UWAC_HAVE_STDBOOL_H)
|
||||
|
@ -15,11 +15,12 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/
|
||||
DESTINATION ${UWAC_INCLUDE_DIR}
|
||||
FILES_MATCHING PATTERN "*.h")
|
||||
|
||||
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/
|
||||
DESTINATION ${UWAC_INCLUDE_DIR}
|
||||
FILES_MATCHING PATTERN "*.h")
|
||||
if (NOT UWAC_FORCE_STATIC_BUILD)
|
||||
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/
|
||||
DESTINATION ${UWAC_INCLUDE_DIR}
|
||||
FILES_MATCHING PATTERN "*.h")
|
||||
|
||||
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/
|
||||
DESTINATION ${UWAC_INCLUDE_DIR}
|
||||
FILES_MATCHING PATTERN "*.h")
|
||||
endif()
|
||||
|
@ -77,7 +77,6 @@ if (WITH_LIBRARY_VERSIONING)
|
||||
set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${UWAC_VERSION} SOVERSION ${UWAC_API_VERSION})
|
||||
endif()
|
||||
|
||||
target_include_directories(${MODULE_NAME} INTERFACE $<INSTALL_INTERFACE:include/uwac${UWAC_API_VERSION}>)
|
||||
target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS} PRIVATE ${WAYLAND_LIBS} ${XKBCOMMON_LIBS} ${EPOLLSHIM_LIBS})
|
||||
if (UWAC_HAVE_PIXMAN_REGION)
|
||||
target_link_libraries(${MODULE_NAME} PRIVATE ${pixman_LINK_LIBRARIES})
|
||||
@ -85,10 +84,14 @@ else()
|
||||
target_link_libraries(${MODULE_NAME} PRIVATE freerdp)
|
||||
endif()
|
||||
|
||||
install(TARGETS ${MODULE_NAME} COMPONENT libraries EXPORT uwac
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
if (NOT UWAC_FORCE_STATIC_BUILD)
|
||||
target_include_directories(${MODULE_NAME} INTERFACE $<INSTALL_INTERFACE:include/uwac${UWAC_API_VERSION}>)
|
||||
|
||||
install(TARGETS ${MODULE_NAME} COMPONENT libraries EXPORT uwac
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
endif()
|
||||
|
||||
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "uwac")
|
||||
|
||||
|
@ -1,26 +1,29 @@
|
||||
set(UWAC_INCLUDE_DIR "include/uwac${UWAC_VERSION_MAJOR}")
|
||||
# cmake package
|
||||
export(PACKAGE uwac)
|
||||
|
||||
SetFreeRDPCMakeInstallDir(UWAC_CMAKE_INSTALL_DIR "uwac${UWAC_VERSION_MAJOR}")
|
||||
if (NOT UWAC_FORCE_STATIC_BUILD)
|
||||
# cmake package
|
||||
export(PACKAGE uwac)
|
||||
|
||||
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)
|
||||
SetFreeRDPCMakeInstallDir(UWAC_CMAKE_INSTALL_DIR "uwac${UWAC_VERSION_MAJOR}")
|
||||
|
||||
write_basic_package_version_file(
|
||||
${CMAKE_CURRENT_BINARY_DIR}/uwacConfigVersion.cmake
|
||||
VERSION ${UWAC_VERSION}
|
||||
COMPATIBILITY SameMajorVersion)
|
||||
|
||||
install(FILES
|
||||
configure_package_config_file(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/uwacConfig.cmake.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/uwacConfig.cmake
|
||||
${CMAKE_CURRENT_BINARY_DIR}/uwacConfigVersion.cmake
|
||||
DESTINATION ${UWAC_CMAKE_INSTALL_DIR})
|
||||
INSTALL_DESTINATION ${UWAC_CMAKE_INSTALL_DIR}
|
||||
PATH_VARS UWAC_INCLUDE_DIR)
|
||||
|
||||
install(EXPORT uwac DESTINATION ${UWAC_CMAKE_INSTALL_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)
|
||||
@ -35,8 +38,10 @@ configure_file(buildflags.h.in ${CMAKE_CURRENT_BINARY_DIR}/../include/uwac/build
|
||||
configure_file(build-config.h.in ${CMAKE_CURRENT_BINARY_DIR}/../include/uwac/build-config.h)
|
||||
configure_file(config.h.in ${CMAKE_CURRENT_BINARY_DIR}/../include/uwac/config.h)
|
||||
|
||||
include(pkg-config-install-prefix)
|
||||
configure_file(uwac.pc.in ${CMAKE_CURRENT_BINARY_DIR}/uwac${UWAC_VERSION_MAJOR}.pc @ONLY)
|
||||
if (NOT UWAC_FORCE_STATIC_BUILD)
|
||||
include(pkg-config-install-prefix)
|
||||
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 ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
||||
set(UWAC_INSTALL_INCLUDE_DIR ${UWAC_INCLUDE_DIR}/uwac)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/uwac${UWAC_VERSION_MAJOR}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
||||
endif()
|
||||
|
Loading…
Reference in New Issue
Block a user