CMake updates, Win32 resources and .gitattributes added

CMake: Improve RPATH handling for both TARGET and non-TARGET builds
CMake: Updating configure_file's to handle ragephoto_ instead of PROJECT_
variables
Win32 resources: Add basic library description with CMake's configure_file
This commit is contained in:
Syping 2021-11-12 06:55:37 +01:00
parent 56314c2738
commit bb53b342b7
7 changed files with 75 additions and 9 deletions

View file

@ -33,11 +33,15 @@ set(GTKVIEWER_SOURCES
if (TARGET ragephoto)
set(RAGEPHOTO_LIBRARIES ragephoto)
set(RAGEPHOTO_LIBRARY_DIRS ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
else()
pkg_check_modules(RAGEPHOTO REQUIRED ragephoto)
endif()
add_executable(ragephoto-gtkviewer WIN32 ${GTKVIEWER_SOURCES})
set_target_properties(ragephoto-gtkviewer PROPERTIES
INSTALL_RPATH ${GTKMM_LIBRARY_DIRS};${RAGEPHOTO_LIBRARY_DIRS}
)
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")

View file

@ -38,12 +38,16 @@ set(QTVIEWER_SOURCES
if (TARGET ragephoto)
set(RAGEPHOTO_LIBRARIES ragephoto)
set(RAGEPHOTO_LIBRARY_DIRS ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
else()
find_package(PkgConfig REQUIRED)
pkg_check_modules(RAGEPHOTO REQUIRED ragephoto)
endif()
add_executable(ragephoto-qtviewer WIN32 ${QTVIEWER_SOURCES})
set_target_properties(ragephoto-qtviewer PROPERTIES
INSTALL_RPATH ${RAGEPHOTO_LIBRARY_DIRS}
)
target_compile_options(ragephoto-qtviewer PRIVATE ${RAGEPHOTO_CFLAGS})
target_link_libraries(ragephoto-qtviewer PRIVATE Qt${QT_VERSION_MAJOR}::Widgets ${RAGEPHOTO_LIBRARIES})
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.13.0")