summaryrefslogtreecommitdiff
path: root/test/syntax/code/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'test/syntax/code/cmake')
-rw-r--r--test/syntax/code/cmake19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/syntax/code/cmake b/test/syntax/code/cmake
new file mode 100644
index 00000000..2bbea38c
--- /dev/null
+++ b/test/syntax/code/cmake
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.8)
+project(cmake_example)
+
+# Show message on Linux platform
+if (${CMAKE_SYSTEM_NAME} MATCHES Linux)
+ message("Good choice, bro!")
+endif()
+
+# Tell CMake to run moc when necessary:
+set(CMAKE_AUTOMOC ON)
+# As moc files are generated in the binary dir,
+# tell CMake to always look for includes there:
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+# Widgets finds its own dependencies.
+find_package(Qt5Widgets REQUIRED)
+
+add_executable(myproject main.cpp mainwindow.cpp)
+qt5_use_modules(myproject Widgets)