2013-06-02 20:00:43 +02:00
|
|
|
PROJECT(qucs-suite CXX C)
|
2013-11-21 14:54:55 +01:00
|
|
|
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
|
|
|
cmake_policy(VERSION 2.8)
|
2013-06-02 20:00:43 +02:00
|
|
|
|
2014-09-02 14:29:45 +02:00
|
|
|
|
|
|
|
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()
|
|
|
|
|
2014-08-20 16:02:03 +02:00
|
|
|
message(STATUS "${PROJECT_NAME} ${CMAKE_INSTALL_PREFIX}
|
|
|
|
${qucs-suite_BINARY_DIR}" )
|
|
|
|
|
|
|
|
# Build qucs-core (release mode) FIXME
|
|
|
|
# * during release the repo directories are flattened
|
|
|
|
# * simply adding qucs-core, creates target name collision qucs vs (lib)qucs.
|
|
|
|
# * targets must be globally unique
|
|
|
|
# * external_project, does a copy (!)
|
|
|
|
# * this is perfect for 'external' tarbals or repos, but we have the code
|
|
|
|
# already in the tree, can we resolve the collision in another way?
|
|
|
|
include(ExternalProject)
|
|
|
|
IF(EXISTS ${CMAKE_SOURCE_DIR}/qucs-core )
|
|
|
|
ADD_SUBDIRECTORY( qucs-core )
|
|
|
|
#ExternalProject_Add ( qucs-core
|
|
|
|
# URL ${qucs-suite_SOURCE_DIR}/qucs-core/
|
|
|
|
# PREFIX ${qucs-suite_BINARY_DIR}
|
|
|
|
# INSTALL_DIR ${CMAKE_INSTALL_DIR}
|
|
|
|
# INSTALL_COMMAND "make install"
|
|
|
|
# #CMAKE_ARGS ${qucs-suite_CMAKE_ARGS}
|
|
|
|
# )
|
|
|
|
ENDIF()
|
|
|
|
|
2013-06-02 20:00:43 +02:00
|
|
|
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_QT3SUPPORT TRUE )
|
2014-02-26 19:57:18 +01:00
|
|
|
SET( QT_USE_QTSCRIPT TRUE )
|
2013-06-02 20:00:43 +02:00
|
|
|
|
|
|
|
SET( QT_DEBUG TRUE)
|
|
|
|
|
|
|
|
INCLUDE( ${QT_USE_FILE} )
|
|
|
|
|
|
|
|
ADD_DEFINITIONS(${QT_DEFINITIONS})
|
|
|
|
|
|
|
|
INCLUDE_DIRECTORIES(
|
|
|
|
${CMAKE_SOURCE_DIR}
|
|
|
|
${CMAKE_SOURCE_DIR}/qucs
|
|
|
|
#${CMAKE_SOURCE_DIR}/bitmaps ->no sources here
|
|
|
|
${CMAKE_SOURCE_DIR}/components
|
|
|
|
${CMAKE_SOURCE_DIR}/diagrams
|
|
|
|
${CMAKE_SOURCE_DIR}/dialogs
|
|
|
|
#${CMAKE_SOURCE_DIR}/octave ->no sources here
|
|
|
|
${CMAKE_SOURCE_DIR}/paintings
|
|
|
|
)
|
|
|
|
|
|
|
|
ADD_SUBDIRECTORY( qucs )
|
|
|
|
ADD_SUBDIRECTORY( qucs-attenuator )
|
|
|
|
#ADD_SUBDIRECTORY( qucs-doc )
|
|
|
|
ADD_SUBDIRECTORY( qucs-edit )
|
|
|
|
ADD_SUBDIRECTORY( qucs-filter )
|
2014-03-22 21:04:36 +01:00
|
|
|
# filter-v2 not completed, on OSX require libstc++, broken if default libc++ is used
|
|
|
|
# ADD_SUBDIRECTORY( qucs-filter-v2 )
|
2013-09-17 15:32:19 +02:00
|
|
|
ADD_SUBDIRECTORY( qucs-help )
|
2013-06-02 20:00:43 +02:00
|
|
|
ADD_SUBDIRECTORY( qucs-lib )
|
|
|
|
ADD_SUBDIRECTORY( qucs-transcalc )
|
2014-08-23 19:00:32 +02:00
|
|
|
ADD_SUBDIRECTORY( qucs-rescodes )
|
2013-06-02 20:00:43 +02:00
|
|
|
#ADD_SUBDIRECTORY( examples )
|
2014-02-11 23:52:01 +01:00
|
|
|
ADD_SUBDIRECTORY( contrib )
|
2013-11-21 14:54:55 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SET(LANGUAGES ar;ca;cs;de;es;fr;he;hu;it;jp;kk;pl;pt;ro;ru;sv;tr;uk)
|
|
|
|
SET(LANGUAGE_TS_FILES)
|
|
|
|
FOREACH(LANGUAGE ${LANGUAGES})
|
|
|
|
SET(TS_FILE "${CMAKE_CURRENT_SOURCE_DIR}/qucs/qucs_${LANGUAGE}.ts")
|
|
|
|
SET(LANGUAGE_TS_FILES ${LANGUAGE_TS_FILES} ${TS_FILE})
|
|
|
|
SET_SOURCE_FILES_PROPERTIES(${TS_FILE} PROPERTIES OUTPUT_LOCATION
|
|
|
|
"${CMake_BINARY_DIR}${CMAKE_DATA_DIR}")
|
|
|
|
ENDFOREACH(LANGUAGE ${LANGUAGES})
|
|
|
|
IF(LANGUAGE_TS_FILES)
|
|
|
|
QT4_CREATE_TRANSLATION(qm_files ${SRCS} ${LANGUAGE_TS_FILES})
|
|
|
|
ENDIF(LANGUAGE_TS_FILES)
|
|
|
|
|
2013-12-04 20:51:05 +01:00
|
|
|
|
|
|
|
#
|
|
|
|
# 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)
|
|
|
|
|
|
|
|
|