2013-06-02 20:00:43 +02:00
|
|
|
PROJECT(qucslib CXX C)
|
|
|
|
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
|
|
|
|
cmake_policy(VERSION 2.6)
|
|
|
|
|
2016-06-24 17:11:00 +03:00
|
|
|
IF(WITH_SPICE)
|
|
|
|
MESSAGE("SPICE support enabled")
|
|
|
|
SET(QUCS_NAME "qucs-s")
|
|
|
|
ELSE()
|
|
|
|
SET(QUCS_NAME "qucs")
|
|
|
|
ENDIF()
|
|
|
|
|
2014-09-02 14:29:45 +02:00
|
|
|
# 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}")
|
|
|
|
|
2014-07-08 13:28:00 +02:00
|
|
|
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")
|
|
|
|
|
2016-06-24 17:11:00 +03:00
|
|
|
#SET(CMAKE_BUILD_TYPE Debug)
|
2013-06-02 20:00:43 +02:00
|
|
|
|
|
|
|
ADD_DEFINITIONS( -DHAVE_CONFIG_H )
|
|
|
|
|
2013-09-17 15:52:09 +02:00
|
|
|
# configure the header config.h
|
2013-06-02 20:00:43 +02:00
|
|
|
CONFIGURE_FILE (
|
|
|
|
"${PROJECT_SOURCE_DIR}/../config.h.cmake"
|
|
|
|
"${PROJECT_BINARY_DIR}/config.h"
|
|
|
|
)
|
|
|
|
|
2015-01-08 18:53:22 +03:00
|
|
|
INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR} "../qucs" )
|
|
|
|
|
|
|
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall ") # enable warning level
|
|
|
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x ") # enable C++11
|
2013-06-02 20:00:43 +02:00
|
|
|
|
2015-07-01 21:54:12 +02:00
|
|
|
# flag not available in mingw 4.8.2, MSVC10
|
|
|
|
IF(NOT WIN32)
|
|
|
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-register ")
|
|
|
|
ENDIF()
|
|
|
|
|
2013-06-02 20:00:43 +02:00
|
|
|
FIND_PACKAGE( Qt4 REQUIRED )
|
|
|
|
SET( QT_USE_QTGUI TRUE )
|
|
|
|
|
|
|
|
INCLUDE( ${QT_USE_FILE} )
|
|
|
|
|
|
|
|
ADD_DEFINITIONS(${QT_DEFINITIONS})
|
|
|
|
|
|
|
|
SET(QUCSLIB_SRCS
|
2015-07-07 23:30:07 +02:00
|
|
|
main.cpp qucslib.cpp displaydialog.cpp symbolwidget.cpp librarydialog.cpp
|
2013-06-02 20:00:43 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
SET(QUCSLIB_MOC_HDRS
|
2015-07-07 23:30:07 +02:00
|
|
|
qucslib.h displaydialog.h symbolwidget.h librarydialog.h
|
2013-06-02 20:00:43 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
QT4_WRAP_CPP( QUCSLIB_MOC_SRCS ${QUCSLIB_MOC_HDRS} )
|
|
|
|
|
2013-09-17 15:52:09 +02:00
|
|
|
SET(RESOURCES qucslib.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 qucslib.icns)
|
|
|
|
|
|
|
|
# set where in the bundle to put the icns file
|
|
|
|
SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_SOURCE_DIR}/../qucs/bitmaps/qucslib.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
|
|
|
|
# include the icns file in the target
|
|
|
|
SET(QUCSLIB_SRCS ${QUCSLIB_SRCS} ${CMAKE_CURRENT_SOURCE_DIR}/../qucs/bitmaps/qucslib.icns)
|
|
|
|
|
|
|
|
ENDIF(APPLE)
|
|
|
|
|
2016-06-24 17:11:00 +03:00
|
|
|
ADD_EXECUTABLE(${QUCS_NAME}lib MACOSX_BUNDLE WIN32
|
2013-09-17 15:52:09 +02:00
|
|
|
${QUCSLIB_SRCS}
|
|
|
|
${QUCSLIB_MOC_SRCS}
|
|
|
|
${RESOURCES_SRCS} )
|
|
|
|
|
2016-06-24 17:11:00 +03:00
|
|
|
TARGET_LINK_LIBRARIES(${QUCS_NAME}lib ${QT_LIBRARIES})
|
2013-09-17 15:52:09 +02:00
|
|
|
|
2016-06-24 17:11:00 +03:00
|
|
|
INSTALL(TARGETS ${QUCS_NAME}lib
|
2013-12-04 21:45:07 +01:00
|
|
|
BUNDLE DESTINATION bin COMPONENT Runtime
|
2013-09-17 15:52:09 +02:00
|
|
|
RUNTIME DESTINATION bin COMPONENT Runtime
|
|
|
|
)
|
2013-06-02 20:00:43 +02:00
|
|
|
|
|
|
|
ADD_SUBDIRECTORY( library )
|
|
|
|
|
|
|
|
# man pages
|
|
|
|
INSTALL( FILES qucslib.1 DESTINATION share/man/man1 )
|
|
|
|
|