diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 62 |
1 files changed, 50 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index e6a6ae4..8c9956a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,28 +1,61 @@ +# Ousía +# Copyright (C) 2014 Benjamin Paaßen, Andreas Stöckel +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +################################################################################ +# Basic Project Definitions and Dependencies # +################################################################################ + PROJECT(basicwriter) CMAKE_MINIMUM_REQUIRED(VERSION 2.8.9) SET(CMAKE_AUTOMOC ON) FIND_PACKAGE(Qt5Widgets REQUIRED) -# Enable C++11 and all warnings -SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -std=c++11") - # Option for enabling testing. Turn on with 'cmake -Dtest=ON'. OPTION(test "Build all tests." OFF) # Makes boolean 'test' available. +# Enable C++11 and all warnings +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -Wall -pedantic -std=c++11") + +################################################################################ +# Inclusion of gtest # +################################################################################ + # Unit test handling -if(test) +IF(test) # Compile gtest - add_subdirectory(lib/gtest-1.7.0) + ADD_SUBDIRECTORY(lib/gtest-1.7.0) # Enable testing and declare some variables used for compiling the test cases - enable_testing() - set(GTEST_INCLUDE_DIR ${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR}) - set(GTEST_LIBRARIES gtest gtest_main) -endif() + ENABLE_TESTING() + SET(GTEST_INCLUDE_DIR ${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR}) + SET(GTEST_LIBRARIES gtest gtest_main) +ENDIF() -INCLUDE_DIRECTORIES(src/) +################################################################################ +# Commands for building Ousía # +################################################################################ + +# Includ directories +INCLUDE_DIRECTORIES( + src/ +) +# ousia_core library (containing the code of the most important data structures +# and deduction algorithms) ADD_LIBRARY(ousia_core src/model/GraphNode src/model/domain/Structure @@ -34,17 +67,21 @@ ADD_LIBRARY(ousia_core src/model/types/Value ) +# Definition of the main program ADD_EXECUTABLE(ousia src/main ) +# Link the ousia executable against ousia_core TARGET_LINK_LIBRARIES(ousia ousia_core ) +# Link the ousia executable against the Widgets module of Qt5 QT5_USE_MODULES(ousia Widgets) -if(test) +# If testing is enabled, build the unit tests +IF(test) # Include the gtest include files and the src directory INCLUDE_DIRECTORIES( ${GTEST_INCLUDE_DIR} @@ -53,6 +90,7 @@ if(test) # Add all unit test files ADD_EXECUTABLE(ousia_test + test/model/RangeSet test/model/GraphNode test/model/domain/Layer ) @@ -64,5 +102,5 @@ if(test) # Register the unit test ADD_TEST(ousia_test ousia_test) -endif() +ENDIF() |