Install binaries to MacOS. And gsetting schema files to Resources
parent
7ea5cbd2c3
commit
96df781172
|
@ -23,6 +23,19 @@ if(DOXYGEN)
|
||||||
include(Doxygen)
|
include(Doxygen)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Install location
|
||||||
|
if(WIN32)
|
||||||
|
set(DATADIR share CACHE PATH "datadir")
|
||||||
|
elseif(APPLE)
|
||||||
|
set(BUNDLEDIR ${PROJECT_NAME}.app/Contents/)
|
||||||
|
set(RESOURCESDIR ${BUNDLEDIR}/Resources)
|
||||||
|
set(MACOSDIR ${BUNDLEDIR}/MacOS CACHE PATH "macosdir")
|
||||||
|
set(DATADIR ${RESOURCESDIR}/share CACHE PATH "datadir")
|
||||||
|
set(LIBDIR ${RESOURCESDIR}/lib CACHE PATH "libadir")
|
||||||
|
elseif(UNIX)
|
||||||
|
set (DATADIR share CACHE PATH "datadir")
|
||||||
|
endif()
|
||||||
|
|
||||||
# Production build, let's include the CPack settings
|
# Production build, let's include the CPack settings
|
||||||
if("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
|
if("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
|
||||||
include(Packaging)
|
include(Packaging)
|
||||||
|
@ -58,23 +71,10 @@ add_subdirectory (lib/commonmarker/extensions)
|
||||||
add_subdirectory (lib/ipfs-http-client)
|
add_subdirectory (lib/ipfs-http-client)
|
||||||
add_subdirectory (lib/whereami)
|
add_subdirectory (lib/whereami)
|
||||||
add_subdirectory (src)
|
add_subdirectory (src)
|
||||||
|
|
||||||
if(UNITTEST)
|
if(UNITTEST)
|
||||||
add_subdirectory(tst)
|
add_subdirectory(tst)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Install location
|
|
||||||
if(WIN32)
|
|
||||||
set(DATADIR share CACHE PATH "datadir")
|
|
||||||
elseif(APPLE)
|
|
||||||
set(BUNDLEDIR ${PROJECT_NAME}.app/Contents/)
|
|
||||||
set(RESOURCESDIR ${BUNDLEDIR}/Resources)
|
|
||||||
set(DATADIR ${RESOURCESDIR}/share CACHE PATH "datadir")
|
|
||||||
set(LIBDIR ${RESOURCESDIR}/lib CACHE PATH "libadir")
|
|
||||||
elseif(UNIX)
|
|
||||||
set (DATADIR share CACHE PATH "datadir")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Additional install files
|
# Additional install files
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
# Microsoft Windows specific
|
# Microsoft Windows specific
|
||||||
|
@ -84,8 +84,8 @@ if(WIN32)
|
||||||
elseif(APPLE)
|
elseif(APPLE)
|
||||||
# Apple macOS specific
|
# Apple macOS specific
|
||||||
install(DIRECTORY misc/packaging_icons/ DESTINATION ${DATADIR}/icons)
|
install(DIRECTORY misc/packaging_icons/ DESTINATION ${DATADIR}/icons)
|
||||||
install(DIRECTORY misc/packaging_macos/ DESTINATION .)
|
install(DIRECTORY misc/packaging_macos/ DESTINATION ${MACOSDIR})
|
||||||
install(PROGRAMS go-ipfs/ipfs-darwin DESTINATION bin)
|
install(PROGRAMS go-ipfs/ipfs-darwin DESTINATION ${MACOSDIR})
|
||||||
elseif(UNIX)
|
elseif(UNIX)
|
||||||
# UNIX specific
|
# UNIX specific
|
||||||
install(FILES misc/libreweb-browser.desktop DESTINATION ${DATADIR}/applications)
|
install(FILES misc/libreweb-browser.desktop DESTINATION ${DATADIR}/applications)
|
||||||
|
|
|
@ -14,7 +14,11 @@ else()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(GSETTINGS_COMPILE)
|
if(GSETTINGS_COMPILE)
|
||||||
message (STATUS "GSettings shemas will be compiled after install.")
|
if (UNIX AND NOT APPLE)
|
||||||
|
message (STATUS "GSettings shemas will be compiled after install.")
|
||||||
|
else()
|
||||||
|
set(GSETTINGS_COMPILE OFF CACHE BOOL "Disable schema compile after installation" FORCE)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
macro(add_schema SCHEMA_NAME OUTPUT)
|
macro(add_schema SCHEMA_NAME OUTPUT)
|
||||||
|
@ -22,10 +26,19 @@ macro(add_schema SCHEMA_NAME OUTPUT)
|
||||||
set(PKG_CONFIG_EXECUTABLE pkg-config)
|
set(PKG_CONFIG_EXECUTABLE pkg-config)
|
||||||
|
|
||||||
if(GSETTINGS_PREFIXINSTALL)
|
if(GSETTINGS_PREFIXINSTALL)
|
||||||
set (GSETTINGS_DIR "${CMAKE_INSTALL_PREFIX}/share/glib-2.0/schemas/")
|
if(WIN32 OR APPLE)
|
||||||
|
set(GSETTINGS_DIR "${DATADIR}/glib-2.0/schemas/")
|
||||||
|
elseif(UNIX)
|
||||||
|
# $DATADIR is relative, using GNU/Linux we want to have gsettings installed in the obsolute path
|
||||||
|
set(GSETTINGS_DIR "${CMAKE_INSTALL_PREFIX}/${DATADIR}/glib-2.0/schemas/")
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} glib-2.0 --variable prefix OUTPUT_VARIABLE _glib_prefix OUTPUT_STRIP_TRAILING_WHITESPACE)
|
if(WIN32 OR APPLE)
|
||||||
set (GSETTINGS_DIR "${_glib_prefix}/share/glib-2.0/schemas/")
|
set(GSETTINGS_DIR "${DATADIR}/glib-2.0/schemas/")
|
||||||
|
elseif(UNIX)
|
||||||
|
execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} glib-2.0 --variable prefix OUTPUT_VARIABLE _glib_prefix OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
set(GSETTINGS_DIR "${_glib_prefix}/${DATADIR}/glib-2.0/schemas/")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Validate the schema
|
# Validate the schema
|
||||||
|
@ -36,7 +49,6 @@ macro(add_schema SCHEMA_NAME OUTPUT)
|
||||||
message(SEND_ERROR "Schema validation error: ${_schemas_invalid}")
|
message(SEND_ERROR "Schema validation error: ${_schemas_invalid}")
|
||||||
endif(_schemas_invalid)
|
endif(_schemas_invalid)
|
||||||
|
|
||||||
|
|
||||||
if(GSETTINGS_LOCALCOMPILE)
|
if(GSETTINGS_LOCALCOMPILE)
|
||||||
# compile locally during build to not force the user to 'make install'
|
# compile locally during build to not force the user to 'make install'
|
||||||
# when running from the build dir
|
# when running from the build dir
|
||||||
|
@ -57,18 +69,15 @@ macro(add_schema SCHEMA_NAME OUTPUT)
|
||||||
endif(GSETTINGS_LOCALCOMPILE)
|
endif(GSETTINGS_LOCALCOMPILE)
|
||||||
|
|
||||||
# Install
|
# Install
|
||||||
if(WIN32)
|
message (STATUS "GSettings schema ${SCHEMA_NAME} will be installed into ${GSETTINGS_DIR}")
|
||||||
message (STATUS "GSettings schema ${SCHEMA_NAME} will be installed into share/glib-2.0/schemas")
|
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/schema/${SCHEMA_NAME} DESTINATION ${GSETTINGS_DIR})
|
||||||
# For Windows the destination should always be relative
|
if(WIN32 OR APPLE)
|
||||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/schema/${SCHEMA_NAME} DESTINATION share/glib-2.0/schemas)
|
# Also we want to ship the compiled binary to Windows and macOS
|
||||||
# Also we want to ship the compiled binary to Windows
|
message (STATUS "GSettings gschemas.compiled will be installed into ${GSETTINGS_DIR}")
|
||||||
install(FILES ${PROJECT_BINARY_DIR}/gschemas.compiled DESTINATION share/glib-2.0/schemas)
|
install(FILES ${PROJECT_BINARY_DIR}/gschemas.compiled DESTINATION ${GSETTINGS_DIR})
|
||||||
else()
|
|
||||||
message (STATUS "GSettings schema ${SCHEMA_NAME} will be installed into ${GSETTINGS_DIR}")
|
|
||||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/schema/${SCHEMA_NAME} DESTINATION ${GSETTINGS_DIR})
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Compile
|
# Compile after installation (UNIX only)
|
||||||
if(GSETTINGS_COMPILE)
|
if(GSETTINGS_COMPILE)
|
||||||
install(CODE "message (STATUS \"Compiling GSettings schemas\")")
|
install(CODE "message (STATUS \"Compiling GSettings schemas\")")
|
||||||
install(CODE "execute_process (COMMAND ${_glib_comple_schemas} ${GSETTINGS_DIR})")
|
install(CODE "execute_process (COMMAND ${_glib_comple_schemas} ${GSETTINGS_DIR})")
|
||||||
|
|
Loading…
Reference in New Issue