mirror of
https://github.com/arcan1s/reportabug.git
synced 2025-04-24 15:27:18 +00:00
77 lines
2.9 KiB
CMake
77 lines
2.9 KiB
CMake
# set files
|
|
set (SOURCES main.cpp reportabug.cpp)
|
|
set (HEADERS reportabug.h)
|
|
set (FORMS reportabug.ui)
|
|
if (ENABLE_GITHUB OR USE_OWN_TOKEN)
|
|
set (SOURCES ${SOURCES} githubmodule.cpp)
|
|
set (HEADERS ${HEADERS} githubmodule.h)
|
|
endif ()
|
|
if (ENABLE_GITREPORT)
|
|
set (SOURCES ${SOURCES} gitreportmodule.cpp)
|
|
set (HEADERS ${HEADERS} gitreportmodule.h)
|
|
endif ()
|
|
|
|
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
|
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/inconfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/inconfig.h)
|
|
|
|
# include_path
|
|
include_directories (${CMAKE_CURRENT_BINARY_DIR}/../
|
|
${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR}
|
|
${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
if (USE_QT5)
|
|
find_package (Qt5Core REQUIRED)
|
|
find_package (Qt5Widgets REQUIRED)
|
|
find_package (Qt5Network REQUIRED)
|
|
add_definitions (${Qt5Core_DEFINITIONS})
|
|
add_definitions (${Qt5Widgets_DEFINITIONS})
|
|
add_definitions (${Qt5Network_DEFINITIONS})
|
|
include_directories (${Qt5Core_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS})
|
|
set (QT_USED_LIBRARIES ${Qt5Core_LIBRARIES} ${Qt5Widgets_LIBRARIES} ${Qt5Network_LIBRARIES})
|
|
if (ENABLE_GITREPORT)
|
|
find_package (Qt5WebKit REQUIRED)
|
|
find_package (Qt5WebKitWidgets REQUIRED)
|
|
add_definitions (${Qt5WebKit_DEFINITIONS})
|
|
add_definitions (${Qt5WebKitWidgets_DEFINITIONS})
|
|
include_directories (${Qt5WebKit_INCLUDE_DIRS} ${Qt5WebKitWidgets_INCLUDE_DIRS})
|
|
set (QT_USED_LIBRARIES ${QT_USED_LIBRARIES} ${Qt5WebKit_LIBRARIES} ${Qt5WebKitWidgets_LIBRARIES})
|
|
endif ()
|
|
qt5_wrap_cpp (MOC_SOURCES ${HEADERS})
|
|
qt5_wrap_ui (UI_HEADERS ${FORMS})
|
|
|
|
source_group ("Header Files" FILES ${HEADERS})
|
|
source_group ("Source Files" FILES ${SOURCES})
|
|
source_group ("Generated Files" FILES ${MOC_SOURCES})
|
|
|
|
else ()
|
|
set (QT_USED_COMPONENTS QtCore QtGui QtNetwork)
|
|
if (ENABLE_GITREPORT)
|
|
set (QT_USED_COMPONENTS ${QT_USED_COMPONENTS} QtWebKit)
|
|
endif ()
|
|
find_package(Qt4 COMPONENTS ${QT_USED_COMPONENTS} REQUIRED)
|
|
include (${QT_USE_FILE})
|
|
set (QT_USED_LIBRARIES ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTNETWORK_LIBRARY})
|
|
if (ENABLE_GITREPORT)
|
|
set (QT_USED_LIBRARIES ${QT_USED_LIBRARIES} ${QT_QTWEBKIT_LIBRARY})
|
|
endif ()
|
|
qt4_wrap_cpp (MOC_SOURCES ${HEADERS})
|
|
qt4_wrap_ui (UI_HEADERS ${FORMS})
|
|
endif()
|
|
|
|
source_group ("Header Files" FILES ${HEADERS})
|
|
source_group ("Source Files" FILES ${SOURCES})
|
|
source_group ("Generated Files" FILES ${MOC_SOURCES})
|
|
|
|
if (BUILD_AS_LIBRARY)
|
|
add_library (${SUBPROJECT} SHARED ${SOURCES} ${HEADERS} ${MOC_SOURCES})
|
|
else ()
|
|
add_executable (${SUBPROJECT} ${UI_HEADERS} ${HEADERS} ${SOURCES} ${MOC_SOURCES})
|
|
endif ()
|
|
target_link_libraries (${SUBPROJECT} ${QT_USED_LIBRARIES})
|
|
# install properties
|
|
if (BUILD_AS_LIBRARY)
|
|
install (TARGETS ${SUBPROJECT} DESTINATION lib)
|
|
else ()
|
|
install (TARGETS ${SUBPROJECT} DESTINATION bin)
|
|
endif ()
|