diff --git a/ports/gppanel/00001-fix-build.patch b/ports/gppanel/00001-fix-build.patch new file mode 100644 index 0000000000..bf394d63f7 --- /dev/null +++ b/ports/gppanel/00001-fix-build.patch @@ -0,0 +1,24 @@ +diff --git a/gpPanel/gpPanel.cpp b/gpPanel/gpPanel.cpp +index 7af20b5..908523c 100644 +--- a/gpPanel/gpPanel.cpp ++++ b/gpPanel/gpPanel.cpp +@@ -720,8 +720,8 @@ void gpPanel::OnMenuItemPrintPreview(wxCommandEvent& event) + gpLayer_s *gp = GetLayerByMenuId(event.GetId() ); + if(gp==NULL)return; + +- mpPrintout *plotPrint = new mpPrintout(gp->m_plot, gp->layer->GetName()); +- mpPrintout *plotPrintPreview = new mpPrintout(gp->m_plot, gp->layer->GetName()); ++ mpPrintout *plotPrint = new mpPrintout(gp->m_plot, gp->layer->GetName().c_str()); ++ mpPrintout *plotPrintPreview = new mpPrintout(gp->m_plot, gp->layer->GetName().c_str()); + + wxPrintPreview *preview = new wxPrintPreview(plotPrintPreview, plotPrint); + +@@ -765,7 +765,7 @@ void gpPanel::OnMenuItemSaveScreenshot(wxCommandEvent& event) + if(index!=-1) + { + wxString reso = aChoices.Item(index); +- if( reso.CompareTo(_("custom")) == 0 ){ ++ if( reso.CompareTo(_("custom").c_str()) == 0 ){ + reso = wxGetTextFromUser(_("Write image resolution (format: [width]x[height]"), _("Custom resolution for image"), _("640x480"), this); + } + if(reso.Find('x') != -1) diff --git a/ports/gppanel/CMakeLists.txt b/ports/gppanel/CMakeLists.txt new file mode 100644 index 0000000000..ba3f22f7af --- /dev/null +++ b/ports/gppanel/CMakeLists.txt @@ -0,0 +1,32 @@ +cmake_minimum_required(VERSION 3.13) +project(gpPanel CXX) + +set(wxWidgets_EXCLUDE_COMMON_LIBRARIES TRUE) +find_package(wxWidgets REQUIRED COMPONENTS core base) +include(${wxWidgets_USE_FILE}) + +file(GLOB_RECURSE SOURCES "gpPanel/*.cpp") +file(GLOB HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/include" "include/*.h") + +add_library(gpPanel STATIC ${SOURCES}) +target_compile_definitions(gpPanel PRIVATE _CRT_SECURE_NO_WARNINGS) + +target_include_directories(gpPanel PUBLIC + $ + $ +) + +target_link_libraries(gpPanel PRIVATE ${wxWidgets_LIBRARIES}) + +install(TARGETS gpPanel EXPORT gpPanel-config + RUNTIME DESTINATION bin + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib +) + +install(EXPORT gpPanel-config DESTINATION share/cmake/gpPanel) + +foreach (HEADER ${HEADERS} ) + get_filename_component(HEADER_DIR ${HEADER} DIRECTORY) + install(FILES include/${HEADER} DESTINATION include/gpPanel/${HEADER_DIR}) +endforeach() diff --git a/ports/gppanel/CONTROL b/ports/gppanel/CONTROL new file mode 100644 index 0000000000..580f233d2f --- /dev/null +++ b/ports/gppanel/CONTROL @@ -0,0 +1,5 @@ +Source: gppanel +Version: 2018-04-06 +Build-Depends: wxwidgets +Homepage: https://github.com/woollybah/gppanel +Description: gpPanel is chart libary for wxWidget. It inheritance from wxPanel and use modified wxMathPlot library at chart engine. diff --git a/ports/gppanel/portfile.cmake b/ports/gppanel/portfile.cmake new file mode 100644 index 0000000000..04ef9be56a --- /dev/null +++ b/ports/gppanel/portfile.cmake @@ -0,0 +1,42 @@ +include(vcpkg_common_functions) + +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO woollybah/gppanel + REF 5ef9674d893bbf5e17da66841cbc6aeeef051b25 + SHA512 a52eb5c4d9065e29d84374e9c484bae14cf7ff9a80fe6b025be108942a6c4683dd7f64830f78f0f7d45971f930df68f58dadf7c3915178e8908dd220d06a1e2c + HEAD_REF master + PATCHES 00001-fix-build.patch +) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +vcpkg_from_github( + OUT_SOURCE_PATH VCPKG_WX_FIND_SOURCE_PATH + REPO CaeruleusAqua/vcpkg-wx-find + REF 17993e942f677799b488a06ca659a8e46ff272c9 + SHA512 0fe07d3669f115c9b6a761abd7743f87e67f24d1eae3f3abee4715fa4d6b76af0d1ea3a4bd82dbdbed430ae50295e1722615ce0ee7d46182125f5048185ee153 + HEAD_REF master +) + +file(COPY ${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake DESTINATION ${VCPKG_WX_FIND_SOURCE_PATH}) +file(COPY ${CMAKE_ROOT}/Modules/FindPackageMessage.cmake DESTINATION ${VCPKG_WX_FIND_SOURCE_PATH}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DCMAKE_MODULE_PATH=${VCPKG_WX_FIND_SOURCE_PATH} +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() +vcpkg_fixup_cmake_targets(CONFIG_PATH share/cmake/gpPanel) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + +configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/gpPanel/copyright COPYONLY) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/gpPanel) diff --git a/ports/gppanel/usage b/ports/gppanel/usage new file mode 100644 index 0000000000..1ad1e6c42f --- /dev/null +++ b/ports/gppanel/usage @@ -0,0 +1,4 @@ +The package gppanel provides CMake targets: + + find_package(gpPanel CONFIG REQUIRED) + target_link_libraries(main PRIVATE gpPanel)