Commit 03675aa2 authored by Wouter's avatar Wouter

Move default CMakeLists.txt to use Qt5, CMake 3.0+

Much cleaner
parent ce23b977
......@@ -2,10 +2,12 @@
{% with project.id|identifier as id %}
project({{ id }})
cmake_minimum_required(VERSION 2.8)
find_package(Qt4 4.8.0 COMPONENTS QtCore REQUIRED)
cmake_minimum_required(VERSION 3.0)
include_directories(${QT_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
find_package(Qt5Core REQUIRED)
SET({{ id }}_SRCS ${% templatetag openbrace %}{{ id }}_SRCS{% templatetag closebrace %}
{% filter indent:4 %}
......@@ -20,9 +22,7 @@ SET({{ id }}_SRCS ${% templatetag openbrace %}{{ id }}_SRCS{% templatetag close
{% endfilter %}
)
qt4_automoc(${% templatetag openbrace %}{{ id }}_SRCS{% templatetag closebrace %})
add_library({{ id }} SHARED ${% templatetag openbrace %}{{ id }}_SRCS{% templatetag closebrace %})
target_link_libraries({{ id }} ${QT_QTCORE_LIBRARY})
target_link_libraries({{ id }} Qt5::Core)
{% endwith %}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment