aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorNao Pross <naopross@thearcway.org>2017-12-18 00:00:21 +0100
committerNao Pross <naopross@thearcway.org>2017-12-18 00:00:21 +0100
commit2e27a93e3ed189b4d96ec7df6e05b102dd2e841a (patch)
tree6952edd5db3b4075532c4ce75bda764d5a67051b /CMakeLists.txt
parentUpdate .gitignore and minor changes (mostly formatting) (diff)
downloadOrbitingYeti-2e27a93e3ed189b4d96ec7df6e05b102dd2e841a.tar.gz
OrbitingYeti-2e27a93e3ed189b4d96ec7df6e05b102dd2e841a.zip
Replace tabs with spaces, set up CMake build system
Other changes: - update gitignore - build scripts under `etc` - fix window
Diffstat (limited to '')
-rw-r--r--CMakeLists.txt48
1 files changed, 48 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..2a32638
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,48 @@
+cmake_minimum_required(VERSION 3.7)
+
+#######################################################################
+# B-Circuit
+project(OrbitingYeti)
+
+## Version
+set(OrbitingYeti_VERSION_MAJOR 0)
+set(OrbitingYeti_VERSION_MINOR 1)
+
+## Libraries
+
+# qt5
+
+# 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)
+
+find_package(Qt5Core REQUIRED)
+find_package(Qt5Widgets REQUIRED)
+
+add_definitions(${Qt5Core_DEFINITIONS})
+add_definitions(${Qt5Widgets_DEFINITIONS})
+
+include_directories(${Qt5core_INCLUDES})
+include_directories(${Qt5Widgets_INCLUDES})
+
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
+
+## Compiler
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall")
+set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wall -Werror")
+
+## Source code
+include_directories(${CMAKE_SOURCE_DIR}/inc)
+file(GLOB_RECURSE SOURCES ${CMAKE_SOURCE_DIR} "src/*.cpp")
+
+## Executable
+add_executable(OrbitingYeti ${SOURCES})
+target_link_libraries(OrbitingYeti Qt5::Core Qt5::Widgets)
+
+## Toolchain
+# enable useful output for linters
+set(CMAKE_EXPORT_COMPILE_COMMANDS ON)