@ -27,6 +27,15 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
# R a g e P h o t o C M a k e i n c l u d e s
include ( cmake/unicode.cmake )
# R a g e P h o t o W e b A s s e m b l y O N / O F F
if ( EMSCRIPTEN )
set ( EM_ON ON )
set ( EM_OFF OFF )
else ( )
set ( EM_ON OFF )
set ( EM_OFF ON )
endif ( )
# R a g e P h o t o S o u r c e f i l e s
set ( RAGEPHOTO_HEADERS
s r c / R a g e P h o t o . h
@ -37,33 +46,25 @@ set(RAGEPHOTO_SOURCES
)
# R a g e P h o t o L i b r a r y T y p e
if ( EMSCRIPTEN )
option ( BUILD_SHARED "Build libragephoto as shared library" OFF )
option ( RAGEPHOTO_STATIC "Build libragephoto as static library" ${ EM_ON } )
if ( RAGEPHOTO_STATIC )
option ( RAGEPHOTO_C_API "Build libragephoto with C API support" ${ EM_ON } )
set ( LIBRAGEPHOTO_LIBTYPE LIBRAGEPHOTO_STATIC )
else ( )
option ( BUILD_SHARED "Build libragephoto as shared library" ON )
endif ( )
if ( BUILD_SHARED )
option ( WITH_C_API "Build libragephoto with C API support" ON )
option ( RAGEPHOTO_C_API "Build libragephoto with C API support" ON )
set ( LIBRAGEPHOTO_LIBTYPE LIBRAGEPHOTO_SHARED )
else ( )
if ( EMSCRIPTEN )
option ( WITH_C_API "Build libragephoto with C API support" ON )
else ( )
option ( WITH_C_API "Build libragephoto with C API support" OFF )
endif ( )
set ( LIBRAGEPHOTO_LIBTYPE LIBRAGEPHOTO_STATIC )
endif ( )
# R a g e P h o t o B e n c h m a r k
option ( WITH _BENCHMARK "Build with libragephoto benchmark" OFF )
if ( WITH _BENCHMARK)
option ( RAGEPHOTO_BENCHMARK "Build with libragephoto benchmark" OFF )
if ( RAGEPHOTO_BENCHMARK )
list ( APPEND LIBRAGEPHOTO_DEFINES
R A G E P H O T O _ B E N C H M A R K
)
endif ( )
# R a g e P h o t o C A P I
if ( WITH _C_API)
if ( RAGEPHOTO _C_API)
set ( LIBRAGEPHOTO_API LIBRAGEPHOTO_C_API )
list ( APPEND RAGEPHOTO_HEADERS
s r c / R a g e P h o t o A . h
@ -88,13 +89,13 @@ configure_file(src/libragephoto_global.h.in include/libragephoto_global.h @ONLY)
list ( APPEND RAGEPHOTO_HEADERS
$ { P R O J E C T _ B I N A R Y _ D I R } / i n c l u d e / l i b r a g e p h o t o _ g l o b a l . h
)
if ( BUILD_SHARED )
if ( RAGEPHOTO_STATIC )
add_library ( ragephoto STATIC ${ RAGEPHOTO_HEADERS } ${ RAGEPHOTO_SOURCES } ${ RAGEPHOTO_STATIC_RESOURCES } )
else ( )
add_library ( ragephoto SHARED ${ RAGEPHOTO_HEADERS } ${ RAGEPHOTO_SOURCES } ${ RAGEPHOTO_SHARED_RESOURCES } )
set_target_properties ( ragephoto PROPERTIES
P R E F I X " l i b "
)
else ( )
add_library ( ragephoto STATIC ${ RAGEPHOTO_HEADERS } ${ RAGEPHOTO_SOURCES } ${ RAGEPHOTO_STATIC_RESOURCES } )
endif ( )
target_compile_definitions ( ragephoto PRIVATE
L I B R A G E P H O T O _ L I B R A R Y
@ -137,31 +138,31 @@ if (EMSCRIPTEN)
endif ( )
# R a g e P h o t o D o c u m e n t a t i o n
option ( WITH_DOCUMENTATION "Build libragephoto with documentation" OFF )
if ( WITH_DOCUMENTATION )
option ( RAGEPHOTO_DOC "Build libragephoto with documentation" OFF )
if ( RAGEPHOTO_DOC )
add_subdirectory ( doc )
endif ( )
# R a g e P h o t o E x a m p l e s
option ( WITH_GTK_EXAMPLE "Build libragephoto with GTK Photo Viewer" OFF )
if ( WITH_GTK_EXAMPLE )
option ( RAGEPHOTO_EXAMPLE_GTKVIEWER "Build libragephoto with GTK Photo Viewer" OFF )
if ( RAGEPHOTO_EXAMPLE_GTKVIEWER )
add_subdirectory ( examples/ragephoto-gtkviewer )
endif ( )
option ( WITH_QT_EXAMPLE "Build libragephoto with Qt Photo Viewer" OFF )
if ( WITH_QT_EXAMPLE )
option ( RAGEPHOTO_EXAMPLE_QTVIEWER "Build libragephoto with Qt Photo Viewer" OFF )
if ( RAGEPHOTO_EXAMPLE_QTVIEWER )
add_subdirectory ( examples/ragephoto-qtviewer )
endif ( )
# R a g e P h o t o E x t r a c t T o o l
if ( ${ CMAKE_PROJECT_NAME } STREQUAL "ragephoto" )
option ( WITH _EXTRACT "Build libragephoto with ragephoto-extract" ON )
option ( RAGEPHOTO _EXTRACT "Build libragephoto with ragephoto-extract" ON )
else ( )
option ( WITH _EXTRACT "Build libragephoto with ragephoto-extract" OFF )
option ( RAGEPHOTO _EXTRACT "Build libragephoto with ragephoto-extract" OFF )
endif ( )
if ( WITH _EXTRACT)
if ( RAGEPHOTO _EXTRACT)
# R a g e P h o t o - E x t r a c t S o u r c e f i l e s
if ( WITH _C_API)
if ( RAGEPHOTO _C_API)
enable_language ( C )
set ( EXTRACT_SOURCES src/RagePhoto-Extract.c )
else ( )