-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
46 lines (38 loc) · 1.31 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
project(qwtbinding)
cmake_minimum_required(VERSION 2.6)
find_package(PythonLibs REQUIRED)
find_package(GeneratorRunner REQUIRED)
find_package(Shiboken REQUIRED)
find_package(PySide REQUIRED)
find_package(Qt4 4.6.2 REQUIRED)
# try to find qwt
if (NOT QWT_INCLUDE_DIR)
find_path(QWT_INCLUDE_DIR qwt.h /usr/include/qwt-qt4)
endif()
if (NOT QWT_LIBRARY)
find_library(QWT_LIBRARY qwt)
endif()
if (NOT QWT_INCLUDE_DIR OR NOT QWT_LIBRARY)
message(FATAL "Qwt not found! Set QWT_INCLUDE_DIR and QWT_LIBRARY to the correct location.")
endif()
if(CMAKE_HOST_UNIX)
option(ENABLE_GCC_OPTIMIZATION "Enable specific GCC flags to optimization library size and performance. Only available on Release Mode" 0)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fvisibility=hidden -Wno-strict-aliasing")
set(CMAKE_CXX_FLAGS_DEBUG "-g")
if(ENABLE_GCC_OPTIMIZATION)
set(CMAKE_BUILD_TYPE Release)
set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -Os -Wl,-O1")
if(NOT CMAKE_HOST_APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--hash-style=gnu")
endif()
endif()
if(CMAKE_HOST_APPLE)
if (NOT QT_INCLUDE_DIR)
set(QT_INCLUDE_DIR "/Library/Frameworks")
endif()
endif()
endif()
include(${QT_USE_FILE})
enable_testing()
add_subdirectory(qwt)
add_subdirectory(tests)