Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Qucs Wideband Matching tool #555

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,6 @@ CMakeLists.txt.user
# except in the examples/ directory
!examples/*.sch
!examples/*.dpl
!qucs-doc/tutorial/sparameteramp/*/*.sch
!qucs-doc/tutorial/sparameteramp/*/*.dpl

# Xcode #
#########
Expand Down
1 change: 1 addition & 0 deletions qucs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ qucs-help/qucshelp
qucs-lib/qucslib
qucs-transcalc/qucstrans
qucs-rescodes/qucsrescodes
qucs-powercombining/qucspowercombining
qucs/qucs
debian/files
debian/qucs.debhelper.log
Expand Down
5 changes: 3 additions & 2 deletions qucs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/qucs-lib/qucslib.1.cmake.in ${CMAKE_C
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/qucs-powercombining/qucspowercombining.1.cmake.in ${CMAKE_CURRENT_SOURCE_DIR}/qucs-powercombining/qucspowercombining.1)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/qucs-rescodes/qucsrescodes.1.cmake.in ${CMAKE_CURRENT_SOURCE_DIR}/qucs-rescodes/qucsrescodes.1)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/qucs-transcalc/qucstrans.1.cmake.in ${CMAKE_CURRENT_SOURCE_DIR}/qucs-transcalc/qucstrans.1)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/qucs-wideband-matching/qucswideband.1.cmake.in ${CMAKE_CURRENT_SOURCE_DIR}/qucs-wideband-matching/qucswideband.1)

ADD_SUBDIRECTORY( man )
ADD_SUBDIRECTORY( qucs )
Expand All @@ -71,6 +72,8 @@ ADD_SUBDIRECTORY( qucs-rescodes )
ADD_SUBDIRECTORY( translations )
ADD_SUBDIRECTORY( contrib )
ADD_SUBDIRECTORY(qucs-powercombining)
ADD_SUBDIRECTORY(qucs-wideband-matching)


#
# Custom uninstall target
Expand All @@ -82,5 +85,3 @@ configure_file(

add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/uninstall.cmake)


3 changes: 3 additions & 0 deletions qucs/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ SUBDIRS = \
qucs-rescodes \
qucs-transcalc \
qucs-powercombining \
qucs-wideband-matching \
translations \
contrib \
examples \
Expand All @@ -58,6 +59,7 @@ app_PROGS = $(top_builddir)/qucs/qucs \
$(top_builddir)/qucs-lib/qucslib \
$(top_builddir)/qucs-rescodes/qucsrescodes \
$(top_builddir)/qucs-powercombining/qucspowercombining \
$(top_builddir)/qucs-wideband-matching/QucsWidebandMatching \
$(top_builddir)/qucs-transcalc/qucstrans

install-exec-hook: mac-install-apps mac-deploy-framework
Expand Down Expand Up @@ -85,6 +87,7 @@ mac-install-apps:
qucrescodes) desc="Qucs Resistor codes";; \
qucspowercombining) desc="Qucs Power combining";; \
qucstrans) desc="Qucs Transcalc";; \
qucspowercombining) desc="Qucs Power combining";; \
esac && \
cat $(srcdir)/Info.plist | \
sed -e "s/@version@/$(PACKAGE_VERSION)/g" | \
Expand Down
1 change: 1 addition & 0 deletions qucs/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,7 @@ AC_CONFIG_FILES([Makefile
qucs-attenuator/bitmaps/Makefile
qucs-rescodes/Makefile
qucs-powercombining/Makefile
qucs-wideband-matching/Makefile
qucs/Makefile
qucs/bitmaps/Makefile
qucs/octave/Makefile
Expand Down
163 changes: 163 additions & 0 deletions qucs/qucs-wideband-matching/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
PROJECT(QucsWidebandMatching CXX C)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
cmake_policy(VERSION 2.6)
FIND_PACKAGE(Qt4 COMPONENTS QtSvg QtGui QtCore)
INCLUDE(${QT_USE_FILE})
# use top VERSION file
file (STRINGS ${PROJECT_SOURCE_DIR}/../VERSION QUCS_VERSION)
message(STATUS "Configuring ${PROJECT_NAME} (GUI): VERSION ${QUCS_VERSION}")

set(PROJECT_VERSION "${QUCS_VERSION}")

set(PROJECT_VENDOR "Qucs team. This program is licensed under the GNU GPL")
set(PROJECT_COPYRIGHT_YEAR "2016")
set(PROJECT_DOMAIN_FIRST "qucs")
set(PROJECT_DOMAIN_SECOND "org")

SET(CMAKE_BUILD_TYPE Debug)

ADD_DEFINITIONS( -DHAVE_CONFIG_H )

# define variables
SET(BINARYDIR "${CMAKE_INSTALL_PREFIX}/bin/")
SET(BITMAPDIR "${CMAKE_INSTALL_PREFIX}/share/qucs/bitmaps/")
SET(DOCDIR "${CMAKE_INSTALL_PREFIX}/share/qucs/docs/")
SET(LANGUAGEDIR "${CMAKE_INSTALL_PREFIX}/share/qucs/lang/")
SET(LIBRARYDIR "${CMAKE_INSTALL_PREFIX}/share/qucs/library/")
SET(OCTAVEDIR "${CMAKE_INSTALL_PREFIX}/share/qucs/octave/")

# configure the header config.h
CONFIGURE_FILE (
"${PROJECT_SOURCE_DIR}/../config.h.cmake"
"${PROJECT_BINARY_DIR}/config.h"
)

INCLUDE_DIRECTORIES("${PROJECT_BINARY_DIR}")

SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall ") # enable warning level
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x ") # enable C++11

# flag not available in mingw 4.8.2, MSVC10
IF(NOT WIN32)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-register ")
ENDIF()

FIND_PACKAGE( Qt4 REQUIRED )
SET( QT_USE_QTGUI TRUE )

INCLUDE( ${QT_USE_FILE} )

ADD_DEFINITIONS(${QT_DEFINITIONS})

#ADD_SUBDIRECTORY( bitmaps ) -> added as resources

SET( wb_matching_sources main.cpp ui.cpp io.cpp MathOperations.cpp mat.cpp sparengine.cpp GRABIM.cpp)
SET( wb_matching_headers io.h MathOperations.h mat.h sparengine.h GRABIM.h)

SET( wb_matching_moc_headers ui.h)

QT4_WRAP_CPP( wb_matching_moc_sources ${wb_matching_moc_headers} )

SET(RESOURCES QucsWidebandMatching.qrc)

QT4_ADD_RESOURCES(RESOURCES_SRCS ${RESOURCES})

IF(APPLE)
# set information on Info.plist file
SET(MACOSX_BUNDLE_INFO_STRING "${PROJECT_NAME} ${PROJECT_VERSION}")
SET(MACOSX_BUNDLE_BUNDLE_VERSION "${PROJECT_NAME} ${PROJECT_VERSION}")
SET(MACOSX_BUNDLE_LONG_VERSION_STRING "${PROJECT_NAME} ${PROJECT_VERSION}")
SET(MACOSX_BUNDLE_SHORT_VERSION_STRING "${PROJECT_VERSION}")
SET(MACOSX_BUNDLE_COPYRIGHT "${PROJECT_COPYRIGHT_YEAR} ${PROJECT_VENDOR}")
SET(MACOSX_BUNDLE_GUI_IDENTIFIER "${PROJECT_DOMAIN_SECOND}.${PROJECT_DOMAIN_FIRST}")
SET(MACOSX_BUNDLE_BUNDLE_NAME "${PROJECT_NAME}")
SET(MACOSX_BUNDLE_ICON_FILE QucsWidebandMatching.icns)

# set where in the bundle to put the icns file
SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_SOURCE_DIR}/../qucs/bitmaps/QucsWidebandMatching.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
# include the icns file in the target
SET(wb_matching_sources ${wb_matching_sources} ${CMAKE_CURRENT_SOURCE_DIR}/../qucs/bitmaps/QucsWidebandMatching.icns)

ENDIF(APPLE)

ADD_EXECUTABLE( QucsWidebandMatching MACOSX_BUNDLE WIN32
${}
${wb_matching_moc_sources}
${wb_matching_sources}
${wb_matching_headers}
${RESOURCES_SRCS} )

TARGET_LINK_LIBRARIES( QucsWidebandMatching ${QT_LIBRARIES} )


#
# Prepare the installation
#
SET(plugin_dest_dir bin)
SET(qtconf_dest_dir bin)
SET(APPS "${CMAKE_INSTALL_PREFIX}/bin/${PROJECT_NAME}")
IF(APPLE)
SET(plugin_dest_dir ${PROJECT_NAME}.app/Contents/MacOS)
SET(qtconf_dest_dir ${PROJECT_NAME}.app/Contents/Resources)
SET(APPS "${CMAKE_INSTALL_PREFIX}/bin/${PROJECT_NAME}.app")
ENDIF(APPLE)

IF(WIN32)
SET(APPS "${CMAKE_INSTALL_PREFIX}/bin/${PROJECT_NAME}.exe")
ENDIF(WIN32)

#
# Install the Qucs application, on Apple, the bundle is
# installed as on other platforms it'll go into the bin directory.
#
INSTALL(TARGETS ${PROJECT_NAME}
BUNDLE DESTINATION bin COMPONENT Runtime
RUNTIME DESTINATION bin COMPONENT Runtime
)

# man pages
INSTALL( FILES QucsWidebandMatching.1 DESTINATION share/man/man1 )


#
# Install needed Qt plugins by copying directories from the qt installation
# One can cull what gets copied by using 'REGEX "..." EXCLUDE'
#
IF(APPLE)
INSTALL(DIRECTORY "${QT_PLUGINS_DIR}/imageformats" DESTINATION bin/${plugin_dest_dir}/plugins COMPONENT Runtime)
ENDIF()
#
# install a qt.conf file
# this inserts some cmake code into the install script to write the file
#
IF(APPLE)
INSTALL(CODE "
file(WRITE \"\${CMAKE_INSTALL_PREFIX}/bin/${qtconf_dest_dir}/qt.conf\" \"\")
" COMPONENT Runtime)
ENDIF()

#--------------------------------------------------------------------------------
# Use BundleUtilities to get all other dependencies for the application to work.
# It takes a bundle or executable along with possible plugins and inspects it
# for dependencies. If they are not system dependencies, they are copied.

# directories to look for dependencies
IF(APPLE)
SET(DIRS ${QT_LIBRARY_DIRS})
ENDIF()

# Now the work of copying dependencies into the bundle/package
# The quotes are escaped and variables to use at install time have their $ escaped
# An alternative is the do a configure_file() on a script and use install(SCRIPT ...).
# Note that the image plugins depend on QtSvg and QtXml, and it got those copied
# over.
IF(APPLE)
INSTALL(CODE "
file(GLOB_RECURSE QTPLUGINS
\"\${CMAKE_INSTALL_PREFIX}/bin/${plugin_dest_dir}/plugins/*${CMAKE_SHARED_LIBRARY_SUFFIX}\")
include(BundleUtilities)
fixup_bundle(\"${APPS}\" \"\${QTPLUGINS}\" \"${DIRS}\")
" COMPONENT Runtime)
ENDIF()


Loading