forked from giuspen/cherrytree
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* rough cmake install WIP * copy js and css from data dir * rename autoconf files to turn off autoconf * build man pages * adjusting cpack * rename README -> README.md * update travis config * config.h.cmake * update cmake on travis * one more travis fix
- Loading branch information
Showing
16 changed files
with
397 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,42 @@ | ||
cmake_minimum_required(VERSION 3.1.0) | ||
cmake_minimum_required(VERSION 3.13.2) | ||
|
||
project(cherrytree) | ||
set(CT_VERSION "0.1.0") | ||
|
||
|
||
# used to install locale, packagers might overwrite this | ||
if(NOT PACKAGE_LOCALE_DIR) | ||
set(PACKAGE_LOCALE_DIR "share/locale") | ||
endif(NOT PACKAGE_LOCALE_DIR) | ||
|
||
# used to install data, packagers might overwrite this | ||
if(NOT SHARE_INSTALL) | ||
set(SHARE_INSTALL "share" CACHE STRING "Data file install path. Must be a relative path (from CMAKE_INSTALL_PREFIX), with no trailing slash.") | ||
endif(NOT SHARE_INSTALL) | ||
set(CHERRYTREE_SHARE_INSTALL "${SHARE_INSTALL}/cherrytree") | ||
|
||
|
||
set(CPACK_PACKAGE_NAME "cherrytree") | ||
set(CPACK_PACKAGE_CONTACT "Giuseppe Penone <[email protected]>") | ||
set(CPACK_PACKAGE_VENDOR ${CPACK_PACKAGE_CONTACT}) | ||
set(CPACK_PACKAGE_VERSION ${CT_VERSION}) | ||
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.md") | ||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A Hierarchical Note Taking Application, featuring Rich Text and Syntax Highlighting.") | ||
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/../license.txt") | ||
set(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}) | ||
set(CPACK_PACKAGE_CHECKSUM "SHA256") | ||
set(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_CONTACT}) | ||
set(CPACK_CREATE_DESKTOP_LINKS ${CPACK_PACKAGE_CONTACT}) | ||
set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_CONTACT}) | ||
set(CPACK_STRIP_FILES TRUE) | ||
|
||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libgtkmm-3.0-dev, libgtksourceviewmm-3.0-dev, libxml++2.6-dev, libsqlite3-dev, gettext, libgspell-1-dev") | ||
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://www.giuspen.com/cherrytree/") | ||
#set(CPACK_DEBIAN_PACKAGE_SECTION "graphics") which one? | ||
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) | ||
|
||
include(CPack) | ||
|
||
|
||
set(CMAKE_CXX_STANDARD 17) | ||
|
||
|
@@ -16,18 +48,17 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") | |
add_compile_options(-Wthread-safety) | ||
endif() | ||
|
||
#add_compile_options(-pthread -Wall -Wextra -Wno-unused-parameter) | ||
add_compile_options(-Wno-deprecated -Wno-deprecated-declarations) | ||
add_definitions(-D_CT_VERSION="${CT_VERSION}") | ||
add_definitions(-DGETTEXT_PACKAGE="${CPACK_PACKAGE_NAME}") | ||
add_definitions(-DCHERRYTREE_LOCALEDIR="") | ||
|
||
|
||
add_compile_options(-Wno-deprecated -Wno-deprecated-declarations) | ||
if(CMAKE_BUILD_TYPE STREQUAL "") | ||
add_compile_options(-O3) | ||
endif() | ||
|
||
#option(BUILD_TESTING "Build tests") | ||
|
||
# Create the configuration files config.h in the root dir | ||
configure_file(${CMAKE_SOURCE_DIR}/config.h.cmake ${CMAKE_SOURCE_DIR}/config.h) | ||
|
||
|
||
|
||
include(FindPkgConfig) | ||
pkg_check_modules(GTKMM gtkmm-3.0 REQUIRED) | ||
|
@@ -61,3 +92,43 @@ add_subdirectory(src/ct) | |
enable_testing() | ||
add_subdirectory(tests) | ||
|
||
|
||
|
||
# rebuild man pages | ||
set(MANFILE_FULL "${CMAKE_SOURCE_DIR}/data/cherrytree.1") | ||
set(MANFILE_FULL_GZ "${MANFILE_FULL}.gz") | ||
add_custom_command( | ||
OUTPUT ${MANFILE_FULL_GZ} | ||
COMMAND gzip -f -k --best -n "${MANFILE_FULL}" | ||
) | ||
add_custom_target(man_pages ALL DEPENDS ${MANFILE_FULL_GZ}) | ||
|
||
# install commands | ||
install(TARGETS cherrytree RUNTIME DESTINATION bin) | ||
if(${CMAKE_SYSTEM_NAME} MATCHES Linux|.*BSD|DragonFly) | ||
# share data | ||
install(FILES "${CMAKE_SOURCE_DIR}/data/cherrytree.desktop" | ||
DESTINATION "${SHARE_INSTALL}/applications") | ||
install(FILES "${CMAKE_SOURCE_DIR}/icons/cherrytree.svg" | ||
DESTINATION "${SHARE_INSTALL}/icons/hicolor/scalable/apps") | ||
install(FILES "${MANFILE_FULL_GZ}" | ||
DESTINATION "${SHARE_INSTALL}/man/man1") | ||
install(FILES | ||
"${CMAKE_SOURCE_DIR}/data/cherrytree.mime" | ||
"${CMAKE_SOURCE_DIR}/data/cherrytree.keys" | ||
DESTINATION "${SHARE_INSTALL}/mime-info") | ||
install(FILES "${CMAKE_SOURCE_DIR}/data/cherrytree.appdata.xml" | ||
DESTINATION "${SHARE_INSTALL}/metainfo") | ||
|
||
# share/cherrytree data | ||
install(FILES | ||
"${CMAKE_SOURCE_DIR}/language-specs/clisp.lang" | ||
"${CMAKE_SOURCE_DIR}/language-specs/markdown-extra.lang" | ||
DESTINATION "${CHERRYTREE_SHARE_INSTALL}/language-specs") | ||
install(FILES | ||
"${CMAKE_SOURCE_DIR}/data/script3.js" | ||
"${CMAKE_SOURCE_DIR}/data/styles3.css" | ||
DESTINATION "${CHERRYTREE_SHARE_INSTALL}/data") | ||
endif() | ||
|
||
|
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
#pragma once | ||
|
||
/* Name of package */ | ||
#define PACKAGE "${PROJECT_NAME}" | ||
|
||
/* Name of package */ | ||
#define PACKAGE_NAME "${PROJECT_NAME}" | ||
|
||
/* The domain to use with gettext */ | ||
#define GETTEXT_PACKAGE "${PROJECT_NAME}" | ||
|
||
/* Localization directory */ | ||
#define CHERRYTREE_LOCALEDIR "${CMAKE_INSTALL_PREFIX}/${PACKAGE_LOCALE_DIR}" | ||
|
||
/* data directory */ | ||
#define CHERRYTREE_DATADIR "${CMAKE_INSTALL_PREFIX}/${CHERRYTREE_SHARE_INSTALL}" | ||
|
||
|
||
/* always defined to indicate that i18n is enabled */ | ||
#cmakedefine ENABLE_NLS 1 | ||
|
||
/* folder with data for tests */ | ||
#define _UNITTEST_DATA_DIR "${CMAKE_SOURCE_DIR}/tests/data" | ||
|
||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
function changeFrame(file_path){ | ||
var iframe = document.getElementById("page_frame"); | ||
iframe.src = file_path; | ||
} | ||
|
||
function toggleSubTree(element){ | ||
var nextSibling = element.parentElement.nextElementSibling; | ||
if(nextSibling.tagName == 'UL'){ | ||
nextSibling.classList.toggle('hide'); | ||
if(element.textContent == '+'){ | ||
element.textContent = '-' | ||
}else{ | ||
element.textContent = '+' | ||
} | ||
} | ||
} | ||
|
||
function expandAllSubtrees(element){ | ||
var subtrees = document.getElementsByClassName("subtree"); | ||
for(var i=0; i<subtrees.length; i++){ | ||
var subtree = subtrees[i]; | ||
subtree.classList.remove('hide'); | ||
subtree.previousElementSibling.firstChild.textContent = '-'; | ||
} | ||
} | ||
|
||
function collapseAllSubtrees(element){ | ||
var subtrees = document.getElementsByClassName("subtree"); | ||
for(var i=0; i<subtrees.length; i++){ | ||
var subtree = subtrees[i]; | ||
subtree.classList.add('hide'); | ||
subtree.previousElementSibling.firstChild.textContent = '+'; | ||
} | ||
} | ||
|
||
window.onload = function(){ | ||
var show_page = window.location.hash.substr(1); | ||
if (show_page !== '') { | ||
changeFrame(show_page); | ||
} | ||
} |
Oops, something went wrong.