whyblocked/CMakeLists.txt

61 lines
1.8 KiB
CMake
Raw Normal View History

cmake_minimum_required (VERSION 3.6)
2018-08-30 08:03:25 -04:00
project (whyblocked
2018-10-19 19:44:25 -04:00
VERSION 0.10.5
2018-08-30 08:03:25 -04:00
LANGUAGES CXX
)
include(GNUInstallDirs)
find_package(PkgConfig REQUIRED)
pkg_check_modules(LIBXDG_BASEDIR REQUIRED libxdg-basedir)
find_package(Qt5Core CONFIG REQUIRED)
if(NOT WITHOUT_GUI)
find_package(Qt5Widgets CONFIG REQUIRED)
endif()
2018-08-30 08:03:25 -04:00
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -g -Og")
2018-10-06 15:33:02 -04:00
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
2018-08-30 08:03:25 -04:00
include_directories(${PROJECT_BINARY_DIR})
include_directories(${LIBXDG_BASEDIR_INCLUDE_DIRS})
link_directories(${LIBXDG_BASEDIR_LIBRARY_DIRS})
# Write version in header
configure_file (
"${PROJECT_SOURCE_DIR}/src/version.hpp.in"
"${PROJECT_BINARY_DIR}/version.hpp"
)
2018-10-06 15:33:02 -04:00
add_executable(whyblocked src/interface_text.cpp src/whyblocked.cpp)
2018-08-30 08:03:25 -04:00
target_link_libraries(whyblocked
${LIBXDG_BASEDIR_LIBRARIES} vsqlitepp stdc++fs Qt5::Core)
2018-08-30 08:03:25 -04:00
install(TARGETS whyblocked DESTINATION ${CMAKE_INSTALL_BINDIR})
2018-08-30 13:51:46 -04:00
if(NOT WITHOUT_GUI)
add_executable(whyblocked-gui src/interface_qt.cpp src/whyblocked.cpp
${QM_FILES})
target_link_libraries(whyblocked-gui
${LIBXDG_BASEDIR_LIBRARIES} vsqlitepp stdc++fs
Qt5::Widgets)
install(TARGETS whyblocked-gui DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES de.tastytea.Whyblocked.desktop DESTINATION
${CMAKE_INSTALL_DATAROOTDIR}/applications)
2018-10-19 18:34:00 -04:00
install(FILES de.tastytea.Whyblocked.svg DESTINATION
${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps)
install(FILES ${QM_FILES} DESTINATION
${CMAKE_INSTALL_DATAROOTDIR}/qt5/translations)
2018-10-06 19:44:59 -04:00
endif()
2018-10-06 15:33:02 -04:00
2018-10-20 01:19:14 -04:00
if(NOT WITHOUT_TRANSLATIONS)
add_subdirectory(translations)
2018-08-30 13:51:46 -04:00
endif()
2018-10-20 01:19:14 -04:00
include(packages.CMakeLists.txt)