forked from EricAlex/structrock
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
executable file
·80 lines (59 loc) · 2.41 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
set(project_NAME structrock)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}")
#set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR)
file(COPY qcustomplot.h DESTINATION ${CMAKE_BINARY_DIR})
project(structrock)
find_package(Qt4 REQUIRED)
find_package(PCL 1.6.0 REQUIRED)
find_package(PostgreSQL REQUIRED)
include_directories (${PostgreSQL_INCLUDE_DIRS})
link_directories(${PostgreSQL_LIBRARY_DIRS})
if(${VTK_VERSION} VERSION_GREATER "6")
find_package(VTK COMPONENTS
vtkGUISupportQt
vtkRenderingQt
vtkViewsQt
)
else()
find_package(VTK REQUIRED)
set(VTK_LIBRARIES vtkRendering vtkGraphics vtkHybrid QVTK)
endif()
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
file(GLOB project_SOURCES . *.cpp)
file(GLOB project_HEADERS . *.h *.hpp)
file(GLOB project_FORMS . *.ui)
QT4_WRAP_CPP(project_HEADERS_MOC ${project_HEADERS})
QT4_WRAP_UI(project_FORMS_HEADERS ${project_FORMS})
INCLUDE(${QT_USE_FILE})
INCLUDE(${VTK_USE_FILE})
ADD_DEFINITIONS(${QT_DEFINITIONS})
if(WIN32)
set(GUI_TYPE WIN32)
endif(WIN32)
if(APPLE)
set(GUI_TYPE MACOSX_BUNDLE)
endif(APPLE)
if(APPLE)
set(MACOSX_BUNDLE_ICON_FILE icon.icns)
set(myApp_ICON ${CMAKE_CURRENT_SOURCE_DIR}/icon.icns)
SET_SOURCE_FILES_PROPERTIES(${myApp_ICON} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
else()
set(myApp_ICON ${CMAKE_CURRENT_SOURCE_DIR}/structrock.rc)
endif(APPLE)
if(UNIX)
file(COPY icon.ico DESTINATION ${CMAKE_BINARY_DIR})
file(WRITE structrock.desktop "[Desktop Entry]\nVersion=1.0\nName=Structrock\nGenericName=Structrock\nExec=${CMAKE_BINARY_DIR}/${project_NAME}\nIcon=${CMAKE_BINARY_DIR}/icon.ico\nTerminal=false\nType=Application\nCategories=Science;Math;\nKeywords=Science;3D Point Cloud;Rock;Processing;")
file(RENAME structrock.desktop ${CMAKE_BINARY_DIR}/structrock.desktop)
endif(UNIX)
ADD_EXECUTABLE(${project_NAME} ${GUI_TYPE} ${myApp_ICON} ${project_SOURCES} ${project_FORMS_HEADERS} ${project_HEADERS_MOC})
if(MSVC)
set_target_properties(${project_NAME} PROPERTIES LINK_FLAGS "/ENTRY:mainCRTStartup")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /openmp")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp -march=native")
endif(MSVC)
TARGET_LINK_LIBRARIES(structrock ${QT_LIBRARIES} ${PCL_LIBRARIES} ${VTK_LIBRARIES} ${PostgreSQL_LIBRARIES})
#INSTALL(SCRIPT bundle.cmake)