qucs_s/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

79 lines
1.8 KiB
CMake
Executable File

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}")
set(GIT unknown)
IF(EXISTS ${CMAKE_SOURCE_DIR}/../.git )
FIND_PACKAGE(Git)
# Get the latest abbreviated commit hash of the working branch
execute_process(
COMMAND ${GIT_EXECUTABLE} log --pretty=format:%h -n 1u
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_COMMIT_HASH
)
set(GIT ${GIT_COMMIT_HASH})
message(STATUS "Found Git repository, last commit hash: ${GIT}")
ENDIF()
message(STATUS "${PROJECT_NAME} ${CMAKE_INSTALL_PREFIX}
${qucs-suite_BINARY_DIR}" )
FIND_PACKAGE( Qt4 REQUIRED )
SET( QT_USE_QT TRUE )
#SET( QT_USE_QTXML TRUE )
#SET( QT_USE_QTSVG TRUE )
SET( QT_USE_QTCORE TRUE )
SET( QT_USE_QTGUI TRUE )
SET( QT_USE_QTSCRIPT TRUE )
SET( QT_DEBUG TRUE)
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-doc )
ADD_SUBDIRECTORY( qucs-filter )
ADD_SUBDIRECTORY( qucs-help )
ADD_SUBDIRECTORY( qucs-lib )
#ADD_SUBDIRECTORY( examples )
ADD_SUBDIRECTORY( translations )
#
# Custom uninstall target
#
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/uninstall.cmake"
IMMEDIATE @ONLY)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/uninstall.cmake)