mirror of
https://github.com/ra3xdh/qucs_s
synced 2025-03-28 21:13:26 +00:00
Implemented building of two apllications with CMake
1. Added WITH_SPICE CMake variable. If it is not set usual Qucs will be built. Application name is set to "qucs". If it is set, Qucs-S will be built. Application name will be to "qucs-s". 2. Removed hardoced resources paths in "/usr/share/qucs", etc and application names. Now resource paths depends on application name. Resources will be installed into PREFIX/share/qucs-s/ for Qucs-S 3. Introduced a special definition QUCS_NAME in config.h. It will store real application name. 4. Disabled default Debug mode for CMake 5. Exclude qucsattenuator, qucsedit, qucsresocdes, qucstrans, and qucshelp (except docs) from the build system when building with WITH_SPICE switch
This commit is contained in:
parent
f976e35d2a
commit
eba11e32ea
@ -2,6 +2,12 @@ PROJECT(qucs-suite CXX)
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
||||
cmake_policy(VERSION 2.8)
|
||||
|
||||
IF(WITH_SPICE)
|
||||
MESSAGE("SPICE support enabled")
|
||||
SET(QUCS_NAME "qucs-s")
|
||||
ELSE()
|
||||
SET(QUCS_NAME "qucs")
|
||||
ENDIF()
|
||||
|
||||
file (STRINGS "${qucs-suite_SOURCE_DIR}/VERSION" QUCS_VERSION)
|
||||
message(STATUS "Configuring Qucs: VERSION ${QUCS_VERSION}")
|
||||
@ -38,19 +44,24 @@ INCLUDE( ${QT_USE_FILE} )
|
||||
|
||||
ADD_DEFINITIONS(${QT_DEFINITIONS})
|
||||
|
||||
|
||||
IF(NOT WITH_SPICE)
|
||||
ADD_SUBDIRECTORY( qucs-attenuator )
|
||||
ADD_SUBDIRECTORY( qucs-edit )
|
||||
ADD_SUBDIRECTORY( qucs-transcalc )
|
||||
ADD_SUBDIRECTORY( qucs-rescodes )
|
||||
ADD_SUBDIRECTORY( contrib )
|
||||
ENDIF()
|
||||
|
||||
ADD_SUBDIRECTORY( qucs )
|
||||
ADD_SUBDIRECTORY( qucs-activefilter )
|
||||
ADD_SUBDIRECTORY( qucs-attenuator )
|
||||
#ADD_SUBDIRECTORY( qucs-doc )
|
||||
ADD_SUBDIRECTORY( qucs-edit )
|
||||
ADD_SUBDIRECTORY( qucs-filter )
|
||||
ADD_SUBDIRECTORY( qucs-help )
|
||||
ADD_SUBDIRECTORY( qucs-lib )
|
||||
ADD_SUBDIRECTORY( qucs-transcalc )
|
||||
ADD_SUBDIRECTORY( qucs-rescodes )
|
||||
#ADD_SUBDIRECTORY( examples )
|
||||
ADD_SUBDIRECTORY( translations )
|
||||
ADD_SUBDIRECTORY( contrib )
|
||||
|
||||
|
||||
|
||||
#
|
||||
|
@ -1,7 +1,10 @@
|
||||
|
||||
#define QUCS_NAME "@QUCS_NAME@"
|
||||
|
||||
#define PACKAGE_VERSION "@PROJECT_VERSION@"
|
||||
#define PACKAGE_STRING "qucs @PROJECT_VERSION@"
|
||||
|
||||
#define HAVE_QTABWIDGET_SETMOVABLE "@HAVE_QTABWIDGET_SETMOVABLE@"
|
||||
#define WITH_SPICE "@WITH_SPICE@"
|
||||
|
||||
#define GIT "@GIT@"
|
||||
|
@ -2,6 +2,13 @@ PROJECT(qucsactivefilter CXX C)
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
|
||||
cmake_policy(VERSION 2.6)
|
||||
|
||||
IF(WITH_SPICE)
|
||||
MESSAGE("SPICE support enabled")
|
||||
SET(QUCS_NAME "qucs-s")
|
||||
ELSE()
|
||||
SET(QUCS_NAME "qucs")
|
||||
ENDIF()
|
||||
|
||||
# use top VERSION file
|
||||
file (STRINGS ${PROJECT_SOURCE_DIR}/../VERSION QUCS_VERSION)
|
||||
message(STATUS "Configuring ${PROJECT_NAME} (GUI): VERSION ${QUCS_VERSION}")
|
||||
@ -13,7 +20,7 @@ set(PROJECT_COPYRIGHT_YEAR "2014")
|
||||
set(PROJECT_DOMAIN_FIRST "qucs")
|
||||
set(PROJECT_DOMAIN_SECOND "org")
|
||||
|
||||
SET(CMAKE_BUILD_TYPE Debug)
|
||||
#SET(CMAKE_BUILD_TYPE Debug)
|
||||
|
||||
ADD_DEFINITIONS( -DHAVE_CONFIG_H )
|
||||
|
||||
@ -83,14 +90,14 @@ IF(APPLE)
|
||||
|
||||
ENDIF(APPLE)
|
||||
|
||||
ADD_EXECUTABLE(qucsactivefilter MACOSX_BUNDLE WIN32
|
||||
ADD_EXECUTABLE(${QUCS_NAME}activefilter MACOSX_BUNDLE WIN32
|
||||
${QUCS-ACTIVE-FILTER_SRCS}
|
||||
${QUCS-ACTIVE-FILTER_MOC_SRCS}
|
||||
${RESOURCES_SRCS} )
|
||||
|
||||
TARGET_LINK_LIBRARIES(qucsactivefilter ${QT_LIBRARIES})
|
||||
TARGET_LINK_LIBRARIES(${QUCS_NAME}activefilter ${QT_LIBRARIES})
|
||||
|
||||
INSTALL(TARGETS qucsactivefilter
|
||||
INSTALL(TARGETS ${QUCS_NAME}activefilter
|
||||
BUNDLE DESTINATION bin COMPONENT Runtime
|
||||
RUNTIME DESTINATION bin COMPONENT Runtime
|
||||
)
|
||||
|
@ -2,6 +2,13 @@ PROJECT(qucsfilter CXX C)
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
|
||||
cmake_policy(VERSION 2.6)
|
||||
|
||||
IF(WITH_SPICE)
|
||||
MESSAGE("SPICE support enabled")
|
||||
SET(QUCS_NAME "qucs-s")
|
||||
ELSE()
|
||||
SET(QUCS_NAME "qucs")
|
||||
ENDIF()
|
||||
|
||||
# use top VERSION file
|
||||
file (STRINGS ${PROJECT_SOURCE_DIR}/../VERSION QUCS_VERSION)
|
||||
message(STATUS "Configuring ${PROJECT_NAME} (GUI): VERSION ${QUCS_VERSION}")
|
||||
@ -13,10 +20,11 @@ set(PROJECT_COPYRIGHT_YEAR "2014")
|
||||
set(PROJECT_DOMAIN_FIRST "qucs")
|
||||
set(PROJECT_DOMAIN_SECOND "org")
|
||||
|
||||
SET(CMAKE_BUILD_TYPE Debug)
|
||||
#SET(CMAKE_BUILD_TYPE Debug)
|
||||
|
||||
ADD_DEFINITIONS( -DHAVE_CONFIG_H )
|
||||
|
||||
|
||||
# configure the header config.h
|
||||
CONFIGURE_FILE (
|
||||
"${PROJECT_SOURCE_DIR}/../config.h.cmake"
|
||||
@ -102,15 +110,15 @@ IF(APPLE)
|
||||
|
||||
ENDIF(APPLE)
|
||||
|
||||
ADD_EXECUTABLE(qucsfilter MACOSX_BUNDLE WIN32
|
||||
ADD_EXECUTABLE(${QUCS_NAME}filter MACOSX_BUNDLE WIN32
|
||||
${QUCS-FILTER_SRCS}
|
||||
${QUCS-FILTER_HDRS}
|
||||
${QUCS-FILTER_MOC_SRCS}
|
||||
${RESOURCES_SRCS} )
|
||||
|
||||
TARGET_LINK_LIBRARIES(qucsfilter ${QT_LIBRARIES})
|
||||
TARGET_LINK_LIBRARIES(${QUCS_NAME}filter ${QT_LIBRARIES})
|
||||
|
||||
INSTALL(TARGETS qucsfilter
|
||||
INSTALL(TARGETS ${QUCS_NAME}filter
|
||||
BUNDLE DESTINATION bin COMPONENT Runtime
|
||||
RUNTIME DESTINATION bin COMPONENT Runtime
|
||||
)
|
||||
|
@ -2,6 +2,15 @@ PROJECT(qucshelp CXX C)
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
|
||||
cmake_policy(VERSION 2.6)
|
||||
|
||||
IF(WITH_SPICE)
|
||||
MESSAGE("SPICE support enabled")
|
||||
SET(QUCS_NAME "qucs-s")
|
||||
ELSE()
|
||||
SET(QUCS_NAME "qucs")
|
||||
ENDIF()
|
||||
|
||||
IF(NOT WITH_SPICE)
|
||||
|
||||
# use top VERSION file
|
||||
file (STRINGS ${PROJECT_SOURCE_DIR}/../VERSION QUCS_VERSION)
|
||||
message(STATUS "Configuring ${PROJECT_NAME} (GUI): VERSION ${QUCS_VERSION}")
|
||||
@ -93,3 +102,9 @@ INSTALL( FILES ./docs/qucsdigi.1 DESTINATION share/man/man1 )
|
||||
INSTALL( FILES ./docs/qucsdigilib.1 DESTINATION share/man/man1 )
|
||||
INSTALL( FILES ./docs/qucsveri.1 DESTINATION share/man/man1 )
|
||||
|
||||
ELSE()
|
||||
|
||||
ADD_SUBDIRECTORY( docs )
|
||||
INSTALL( FILES ./docs/${QUCS_NAME}.1 DESTINATION share/man/man1 )
|
||||
|
||||
ENDIF()
|
||||
|
@ -8,5 +8,5 @@ optimization1.png optimization4.png optimization7.png qucsdigi.png subcircuit.p
|
||||
optimization2.png optimization5.png optimization8.png qucsmain.png wire.png )
|
||||
|
||||
# installation of documentation
|
||||
INSTALL(FILES ${HTML} ${PNGS} DESTINATION share/qucs/docs/cs)
|
||||
INSTALL(FILES ${HTML} ${PNGS} DESTINATION share/${QUCS_NAME}/docs/cs)
|
||||
|
||||
|
@ -9,5 +9,5 @@ optimization2.png optimization5.png optimization8.png qucshaupt.png wire.png
|
||||
index.html matching.html programs.html start.html start_opt.html)
|
||||
|
||||
# installation of documentation
|
||||
INSTALL(FILES ${HTML} ${PNGS} DESTINATION share/qucs/docs/de)
|
||||
INSTALL(FILES ${HTML} ${PNGS} DESTINATION share/${QUCS_NAME}/docs/de)
|
||||
|
||||
|
@ -11,5 +11,5 @@ SET(PNGS qucsmain.png paste.png wire.png select.png contab.png subcircuit.png
|
||||
|
||||
|
||||
# installation of documentation
|
||||
INSTALL(FILES ${HTML} ${PNGS} DESTINATION share/qucs/docs/en)
|
||||
INSTALL(FILES ${HTML} ${PNGS} DESTINATION share/${QUCS_NAME}/docs/en)
|
||||
|
||||
|
@ -5,5 +5,5 @@ SET(HTML index.html mathfunc.html programs.html short.html start.html subcircuit
|
||||
SET(PNGS contab.png paste.png qucsmain.png select.png subcircuit.png wire.png )
|
||||
|
||||
# installation of documentation
|
||||
INSTALL(FILES ${HTML} ${PNGS} DESTINATION share/qucs/docs/es)
|
||||
INSTALL(FILES ${HTML} ${PNGS} DESTINATION share/${QUCS_NAME}/docs/es)
|
||||
|
||||
|
@ -5,5 +5,5 @@ SET(HTML index.html mathfunc.html short.html start.html subcircuit.html)
|
||||
SET(PNGS contab.png paste.png qucsmain.png select.png subcircuit.png wire.png)
|
||||
|
||||
# installation of documentation
|
||||
INSTALL(FILES ${HTML} ${PNGS} DESTINATION share/qucs/docs/fr)
|
||||
INSTALL(FILES ${HTML} ${PNGS} DESTINATION share/${QUCS_NAME}/docs/fr)
|
||||
|
||||
|
@ -8,5 +8,5 @@ optimization1.png optimization4.png optimization7.png qucsdigi.png subcircuit.p
|
||||
optimization2.png optimization5.png optimization8.png qucsmain.png wire.png)
|
||||
|
||||
# installation of documentation
|
||||
INSTALL(FILES ${HTML} ${PNGS} DESTINATION share/qucs/docs/pt)
|
||||
INSTALL(FILES ${HTML} ${PNGS} DESTINATION share/${QUCS_NAME}/docs/pt)
|
||||
|
||||
|
@ -8,5 +8,5 @@ optimization1.png optimization4.png optimization7.png qucsdigi.png subcircuit.p
|
||||
optimization2.png optimization5.png optimization8.png qucsmain.png wire.png)
|
||||
|
||||
# installation of documentation
|
||||
INSTALL(FILES ${HTML} ${PNGS} DESTINATION share/qucs/docs/ru)
|
||||
INSTALL(FILES ${HTML} ${PNGS} DESTINATION share/${QUCS_NAME}/docs/ru)
|
||||
|
||||
|
@ -8,5 +8,5 @@ optimization1.png optimization4.png optimization7.png qucsdigi.png subcircuit.p
|
||||
optimization2.png optimization5.png optimization8.png qucsmain.png wire.png)
|
||||
|
||||
# installation of documentation
|
||||
INSTALL(FILES ${HTML} ${PNGS} DESTINATION share/qucs/docs/uk)
|
||||
INSTALL(FILES ${HTML} ${PNGS} DESTINATION share/${QUCS_NAME}/docs/uk)
|
||||
|
||||
|
@ -2,6 +2,13 @@ PROJECT(qucslib CXX C)
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
|
||||
cmake_policy(VERSION 2.6)
|
||||
|
||||
IF(WITH_SPICE)
|
||||
MESSAGE("SPICE support enabled")
|
||||
SET(QUCS_NAME "qucs-s")
|
||||
ELSE()
|
||||
SET(QUCS_NAME "qucs")
|
||||
ENDIF()
|
||||
|
||||
# use top VERSION file
|
||||
file (STRINGS ${PROJECT_SOURCE_DIR}/../VERSION QUCS_VERSION)
|
||||
message(STATUS "Configuring ${PROJECT_NAME} (GUI): VERSION ${QUCS_VERSION}")
|
||||
@ -13,7 +20,7 @@ set(PROJECT_COPYRIGHT_YEAR "2014")
|
||||
set(PROJECT_DOMAIN_FIRST "qucs")
|
||||
set(PROJECT_DOMAIN_SECOND "org")
|
||||
|
||||
SET(CMAKE_BUILD_TYPE Debug)
|
||||
#SET(CMAKE_BUILD_TYPE Debug)
|
||||
|
||||
ADD_DEFINITIONS( -DHAVE_CONFIG_H )
|
||||
|
||||
@ -71,14 +78,14 @@ IF(APPLE)
|
||||
|
||||
ENDIF(APPLE)
|
||||
|
||||
ADD_EXECUTABLE(qucslib MACOSX_BUNDLE WIN32
|
||||
ADD_EXECUTABLE(${QUCS_NAME}lib MACOSX_BUNDLE WIN32
|
||||
${QUCSLIB_SRCS}
|
||||
${QUCSLIB_MOC_SRCS}
|
||||
${RESOURCES_SRCS} )
|
||||
|
||||
TARGET_LINK_LIBRARIES(qucslib ${QT_LIBRARIES})
|
||||
TARGET_LINK_LIBRARIES(${QUCS_NAME}lib ${QT_LIBRARIES})
|
||||
|
||||
INSTALL(TARGETS qucslib
|
||||
INSTALL(TARGETS ${QUCS_NAME}lib
|
||||
BUNDLE DESTINATION bin COMPONENT Runtime
|
||||
RUNTIME DESTINATION bin COMPONENT Runtime
|
||||
)
|
||||
|
@ -4,5 +4,5 @@ etd.mod
|
||||
etd.ifs
|
||||
)
|
||||
|
||||
INSTALL( FILES ${AN_CM_resources} DESTINATION share/qucs/library/AnalogueCM )
|
||||
INSTALL( FILES ${AN_CM_resources} DESTINATION share/${QUCS_NAME}/library/AnalogueCM )
|
||||
|
||||
|
@ -26,6 +26,6 @@ ngspice.blacklist
|
||||
xyce.blacklist
|
||||
)
|
||||
|
||||
INSTALL( FILES ${COMPLIBS} ${BLACKLIST} DESTINATION share/qucs/library )
|
||||
INSTALL( FILES ${COMPLIBS} ${BLACKLIST} DESTINATION share/${QUCS_NAME}/library )
|
||||
|
||||
ADD_SUBDIRECTORY( AnalogueCM )
|
||||
|
@ -13,6 +13,13 @@ PROJECT(qucs CXX)
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
|
||||
cmake_policy(VERSION 2.6)
|
||||
|
||||
IF(WITH_SPICE)
|
||||
MESSAGE("SPICE support enabled")
|
||||
SET(QUCS_NAME "${PROJECT_NAME}-s")
|
||||
ELSE()
|
||||
SET(QUCS_NAME "${PROJECT_NAME}")
|
||||
ENDIF()
|
||||
|
||||
# use top VERSION file
|
||||
file (STRINGS ${PROJECT_SOURCE_DIR}/../VERSION QUCS_VERSION)
|
||||
message(STATUS "Configuring ${PROJECT_NAME} (GUI): VERSION ${QUCS_VERSION}")
|
||||
@ -25,7 +32,7 @@ set(PROJECT_DOMAIN_FIRST "qucs")
|
||||
set(PROJECT_DOMAIN_SECOND "org")
|
||||
|
||||
#
|
||||
SET(CMAKE_BUILD_TYPE Debug)
|
||||
#SET(CMAKE_BUILD_TYPE Debug)
|
||||
|
||||
# If Git hash not defined, try to define it
|
||||
IF(NOT GIT)
|
||||
@ -237,7 +244,7 @@ ENDIF(APPLE)
|
||||
#
|
||||
# CMake's way of creating an executable
|
||||
#
|
||||
ADD_EXECUTABLE( qucs MACOSX_BUNDLE WIN32
|
||||
ADD_EXECUTABLE( ${QUCS_NAME} MACOSX_BUNDLE WIN32
|
||||
${QUCS_HDRS}
|
||||
${QUCS_SRCS}
|
||||
${QUCS_MOC_SRCS}
|
||||
@ -246,7 +253,7 @@ ADD_EXECUTABLE( qucs MACOSX_BUNDLE WIN32
|
||||
#
|
||||
# Tell CMake which libraries we need to link our executable against.
|
||||
#
|
||||
TARGET_LINK_LIBRARIES( qucs components diagrams dialogs paintings extsimkernels spicecomponents ${QT_LIBRARIES} )
|
||||
TARGET_LINK_LIBRARIES( ${QUCS_NAME} components diagrams dialogs paintings extsimkernels spicecomponents ${QT_LIBRARIES} )
|
||||
|
||||
#
|
||||
# Prepare the installation
|
||||
@ -268,7 +275,7 @@ 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 qucs
|
||||
INSTALL(TARGETS ${QUCS_NAME}
|
||||
BUNDLE DESTINATION bin COMPONENT Runtime
|
||||
RUNTIME DESTINATION bin COMPONENT Runtime
|
||||
)
|
||||
@ -314,14 +321,15 @@ INSTALL(CODE "
|
||||
" COMPONENT Runtime)
|
||||
ENDIF()
|
||||
|
||||
IF(NOT WITH_SPICE)
|
||||
# Install wrapper scripts
|
||||
IF(WIN32)
|
||||
SET(SCRIPTS qucsdigi.bat qucsveri.bat qucsdigilib.bat)
|
||||
# SET(SCRIPTS qucsdigi.bat qucsveri.bat qucsdigilib.bat)
|
||||
ELSE()
|
||||
SET(SCRIPTS qucsdigi qucsveri qucsdigilib)
|
||||
# SET(SCRIPTS qucsdigi qucsveri qucsdigilib)
|
||||
ENDIF()
|
||||
INSTALL( FILES ${SCRIPTS} DESTINATION bin/ )
|
||||
|
||||
ENDIF()
|
||||
|
||||
# To Create a package, one can run "cpack -G DragNDrop CPackConfig.cmake" on Mac OS X
|
||||
# where CPackConfig.cmake is created by including CPack
|
||||
|
@ -5,5 +5,5 @@ cmlib.mingw32.rules.mk
|
||||
)
|
||||
|
||||
# installation of transmission lines
|
||||
INSTALL( FILES ${RULES_MK} DESTINATION share/qucs/xspice_cmlib )
|
||||
INSTALL( FILES ${RULES_MK} DESTINATION share/${QUCS_NAME}/xspice_cmlib )
|
||||
|
||||
|
@ -6,5 +6,5 @@ loadQucsDataSet.m plotCartesian2D2V.m plotTimeFFT.m
|
||||
loadQucsVariable.m plotFFT.m showQucsDataSet.m
|
||||
)
|
||||
|
||||
INSTALL(FILES ${BASICS} DESTINATION share/qucs/octave/)
|
||||
INSTALL(FILES ${BASICS} DESTINATION share/${QUCS_NAME}/octave/)
|
||||
|
||||
|
@ -7,5 +7,5 @@ SET(BASICS
|
||||
rc_ac_sweep.net
|
||||
)
|
||||
|
||||
INSTALL(FILES ${BASICS} DESTINATION share/qucs/python/)
|
||||
INSTALL(FILES ${BASICS} DESTINATION share/${QUCS_NAME}/python/)
|
||||
|
||||
|
@ -5,5 +5,5 @@ opamp3t.sym
|
||||
)
|
||||
|
||||
# installation of transmission lines
|
||||
INSTALL( FILES ${SYMBOLS} DESTINATION share/qucs/symbols )
|
||||
INSTALL( FILES ${SYMBOLS} DESTINATION share/${QUCS_NAME}/symbols )
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user