Skip to content

Commit

Permalink
Merge pull request musescore#5913 from igorkorsukov/mue_module_import
Browse files Browse the repository at this point in the history
Moved all imports/exports to importexport module
  • Loading branch information
anatoly-os authored Apr 11, 2020
2 parents f91dc43 + 7538f14 commit 667d4b2
Show file tree
Hide file tree
Showing 126 changed files with 251 additions and 171 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -787,8 +787,9 @@ if (BUILD_TELEMETRY_MODULE)
add_subdirectory(telemetry)
add_subdirectory(thirdparty/google_analytics)
endif (BUILD_TELEMETRY_MODULE)
add_subdirectory(global)

add_subdirectory(global)
add_subdirectory(importexport)
add_subdirectory(mscore)
add_subdirectory(main)

Expand All @@ -815,7 +816,6 @@ add_subdirectory(synthesizer)

subdirs(
awl bww2mxml share midi audiofile fluid libmscore
thirdparty/rtf2html thirdparty/beatroot
thirdparty/qzip
)

Expand Down
34 changes: 8 additions & 26 deletions bww2mxml/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,30 +26,22 @@ else (APPLE)
set(INCS "")
endif (APPLE)

add_library(bww STATIC
${INCS}
lexer.cpp
parser.cpp
symbols.cpp
)
set (BWW_DIR ${PROJECT_SOURCE_DIR}/importexport/bww)

