From d2f8c31e5652bd6143bd42fd4db9e29dcbe4339b Mon Sep 17 00:00:00 2001 From: David Gow Date: Wed, 26 Mar 2014 23:57:37 +0800 Subject: [PATCH] CMake support. We don't have to use it, but it's there if we do. --- src/CMakeLists.txt | 43 +++++++++++++++++++++++++++++++++++++++++++ src/main.cpp | 2 +- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 src/CMakeLists.txt diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..8582b7f --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,43 @@ +cmake_minimum_required(VERSION 2.8) + +include(FindPkgConfig) +pkg_search_module(SDL2 REQUIRED sdl2) + +project(ipdf) + +set(CMAKE_CXX_FLAGS "-std=gnu++0x") + +include_directories(${SDL2_INCLUDE_DIRS}) + +add_library(ipdflib +common.h +log.h +log.cpp +ipdf.h +view.h +view.cpp +document.h +document.cpp +screen.h +screen.cpp +) + +add_executable(ipdf +main.cpp +) + +target_link_libraries(ipdf +ipdflib +GL +${SDL2_LIBRARIES} +) + +add_executable(ipdf-testsaveload +tests/saveload.cpp +) + +target_link_libraries(ipdf-testsaveload +ipdflib +GL +${SDL2_LIBRARIES} +) diff --git a/src/main.cpp b/src/main.cpp index 5fa94b7..2a85c14 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -11,7 +11,7 @@ int main(int argc, char ** argv) { Document doc; srand(time(NULL)); - doc.Add(Random(), Random(), Random(), Random()); + doc.Add(RECT_FILLED, Rect(Random(), Random(), Random(), Random())); View view(doc); -- 2.20.1