|
|
|
@ -143,6 +143,7 @@ set (logdiag_TESTS
|
|
|
|
|
diagram)
|
|
|
|
|
|
|
|
|
|
set (logdiag_SOURCES
|
|
|
|
|
${PROJECT_BINARY_DIR}/gresource.c
|
|
|
|
|
src/ld-window-main.c
|
|
|
|
|
src/logdiag.c)
|
|
|
|
|
set (logdiag_HEADERS
|
|
|
|
@ -155,34 +156,75 @@ if (WIN32)
|
|
|
|
|
list (APPEND logdiag_SOURCES share/logdiag.rc)
|
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
|
|
# Generate a configure file
|
|
|
|
|
add_definitions (-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_36)
|
|
|
|
|
add_definitions (-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_36)
|
|
|
|
|
configure_file (config.h.in ${PROJECT_BINARY_DIR}/config.h)
|
|
|
|
|
include_directories (${PROJECT_BINARY_DIR})
|
|
|
|
|
|
|
|
|
|
# Generate marshallers
|
|
|
|
|
find_program (GLIB_GENMARSHAL_EXECUTABLE glib-genmarshal)
|
|
|
|
|
if (NOT GLIB_GENMARSHAL_EXECUTABLE)
|
|
|
|
|
message (FATAL_ERROR "glib-genmarshal not found")
|
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
|
|
function (glib_genmarshal listfile prefix)
|
|
|
|
|
get_filename_component (basename "${listfile}" NAME_WE)
|
|
|
|
|
set (command_base ${GLIB_GENMARSHAL_EXECUTABLE} --prefix ${prefix}
|
|
|
|
|
find_program (GLIB_GENMARSHAL_EXECUTABLE glib-genmarshal)
|
|
|
|
|
if (NOT GLIB_GENMARSHAL_EXECUTABLE)
|
|
|
|
|
message (FATAL_ERROR "glib-genmarshal not found")
|
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
|
|
get_filename_component (_basename "${listfile}" NAME_WE)
|
|
|
|
|
set (_command_base ${GLIB_GENMARSHAL_EXECUTABLE} --prefix ${prefix}
|
|
|
|
|
"${listfile}")
|
|
|
|
|
|
|
|
|
|
add_custom_command (OUTPUT ${basename}.c ${basename}.h
|
|
|
|
|
COMMAND ${command_base} --body > ${basename}.c
|
|
|
|
|
COMMAND ${command_base} --header > ${basename}.h
|
|
|
|
|
add_custom_command (OUTPUT ${_basename}.c ${_basename}.h
|
|
|
|
|
COMMAND ${_command_base} --body > ${_basename}.c
|
|
|
|
|
COMMAND ${_command_base} --header > ${_basename}.h
|
|
|
|
|
DEPENDS "${listfile}"
|
|
|
|
|
COMMENT "Generating marshallers source files" VERBATIM)
|
|
|
|
|
endfunction ()
|
|
|
|
|
|
|
|
|
|
glib_genmarshal (${PROJECT_SOURCE_DIR}/liblogdiag/ld-marshal.list ld_marshal)
|
|
|
|
|
|
|
|
|
|
include_directories (${PROJECT_SOURCE_DIR})
|
|
|
|
|
include_directories (${GTK3_INCLUDE_DIRS} ${Lua_INCLUDE_DIRS})
|
|
|
|
|
# Generate resources
|
|
|
|
|
function (glib_compile_resources xml target)
|
|
|
|
|
find_program (GLIB_COMPILE_RESOURCES_EXECUTABLE glib-compile-resources)
|
|
|
|
|
if (NOT GLIB_COMPILE_RESOURCES_EXECUTABLE)
|
|
|
|
|
message (FATAL_ERROR "glib-compile-resources not found")
|
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
|
|
# glib-compile-resources reads paths relative to its working directory
|
|
|
|
|
get_filename_component (_xml_path "${xml}" PATH)
|
|
|
|
|
|
|
|
|
|
# On Windows, the final Makefile may contain:
|
|
|
|
|
# cd e:\abc && ...
|
|
|
|
|
# That won't actually change the directory. We have to do:
|
|
|
|
|
# cd e:\abc && e: && ...
|
|
|
|
|
set (_prefix)
|
|
|
|
|
if (WIN32 AND "${_xml_path}" MATCHES "^.:[/\\\\]")
|
|
|
|
|
string (SUBSTRING "${_xml_path}" 0 2 _xml_drive)
|
|
|
|
|
set (_prefix ${_xml_drive} &&)
|
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
|
|
# VERBATIM would cause problems, so it is not used here
|
|
|
|
|
add_custom_command (OUTPUT ${target}
|
|
|
|
|
COMMAND ${_prefix} ${GLIB_COMPILE_RESOURCES_EXECUTABLE}
|
|
|
|
|
--generate-source --target ${target} "${xml}" DEPENDS "${xml}"
|
|
|
|
|
WORKING_DIRECTORY "${_xml_path}" COMMENT "Compiling resources")
|
|
|
|
|
|
|
|
|
|
# This refuses to accept drive changes, but it also needn't succeed
|
|
|
|
|
execute_process (COMMAND ${GLIB_COMPILE_RESOURCES_EXECUTABLE}
|
|
|
|
|
--generate-dependencies "${xml}"
|
|
|
|
|
WORKING_DIRECTORY "${_xml_path}" OUTPUT_VARIABLE _deps)
|
|
|
|
|
string (REPLACE "\n" ";" _deps "${_deps}")
|
|
|
|
|
foreach (_dep ${_deps})
|
|
|
|
|
set_property (SOURCE "${target}"
|
|
|
|
|
APPEND PROPERTY OBJECT_DEPENDS "${_xml_path}/${_dep}")
|
|
|
|
|
endforeach ()
|
|
|
|
|
|
|
|
|
|
configure_file ("${xml}" glib-compile-resources.stamp COPYONLY)
|
|
|
|
|
endfunction ()
|
|
|
|
|
|
|
|
|
|
glib_compile_resources (${PROJECT_SOURCE_DIR}/share/logdiag.gresource.xml
|
|
|
|
|
${PROJECT_BINARY_DIR}/gresource.c)
|
|
|
|
|
|
|
|
|
|
# Generate a configure file
|
|
|
|
|
add_definitions (-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_36)
|
|
|
|
|
add_definitions (-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_36)
|
|
|
|
|
configure_file (config.h.in ${PROJECT_BINARY_DIR}/config.h)
|
|
|
|
|
|
|
|
|
|
include_directories (${PROJECT_SOURCE_DIR} ${PROJECT_BINARY_DIR}
|
|
|
|
|
${GTK3_INCLUDE_DIRS} ${Lua_INCLUDE_DIRS})
|
|
|
|
|
set (logdiag_LIBS ${GTK3_LIBRARIES} ${Lua_LIBRARIES} m)
|
|
|
|
|
|
|
|
|
|
if (WIN32)
|
|
|
|
@ -350,7 +392,7 @@ else ()
|
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
|
|
install (DIRECTORY docs/user-guide DESTINATION share/doc/${PROJECT_NAME})
|
|
|
|
|
install (DIRECTORY share/gui share/library DESTINATION share/${PROJECT_NAME})
|
|
|
|
|
install (DIRECTORY share/library DESTINATION share/${PROJECT_NAME})
|
|
|
|
|
install (FILES ${GSETTINGS_SCHEMAS} DESTINATION share/glib-2.0/schemas)
|
|
|
|
|
install (CODE " # DESTDIR is not in use on Windows (WIN32 is only native here!)
|
|
|
|
|
if (WIN32 OR \"\$ENV{DESTDIR}\" STREQUAL \"\")
|
|
|
|
|