forked from jbagg/QtZeroConf
Add CMake project for example
This commit is contained in:
@ -144,3 +144,7 @@ install(TARGETS QtZeroConf
|
|||||||
LIBRARY DESTINATION lib
|
LIBRARY DESTINATION lib
|
||||||
PUBLIC_HEADER DESTINATION include/QtZeroConf
|
PUBLIC_HEADER DESTINATION include/QtZeroConf
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(BUILD_EXAMPLE)
|
||||||
|
add_subdirectory(example)
|
||||||
|
endif()
|
||||||
|
@ -34,6 +34,9 @@ QZeroConf can be built directly into your project if your project is [LGPL3](htt
|
|||||||
Use `BUILD_SHARED_LIBS` to control whether QZeroConf should be built as static (`-DBUILD_SHARED_LIBS=OFF`) or as shared (`-DBUILD_SHARED_LIBS=ON`) library.
|
Use `BUILD_SHARED_LIBS` to control whether QZeroConf should be built as static (`-DBUILD_SHARED_LIBS=OFF`) or as shared (`-DBUILD_SHARED_LIBS=ON`) library.
|
||||||
The default is `OFF`.
|
The default is `OFF`.
|
||||||
|
|
||||||
|
You can also build the included example project by setting `BUILD_EXAMPLE` to `ON`.
|
||||||
|
The default for this is `OFF`
|
||||||
|
|
||||||
### API
|
### API
|
||||||
|
|
||||||
#### Service Publishing
|
#### Service Publishing
|
||||||
|
25
example/CMakeLists.txt
Normal file
25
example/CMakeLists.txt
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
project(QtZeroConfExample)
|
||||||
|
cmake_minimum_required(VERSION 2.8.11)
|
||||||
|
|
||||||
|
find_package(Qt5 COMPONENTS Gui Widgets REQUIRED)
|
||||||
|
|
||||||
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||||
|
set(CMAKE_AUTOMOC ON)
|
||||||
|
set(CMAKE_AUTOUIC ON)
|
||||||
|
set(CMAKE_AUTORCC ON)
|
||||||
|
|
||||||
|
# Find QtZeroConf library if we're building standalone
|
||||||
|
if(NOT TARGET QtZeroConf)
|
||||||
|
find_package(QtZeroConf CONFIG REQUIRED)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_executable(QtZeroConfExample
|
||||||
|
window.h
|
||||||
|
window.cpp
|
||||||
|
main.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(QtZeroConfExample
|
||||||
|
QtZeroConf
|
||||||
|
Qt5::Gui Qt5::Widgets
|
||||||
|
)
|
Reference in New Issue
Block a user