From c01de98bf70184c368bfe79777ca7e5d95649411 Mon Sep 17 00:00:00 2001 From: Christoph Egger Date: Mon, 10 Feb 2014 16:53:03 +0100 Subject: [PATCH] Switch to cmake --- CMakeLists.txt | 40 ++++++++++++++++++++++++++++++++++++++++ Makefile | 31 ------------------------------- 2 files changed, 40 insertions(+), 31 deletions(-) create mode 100644 CMakeLists.txt delete mode 100644 Makefile diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..c6219ab --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,40 @@ +cmake_minimum_required(VERSION 2.8.9) +PROJECT(qtlldb) + +set(CMAKE_VERBOSE_MAKEFILE on) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +find_package(Qt5Widgets) +find_package(Qt5 CONFIG REQUIRED Widgets Gui) + +execute_process(COMMAND llvm-config-3.4 --cflags OUTPUT_VARIABLE LLVM_CFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE) +execute_process(COMMAND llvm-config-3.4 --ldflags OUTPUT_VARIABLE LLVM_LDFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE) +execute_process(COMMAND llvm-config-3.4 --libs OUTPUT_VARIABLE LLVM_LIBS OUTPUT_STRIP_TRAILING_WHITESPACE) + +separate_arguments(LLVM_CFLAGS) +add_compile_options(${LLVM_CFLAGS}) +add_compile_options(-std=c++11 -Wall) + +separate_arguments(LLVM_LDFLAGS) +separate_arguments(LLVM_LIBS) + +set(CMAKE_CXX_COMPILER "clang++") + +SET(qtlldb_SOURCES src/Binary.cxx src/main.cxx src/gui/Mainwindow.cxx) +SET(qtlldb_HEADERS src/Binary.hxx src/include.hxx src/Section.hxx src/gui/Mainwindow.h++) + +ADD_EXECUTABLE(qtlldb ${qtlldb_SOURCES} ${qtlldb_HEADERS_MOC}) + + +set(CMAKE_LD_FLAGS "${LLVM_LDFLAGS}") +set(CMAKE_LIBS "${LLVM_LIBS}") + +ADD_DEFINITIONS(${QT_DEFINITIONS}) + +qt5_use_modules(qtlldb Widgets) +INCLUDE_DIRECTORIES("src") + + +TARGET_LINK_LIBRARIES(qtlldb ${QT_LIBRARIES} ${LLVM_LDFLAGS} ${LLVM_LIBS}) diff --git a/Makefile b/Makefile deleted file mode 100644 index a32233b..0000000 --- a/Makefile +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/make -f - -CXX = clang++ -LD = clang++ - -CXXFLAGS += $(shell llvm-config-3.4 --cflags) $(shell pkg-config QtGui --cflags) -Isrc -std=c++0x -LDFLAGS += $(shell llvm-config-3.4 --ldflags) -LIBS += $(shell llvm-config-3.4 --libs) $(shell pkg-config QtGui --libs) - -objects = $(patsubst %.cxx,%.o,$(shell find src -name \*.cxx)) $(patsubst %.h++,%_moc.o,$(shell find src -name \*.h++)) - -qtlldb: $(objects) - $(LD) -o qtlldb $(LDFLAGS) $^ $(LIBS) - -.cxx.o: - $(CXX) -MM -o $*.make $(CXXFLAGS) $< - $(CXX) -o $@ -c $(CXXFLAGS) $< - -.cpp.o: - $(CXX) -MM -o $*.make $(CXXFLAGS) $< - $(CXX) -o $@ -c $(CXXFLAGS) $< - -clean: - rm $(objects) qtlldb - -%_moc.cpp: %.h++ - moc $< -o $@ - -include **/*.make - -.SUFFIXES: .cxx .o -- 2.39.5