From e7102bf755210f9e215fb048b637dda6bab96334 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Fri, 7 Dec 2012 07:33:05 +0000 Subject: [PATCH] image: Move image code into its own module. --- CMakeLists.txt | 7 +------ cli/CMakeLists.txt | 1 - gui/CMakeLists.txt | 10 ++++++++-- gui/retracer.cpp | 2 +- {common => image}/image.cpp | 0 {common => image}/image.hpp | 0 {common => image}/image_bmp.cpp | 0 {common => image}/image_png.cpp | 0 {common => image}/image_pnm.cpp | 0 retrace/CMakeLists.txt | 3 ++- 10 files changed, 12 insertions(+), 11 deletions(-) rename {common => image}/image.cpp (100%) rename {common => image}/image.hpp (100%) rename {common => image}/image_bmp.cpp (100%) rename {common => image}/image_png.cpp (100%) rename {common => image}/image_pnm.cpp (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1c4094f..e31cb54 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -206,8 +206,6 @@ set (PNG_DEFINITIONS "") set (PNG_LIBRARIES png_bundled) add_subdirectory (thirdparty/libpng EXCLUDE_FROM_ALL) -include_directories (${PNG_INCLUDE_DIR}) -add_definitions (${PNG_DEFINITIONS}) if (MSVC) add_subdirectory (thirdparty/getopt EXCLUDE_FROM_ALL) @@ -321,10 +319,6 @@ add_library (common STATIC common/trace_writer_model.cpp common/trace_loader.cpp common/trace_profiler.cpp - common/image.cpp - common/image_bmp.cpp - common/image_pnm.cpp - common/image_png.cpp common/trace_option.cpp common/${os} ) @@ -348,6 +342,7 @@ endif () add_subdirectory (dispatch) add_subdirectory (helpers) add_subdirectory (wrappers) +add_subdirectory (image) add_subdirectory (retrace) diff --git a/cli/CMakeLists.txt b/cli/CMakeLists.txt index 521886b..a01d3ae 100644 --- a/cli/CMakeLists.txt +++ b/cli/CMakeLists.txt @@ -16,7 +16,6 @@ add_executable (apitrace target_link_libraries (apitrace common - ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} ${SNAPPY_LIBRARIES} ${GETOPT_LIBRARIES} diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt index ee18d81..773d344 100644 --- a/gui/CMakeLists.txt +++ b/gui/CMakeLists.txt @@ -58,7 +58,13 @@ QT4_WRAP_UI(qapitrace_UIS_H ${qapitrace_UIS}) #add_app_icon(qapitrace_SRCS ../icons/hi*-qapitrace.png) link_directories(${LINK_DIRECTORIES} ${QJSON_LIBRARY_DIRS}) -include_directories(${QT_INCLUDES} ${QJSON_INCLUDE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/..) +include_directories( + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR} + ${QJSON_INCLUDE_DIR} + ${QT_INCLUDES} +) if (WIN32) # Use Windows subsystem (i.e., no console). @@ -68,8 +74,8 @@ endif () add_executable(qapitrace ${qapitrace_SUBSYSTEM} ${qapitrace_SRCS} ${qapitrace_UIS_H}) target_link_libraries (qapitrace + image common - ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} ${SNAPPY_LIBRARIES} ${QJSON_LIBRARIES} diff --git a/gui/retracer.cpp b/gui/retracer.cpp index 213704b..c6698f7 100644 --- a/gui/retracer.cpp +++ b/gui/retracer.cpp @@ -3,7 +3,7 @@ #include "apitracecall.h" #include "thumbnail.h" -#include "image.hpp" +#include "image/image.hpp" #include "trace_profiler.hpp" diff --git a/common/image.cpp b/image/image.cpp similarity index 100% rename from common/image.cpp rename to image/image.cpp diff --git a/common/image.hpp b/image/image.hpp similarity index 100% rename from common/image.hpp rename to image/image.hpp diff --git a/common/image_bmp.cpp b/image/image_bmp.cpp similarity index 100% rename from common/image_bmp.cpp rename to image/image_bmp.cpp diff --git a/common/image_png.cpp b/image/image_png.cpp similarity index 100% rename from common/image_png.cpp rename to image/image_png.cpp diff --git a/common/image_pnm.cpp b/image/image_pnm.cpp similarity index 100% rename from common/image_pnm.cpp rename to image/image_pnm.cpp diff --git a/retrace/CMakeLists.txt b/retrace/CMakeLists.txt index 5a2a608..c6a364f 100644 --- a/retrace/CMakeLists.txt +++ b/retrace/CMakeLists.txt @@ -6,6 +6,7 @@ include_directories ( ${CMAKE_SOURCE_DIR}/helpers ${CMAKE_BINARY_DIR}/dispatch ${CMAKE_SOURCE_DIR}/dispatch + ${CMAKE_SOURCE_DIR}/image ) add_definitions (-DRETRACE) @@ -39,8 +40,8 @@ add_library (retrace_common STATIC json.cpp ) target_link_libraries (retrace_common + image common - ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} ${SNAPPY_LIBRARIES} ${GETOPT_LIBRARIES} -- 2.43.0