qucs_s/qucs-help/CMakeLists.txt
Vadim Kuznetzov eba11e32ea 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
2016-07-22 14:57:44 +03:00

111 lines
3.1 KiB
CMake

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}")
set(PROJECT_VERSION "${QUCS_VERSION}")
set(PROJECT_VENDOR "Qucs team. This program is licensed under the GNU GPL")
set(PROJECT_COPYRIGHT_YEAR "2014")
set(PROJECT_DOMAIN_FIRST "qucs")
set(PROJECT_DOMAIN_SECOND "org")
SET(CMAKE_BUILD_TYPE Debug)
ADD_DEFINITIONS( -DHAVE_CONFIG_H )
# 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( docs )
SET(QUCS-HELP_SRCS
main.cpp qucshelp.cpp htmldatafetcher.cpp
)
SET(QUCS-HELP_MOC_HDRS
qucshelp.h
)
QT4_WRAP_CPP(QUCS-HELP_MOC_SRCS ${QUCS-HELP_MOC_HDRS})
SET(RESOURCES qucshelp.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 qucshelp.icns)
# set where in the bundle to put the icns file
SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_SOURCE_DIR}/../qucs/bitmaps/qucshelp.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
# include the icns file in the target
SET(QUCS-HELP_SRCS ${QUCS-HELP_SRCS} ${CMAKE_CURRENT_SOURCE_DIR}/../qucs/bitmaps/qucshelp.icns)
ENDIF(APPLE)
ADD_EXECUTABLE(qucshelp MACOSX_BUNDLE WIN32
${QUCS-HELP_SRCS}
${QUCS-HELP_MOC_SRCS}
${RESOURCES_SRCS} )
TARGET_LINK_LIBRARIES(qucshelp ${QT_LIBRARIES})
INSTALL(TARGETS qucshelp
BUNDLE DESTINATION bin COMPONENT Runtime
RUNTIME DESTINATION bin COMPONENT Runtime
)
# man pages
INSTALL( FILES qucshelp.1 DESTINATION share/man/man1 )
INSTALL( FILES ./docs/qucs.1 DESTINATION share/man/man1 )
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()