X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=CMakeLists.txt;h=3859c9133b61e01ffb93599f684fd550470e6a48;hp=1fa6d5ad4f45809ba77163960533cb6d44c94f09;hb=11a04e2a8ed47ed159b68cbe6f56aedd388e445f;hpb=269528f55e7fd77f762c2008d257921cd30e1519 diff --git a/CMakeLists.txt b/CMakeLists.txt index 1fa6d5ad..3859c913 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ - +## ## This file is part of the PulseView project. ## ## Copyright (C) 2012 Joel Holdsworth @@ -24,7 +24,6 @@ include(FindPkgConfig) include(GNUInstallDirs) set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMake") -include(cotire) project(pulseview) @@ -35,6 +34,7 @@ project(pulseview) option(DISABLE_WERROR "Build without -Werror" FALSE) option(ENABLE_SIGNALS "Build with UNIX signals" TRUE) option(ENABLE_DECODE "Build with libsigrokdecode" FALSE) +option(ENABLE_COTIRE "Enable cotire" FALSE) option(ENABLE_TESTS "Enable unit tests" FALSE) option(STATIC_PKGDEPS_LIBS "Statically link to (pkgconfig) libraries" FALSE) @@ -47,7 +47,7 @@ if(WIN32) set(Boost_USE_STATIC_LIBS on) add_definitions(-DBOOST_THREAD_USE_LIB) - # Windsws does not support UNIX signals + # Windows does not support UNIX signals. set(ENABLE_SIGNALS FALSE) endif() @@ -55,9 +55,7 @@ endif() #= Dependencies #------------------------------------------------------------------------------- -list(APPEND PKGDEPS - libsigrok>=0.2.0 -) +list(APPEND PKGDEPS libsigrok>=0.2.0) if(ENABLE_DECODE) list(APPEND PKGDEPS libsigrokdecode>=0.2.0) @@ -149,7 +147,7 @@ set(pulseview_SOURCES pv/widgets/wellarray.cpp ) -# This list includes only QObject derrived class headers +# This list includes only QObject derived class headers. set(pulseview_HEADERS pv/mainwindow.h pv/sigsession.h @@ -215,6 +213,13 @@ if(ENABLE_DECODE) ) endif() +if(WIN32) + # Use the sigrok icon for the pulseview.exe executable. + set(CMAKE_RC_COMPILE_OBJECT "${CMAKE_RC_COMPILER} -O coff -I${CMAKE_CURRENT_SOURCE_DIR} ") + enable_language(RC) + list(APPEND pulseview_SOURCES pulseviewico.rc) +endif() + qt4_wrap_cpp(pulseview_HEADERS_MOC ${pulseview_HEADERS}) qt4_wrap_ui(pulseview_FORMS_HEADERS ${pulseview_FORMS}) qt4_add_resources(pulseview_RESOURCES_RCC ${pulseview_RESOURCES}) @@ -226,6 +231,7 @@ include(${QT_USE_FILE}) #------------------------------------------------------------------------------- add_definitions(${QT_DEFINITIONS}) +add_definitions(-D__STDC_LIMIT_MACROS) add_definitions(-Wall -Wextra) if(ENABLE_DECODE) @@ -272,6 +278,15 @@ else() list(APPEND PULSEVIEW_LINK_LIBS ${PKGDEPS_LIBRARIES}) endif() +if(WIN32) + # On Windows we need to statically link the libqsvg imageformat + # plugin (and the QtSvg component) for SVG graphics/icons to work. + add_definitions(-DQT_STATICPLUGIN) + link_directories("${QT_PLUGINS_DIR}/imageformats") + list(APPEND PULSEVIEW_LINK_LIBS ${QT_QTSVG_LIBRARY}) + list(APPEND PULSEVIEW_LINK_LIBS "-lqsvg") +endif() + add_executable(${PROJECT_NAME} ${pulseview_SOURCES} ${pulseview_HEADERS_MOC} @@ -280,13 +295,17 @@ add_executable(${PROJECT_NAME} ) target_link_libraries(${PROJECT_NAME} ${PULSEVIEW_LINK_LIBS}) -cotire(${PROJECT_NAME}) if(WIN32) # Pass -mwindows so that no "DOS box" will open when PulseView is started. set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-mwindows") endif() +if(ENABLE_COTIRE) + include(cotire) + cotire(${PROJECT_NAME}) +endif() + #=============================================================================== #= Installation #------------------------------------------------------------------------------- @@ -321,4 +340,4 @@ if(ENABLE_TESTS) add_subdirectory(test) enable_testing() add_test(test ${CMAKE_CURRENT_BINARY_DIR}/test/pulseview-test) -endif(ENABLE_TESTS) +endif()