From 6fb8a092e6dcbe54eabe3eed34a57c624392f959 Mon Sep 17 00:00:00 2001 From: Joshua Jerred Date: Mon, 13 Mar 2023 14:07:40 -0600 Subject: [PATCH] Converted to library and restructures --- CMakeLists.txt | 22 ++++++++++++++-------- {src => include}/sstv-image-tools.h | 0 2 files changed, 14 insertions(+), 8 deletions(-) rename {src => include}/sstv-image-tools.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3401857..1db2699 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,17 +9,23 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \ -Wall \ -Wextra \ -Weffc++ \ - -Wdisabled-optimization \ - -Wno-unused-variable") + -Wunused-variable \ + -Wno-type-limits \ + -Wno-float-equal") +# no type limits and no float equal are for the ImageMagick library -include_directories(src) - -add_executable(example-images - example/example.cpp - src/sstv-image-tools.cpp +include_directories(include) +add_library(sstv-image-tools + src/sstv-image-tools.cpp ) add_definitions(-DMAGICKCORE_QUANTUM_DEPTH=8) add_definitions(-DMAGICKCORE_HDRI_ENABLE=1) # Required or there are linking errors with Magick::Color::Color find_package(ImageMagick COMPONENTS Magick++) include_directories(${ImageMagick_INCLUDE_DIRS}) -target_link_libraries(example-images ${ImageMagick_LIBRARIES}) \ No newline at end of file +target_link_libraries(sstv-image-tools ${ImageMagick_LIBRARIES}) + +# Example +add_executable(example-images + example/example.cpp +) +target_link_libraries(example-images sstv-image-tools) \ No newline at end of file diff --git a/src/sstv-image-tools.h b/include/sstv-image-tools.h similarity index 100% rename from src/sstv-image-tools.h rename to include/sstv-image-tools.h