if (MSVC)
set_target_properties (
bww
PROPERTIES
COMPILE_FLAGS "${PCH_INCLUDE}"
include_directories(
${BWW_DIR}
)
endif (MSVC)

if (NOT MINGW AND NOT APPLE AND NOT MSVC)
add_executable(bww2mxml
${INCS}
lexer.cpp
${BWW_SRC}
main.cpp
mxmlwriter.cpp
parser.cpp
symbols.cpp
writer.cpp
${BWW_DIR}/writer.cpp
${BWW_DIR}/lexer.cpp
${BWW_DIR}/parser.cpp
${BWW_DIR}/symbols.cpp
)

set_target_properties (
Expand All @@ -65,13 +57,3 @@ if (NOT MINGW AND NOT APPLE AND NOT MSVC)
ADD_DEPENDENCIES(bww2mxml mops2)
endif (NOT MINGW AND NOT APPLE AND NOT MSVC)

xcode_pch(bww all)

# Use MSVC pre-compiled headers
vstudio_pch( bww )

# MSVC does not depend on mops1 & mops2 for PCH
if (NOT MSVC)
ADD_DEPENDENCIES(bww mops1)
ADD_DEPENDENCIES(bww mops2)
endif (NOT MSVC)
90 changes: 90 additions & 0 deletions importexport/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
#=============================================================================
# MuseScore
# Music Composition & Notation
#
# Copyright (C) 2020 MuseScore BVBA and others
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#=============================================================================

set(MODULE importexport)

include (${PROJECT_SOURCE_DIR}/build/gch.cmake)

include_directories(
${PROJECT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
)

if (NOT MSVC)
set(_all_h_file "${PROJECT_BINARY_DIR}/all.h")
else (NOT MSVC)
set(_all_h_file "${PROJECT_SOURCE_DIR}/all.h")
endif (NOT MSVC)


include(${CMAKE_CURRENT_LIST_DIR}/musicxml/musicxml.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/midiimport/midiimport.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/midiexport/midiexport.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/ove/ove.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/guitarpro/guitarpro.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/musedata/musedata.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/bb/bb.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/capella/capella.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/bww/bww.cmake)

add_library (
${MODULE} STATIC
${_all_h_file}
${PCH}
${MUSICXML_SRC}
${MIDIIMPORT_SRC}
${MIDIEXPORT_SRC}
${OVE_SRC}
${GUITARPRO_SRC}
${MUSEDATA_SRC}
${BB_SRC}
${CAPELLA_SRC}
${BWW_SRC}
)

target_link_libraries(${MODULE}
${QT_LIBRARIES}
midi # for midi import
)

if (NOT MSVC)
set_target_properties (
${MODULE}
PROPERTIES
COMPILE_FLAGS "${PCH_INCLUDE} -g -Wall -Wextra -Winvalid-pch"
)
else (NOT MSVC)
set_target_properties (
${MODULE}
PROPERTIES
COMPILE_FLAGS "${PCH_INCLUDE}"
)
endif (NOT MSVC)

xcode_pch(${MODULE} all)

# Use MSVC pre-compiled headers
vstudio_pch( ${MODULE} )

# MSVC does not depend on mops1 & mops2 for PCH
if (NOT MSVC)
ADD_DEPENDENCIES(${MODULE} mops1)
ADD_DEPENDENCIES(${MODULE} mops2)
endif (NOT MSVC)

4 changes: 4 additions & 0 deletions importexport/bb/bb.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

file(GLOB BB_SRC
${CMAKE_CURRENT_LIST_DIR}/*.*
)
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions importexport/bww/bww.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

file(GLOB BWW_SRC
${CMAKE_CURRENT_LIST_DIR}/*.*
)
8 changes: 3 additions & 5 deletions mscore/importbww.cpp → importexport/bww/importbww.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
// TODO LVI 2011-10-30: determine how to report import errors.
// Currently all output (both debug and error reports) are done using qDebug.

#include "bww2mxml/lexer.h"
#include "bww2mxml/writer.h"
#include "bww2mxml/parser.h"
#include "lexer.h"
#include "writer.h"
#include "parser.h"

#include "libmscore/fraction.h"
#include "libmscore/barline.h"
Expand All @@ -44,8 +44,6 @@
#include "libmscore/tuplet.h"
#include "libmscore/volta.h"
#include "libmscore/segment.h"
#include "musescore.h"
#include "musicxml.h"

//---------------------------------------------------------
// addText
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 13 additions & 0 deletions importexport/capella/capella.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@


set (RTF2HTML_SRC
${PROJECT_SOURCE_DIR}/thirdparty/rtf2html/fmt_opts.cpp
${PROJECT_SOURCE_DIR}/thirdparty/rtf2html/rtf2html.cpp
${PROJECT_SOURCE_DIR}/thirdparty/rtf2html/rtf_keyword.cpp
${PROJECT_SOURCE_DIR}/thirdparty/rtf2html/rtf_table.cpp
)

file(GLOB CAPELLA_SRC
${CMAKE_CURRENT_LIST_DIR}/*.*
${RTF2HTML_SRC}
)
File renamed without changes.
1 change: 0 additions & 1 deletion mscore/capella.h → importexport/capella/capella.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#ifndef __CAPELLA_H__
#define __CAPELLA_H__

#include "globals.h"
#include "libmscore/xml.h"

namespace Ms {
Expand Down
File renamed without changes.
4 changes: 4 additions & 0 deletions importexport/guitarpro/guitarpro.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

file(GLOB GUITARPRO_SRC
${CMAKE_CURRENT_LIST_DIR}/*.*
)
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//=============================================================================

#include "importgtp.h"
#include "globals.h"

#include <libmscore/score.h>
#include <libmscore/measurebase.h>
#include <libmscore/text.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//=============================================================================

#include "importgtp.h"
#include "globals.h"

#include <libmscore/score.h>
#include <libmscore/measurebase.h>
#include <libmscore/text.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//=============================================================================

#include "importgtp.h"
#include "globals.h"

#include <libmscore/score.h>
#include <libmscore/measurebase.h>
#include <libmscore/text.h>
Expand Down
File renamed without changes.
6 changes: 4 additions & 2 deletions mscore/importgtp.cpp → importexport/guitarpro/importgtp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@
//=============================================================================

#include "importgtp.h"

#include "importptb.h"
#include "globals.h"
#include "preferences.h"

#include "mscore/preferences.h"

#include <libmscore/measurebase.h>
#include <libmscore/text.h>
#include <libmscore/box.h>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,21 @@
//=============================================================================

#include "exportmidi.h"
#include "midi/midifile.h"

#include "libmscore/score.h"
#include "libmscore/part.h"
#include "libmscore/staff.h"
#include "libmscore/tempo.h"
#include "synthesizer/event.h"
#include "libmscore/sig.h"
#include "libmscore/key.h"
#include "libmscore/text.h"
#include "libmscore/measure.h"
#include "libmscore/repeatlist.h"
#include "libmscore/synthesizerstate.h"
#include "preferences.h"

#include "midi/midifile.h"
#include "synthesizer/event.h"
#include "mscore/preferences.h"

namespace Ms {

Expand Down
File renamed without changes.
5 changes: 5 additions & 0 deletions importexport/midiexport/midiexport.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@


file(GLOB MIDIEXPORT_SRC
${CMAKE_CURRENT_LIST_DIR}/*.*
)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 14 additions & 0 deletions importexport/midiimport/midiimport.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@


set (BEATROOT_SRC
${PROJECT_SOURCE_DIR}/thirdparty/beatroot/Agent.cpp
${PROJECT_SOURCE_DIR}/thirdparty/beatroot/AgentList.cpp
${PROJECT_SOURCE_DIR}/thirdparty/beatroot/BeatTracker.cpp
${PROJECT_SOURCE_DIR}/thirdparty/beatroot/Induction.cpp
)


file(GLOB MIDIIMPORT_SRC
${CMAKE_CURRENT_LIST_DIR}/*.*
${BEATROOT_SRC}
)
4 changes: 4 additions & 0 deletions importexport/musedata/musedata.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

file(GLOB MUSEDATA_SRC
${CMAKE_CURRENT_LIST_DIR}/*.*
)
File renamed without changes.
File renamed without changes.
14 changes: 8 additions & 6 deletions mscore/exportxml.cpp → importexport/musicxml/exportxml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,14 @@

#include <math.h>
#include "config.h"
//#include "musescore.h"
#include "file.h"

#include "musicxml.h"
#include "musicxmlfonthandler.h"

#include "thirdparty/qzip/qzipwriter_p.h"

#include "mscore/preferences.h"

#include "libmscore/score.h"
#include "libmscore/rest.h"
#include "libmscore/chord.h"
Expand All @@ -52,7 +58,6 @@
#include "libmscore/part.h"
#include "libmscore/measure.h"
#include "libmscore/style.h"
#include "musicxml.h"
#include "libmscore/slur.h"
#include "libmscore/hairpin.h"
#include "libmscore/dynamic.h"
Expand Down Expand Up @@ -84,21 +89,18 @@
#include "libmscore/navigate.h"
#include "libmscore/spanner.h"
#include "libmscore/drumset.h"
#include "preferences.h"
#include "libmscore/mscore.h"
#include "libmscore/accidental.h"
#include "libmscore/breath.h"
#include "libmscore/chordline.h"
#include "libmscore/figuredbass.h"
#include "libmscore/stringdata.h"
#include "libmscore/rehearsalmark.h"
#include "thirdparty/qzip/qzipwriter_p.h"
#include "libmscore/fret.h"
#include "libmscore/tie.h"
#include "libmscore/undo.h"
#include "libmscore/textline.h"
#include "libmscore/fermata.h"
#include "musicxmlfonthandler.h"
#include "libmscore/textframe.h"
#include "libmscore/instrchange.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
#include "importmxmllogger.h"
#include "importmxmlpass1.h"
#include "importmxmlpass2.h"
#include "preferences.h"

#include "mscore/preferences.h"

namespace Ms {

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
#include "importmxmlnoteduration.h"
#include "importmxmlpass1.h"
#include "importmxmlpass2.h"
#include "preferences.h"

#include "mscore/preferences.h"

namespace Ms {

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@
#include "importmxmlpass2.h"
#include "musicxmlfonthandler.h"
#include "musicxmlsupport.h"
#include "preferences.h"

#include "mscore/preferences.h"

namespace Ms {

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions importexport/musicxml/musicxml.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

file(GLOB MUSICXML_SRC
${CMAKE_CURRENT_LIST_DIR}/*.*
)
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 667d4b2

Please sign in to comment.