You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
2.0 KiB

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
# PNG
find_package(ZLIB REQUIRED)
find_package(PNG REQUIRED)
# the source files
file(GLOB SOURCE_FILES
"*.h"
"*.cpp"
"lib/*.h"
"lib/*.cpp"
)
find_package(Qt5 REQUIRED COMPONENTS Core Widgets Gui Network Svg Xml WebEngineWidgets WebChannel Maemo5)
qt5_add_resources(RESOURCES assets.qrc assets/images/flags/flags.qrc)
set(EXECUTABLE_FLAG)
add_executable(conversations ${EXECUTABLE_FLAG} main.cpp
${SOURCE_FILES}
${RESOURCES}
)
set_property(TARGET conversations PROPERTY RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
target_include_directories(conversations PUBLIC ${Qt5Gui_PRIVATE_INCLUDE_DIRS})
target_include_directories(conversations PUBLIC
${CMAKE_SOURCE_DIR}/src
${X11_INCLUDE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${Qt5Core_INCLUDE_DIRS}
${Qt5Widgets_INCLUDE_DIRS}
${Qt5Gui_INCLUDE_DIRS}
${Qt5Network_INCLUDE_DIRS}
${Qt5Svg_INCLUDE_DIRS}
${Qt5Xml_INCLUDE_DIRS}
)
add_definitions(${QT_DEFINITIONS})
if(NOT "${CMAKE_BUILD_TYPE}" EQUAL "Debug")
add_definitions(-DQT_NO_DEBUG)
endif()
target_compile_definitions(conversations
PUBLIC
${Qt5Core_DEFINITIONS}
${Qt5Widgets_DEFINITIONS}
${Qt5Gui_DEFINITIONS}
${Qt5Network_DEFINITIONS}
${Qt5Svg_DEFINITIONS}
${Qt5Xml_DEFINITIONS}
)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
target_link_libraries(conversations PUBLIC
${CMAKE_DL_LIBS}
Qt5::Core
Qt5::Widgets
Qt5::Gui
Qt5::Network
Qt5::Svg
Qt5::Xml
Qt5::WebEngineWidgets
Qt5::WebChannel
Qt5::Maemo5
Threads::Threads
)
if(X11_FOUND)
target_link_libraries(conversations PUBLIC ${X11_LIBRARIES})
endif()
install(TARGETS conversations
DESTINATION ${CMAKE_INSTALL_PREFIX}
)