2021-08-27 05:33:20 +02:00
|
|
|
cmake_minimum_required(VERSION 3.7)
|
2021-08-27 20:07:14 +02:00
|
|
|
project(ragephoto-gtkviewer LANGUAGES CXX)
|
2021-08-27 05:33:20 +02:00
|
|
|
|
|
|
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
|
|
|
set(CMAKE_CXX_STANDARD 11)
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
|
|
|
|
find_package(PkgConfig REQUIRED)
|
2021-08-27 20:07:14 +02:00
|
|
|
pkg_check_modules(GTKMM REQUIRED gtkmm-3.0)
|
2021-08-27 05:33:20 +02:00
|
|
|
|
|
|
|
set(GTKVIEWER_HEADERS
|
|
|
|
src/PhotoViewer.h
|
|
|
|
)
|
|
|
|
|
|
|
|
set(GTKVIEWER_SOURCES
|
|
|
|
src/main.cpp
|
|
|
|
src/PhotoViewer.cpp
|
|
|
|
)
|
|
|
|
|
2021-08-27 21:48:33 +02:00
|
|
|
if (TARGET ragephoto)
|
2021-08-27 05:33:20 +02:00
|
|
|
set(RAGEPHOTO_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/src)
|
2021-08-27 21:48:33 +02:00
|
|
|
set(RAGEPHOTO_LIBRARIES ragephoto)
|
2021-08-27 05:33:20 +02:00
|
|
|
else()
|
2021-08-27 21:48:33 +02:00
|
|
|
pkg_check_modules(RAGEPHOTO REQUIRED ragephoto)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
add_executable(ragephoto-gtkviewer ${GTKVIEWER_HEADERS} ${GTKVIEWER_SOURCES})
|
|
|
|
target_compile_options(ragephoto-gtkviewer PRIVATE ${GTKMM_CFLAGS} ${RAGEPHOTO_CFLAGS})
|
|
|
|
target_link_libraries(ragephoto-gtkviewer PRIVATE ${GTKMM_LIBRARIES} ${RAGEPHOTO_LIBRARIES})
|
|
|
|
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.13.0")
|
|
|
|
target_link_directories(ragephoto-gtkviewer PRIVATE ${GTKMM_LIBRARY_DIRS} ${RAGEPHOTO_LIBRARY_DIRS})
|
2021-08-27 05:33:20 +02:00
|
|
|
endif()
|
2021-08-27 21:48:33 +02:00
|
|
|
target_include_directories(ragephoto-gtkviewer PRIVATE ${GTKMM_INCLUDE_DIRS} ${RAGEPHOTO_INCLUDE_DIRS})
|
|
|
|
install(TARGETS ragephoto-gtkviewer DESTINATION bin)
|