Changeset - 8af772ace556
[Not reviewed]
default
0 1 0
Hasan Yavuz Ă–ZDERYA - 10 years ago 2015-05-04 18:14:28
hy@ozderya.net
add option for static linking of qwt
1 file changed with 14 insertions and 3 deletions:
0 comments (0 inline, 0 general)
CMakeLists.txt
Show inline comments
 
@@ -32,7 +32,18 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PAT
 

	
 
# Find the QtWidgets library
 
find_package(Qt5Widgets)
 
find_package(Qwt 6.1 REQUIRED)
 

	
 
# Find QWT or use static
 
set(QWT_USE_STATIC false CACHE BOOL "Use a static version of Qwt provided by user.")
 
set(QWT_STATIC_LIBRARY "" CACHE FILEPATH "Path to the static Qwt library, libqwt.a.")
 
set(QWT_STATIC_INCLUDE "" CACHE PATH "Path to the Qwt include directory when building Qwt static.")
 

	
 
if (QWT_USE_STATIC)
 
  set(QWT_LIBRARY ${QWT_STATIC_LIBRARY})
 
  set(QWT_INCLUDE_DIR ${QWT_STATIC_INCLUDE})
 
else (QWT_USE_STATIC)
 
  find_package(Qwt 6.1 REQUIRED)
 
endif (QWT_USE_STATIC)
 

	
 
# includes
 
include_directories(${QWT_INCLUDE_DIR})
 
@@ -44,8 +55,8 @@ qt5_wrap_ui(UI_FILES mainwindow.ui about
 
add_executable(serialplot main.cpp mainwindow.cpp customcheckablebutton.cpp ${UI_FILES})
 

	
 
# Use the Widgets module from Qt 5.
 
qt5_use_modules(serialplot Widgets SerialPort)
 
target_link_libraries(serialplot ${QWT_LIBRARY})
 
qt5_use_modules(serialplot Widgets SerialPort Svg)
 

	
 
# Enable C++11 support, fail if not supported
 
include(CheckCXXCompilerFlag)
 
@@ -64,4 +75,4 @@ add_custom_target(run
 
    COMMAND serialplot
 
    DEPENDS serialplot
 
    WORKING_DIRECTORY ${CMAKE_PROJECT_DIR}
 
)
 
\ No newline at end of file
 
)
0 comments (0 inline, 0 general)