Linux compilation with gcc

This commit is contained in:
Christophe Meneboeuf 2021-02-15 00:29:11 +01:00
parent 98687b40c5
commit e8fe9565b8
3 changed files with 9 additions and 2 deletions

View File

@ -31,6 +31,7 @@ else()
find_package(ImageMagick 6.9 EXACT REQUIRED COMPONENTS Magick++ )
endif(WIN32)
find_package(SDL2 REQUIRED)
find_package(Threads REQUIRED)
# directories
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_SOURCE_DIR}/bin/debug)
@ -55,9 +56,12 @@ target_include_directories(${PROJECT_NAME} PRIVATE ${ImageMagick_INCLUDE_DIRS} $
# Application Picture
add_executable(Picture src/App_Picture.cpp)
if(NOT WIN32)
set_target_properties(Picture PROPERTIES COMPILE_FLAGS -pthread LINK_FLAGS -pthread)
endif()
target_compile_definitions(Picture PUBLIC MAGICKCORE_QUANTUM_DEPTH=16 MAGICKCORE_HDRI_ENABLE=0)
target_include_directories(Picture PRIVATE src ${ImageMagick_INCLUDE_DIRS})
target_link_libraries(Picture ${ImageMagick_LIBRARIES} ${SDL2_LIBRARIES} ${PROJECT_NAME})
target_link_libraries(Picture ${ImageMagick_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${PROJECT_NAME} ${SDL2_LIBRARIES}) # SDL2 must be at the end
set_property(TARGET Picture PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG})
# Application Tile

View File

@ -2,6 +2,8 @@
#include <stdexcept>
#include <iostream>
#include <chrono>
#define SDL_MAIN_HANDLED
#include <SDL.h>
#include "Picture.h"

View File

@ -19,6 +19,7 @@
#define _DISPLAY_H_
#include <thread>
#include <atomic>
#include "ImageQuantized.h"
#include "HiRes.h"