-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
122 lines (101 loc) · 3.71 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
SET(APP_NAME LocheGSplicer)
PROJECT(${APP_NAME})
SET(HEADER_PATH ${CMAKE_SOURCE_DIR}/inc)
SET(SOURCE_PATH ${CMAKE_SOURCE_DIR}/src)
SET(OUTPUT_BINDIR ${PROJECT_BINARY_DIR}/bin)
MAKE_DIRECTORY(${OUTPUT_BINDIR})
SET(OUTPUT_LIBDIR ${PROJECT_BINARY_DIR}/lib)
MAKE_DIRECTORY(${OUTPUT_LIBDIR})
SET (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_LIBDIR} CACHE PATH "build directory")
SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_BINDIR} CACHE PATH "build directory")
IF(WIN32)
SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_BINDIR} CACHE PATH "build directory")
ELSE(WIN32)
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_LIBDIR} CACHE PATH "build directory")
ENDIF(WIN32)
# For each configuration (Debug, Release, MinSizeRel... and/or anything the user chooses)
FOREACH(CONF ${CMAKE_CONFIGURATION_TYPES})
# Go uppercase (DEBUG, RELEASE...)
STRING(TOUPPER "${CONF}" CONF)
SET("CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CONF}" "${OUTPUT_LIBDIR}")
SET("CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CONF}" "${OUTPUT_BINDIR}")
IF(WIN32)
SET("CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CONF}" "${OUTPUT_BINDIR}")
ELSE()
SET("CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CONF}" "${OUTPUT_LIBDIR}")
ENDIF()
ENDFOREACH()
SET(CMAKE_DEBUG_POSTFIX "d")
IF(NOT APPLE)
#We only want X11 if we are not running on OSX, but still with a unix-like environment
IF(UNIX)
FIND_PACKAGE(X11)
FIND_LIBRARY(XXF86VM_LIBRARY Xxf86vm)
SET(X11_LIBRARIES
${X11_LIBRARIES}
${XXF86VM_LIBRARY})
ENDIF(UNIX)
ENDIF(NOT APPLE)
FIND_PACKAGE(OpenGL REQUIRED)
FIND_PACKAGE(Qt4 REQUIRED)
SET(QT_USE_QTOPENGL "true")
OPTION(BUILD_DEBUG_CONTROLS "Show debugging controls and functions." ON)
IF (BUILD_DEBUG_CONTROLS)
ADD_DEFINITIONS(-DBUILD_DEBUG_CONTROLS)
ENDIF (BUILD_DEBUG_CONTROLS)
# Project files
SET(HEADER_FILES
${HEADER_PATH}/Constants.h
${HEADER_PATH}/GCodeObject.h
${HEADER_PATH}/GCodeParser.h
${HEADER_PATH}/GCodeSplicer.h
${HEADER_PATH}/glext.h
${HEADER_PATH}/MainWindow.h
${HEADER_PATH}/PreferencesDialog.h
${HEADER_PATH}/VisualizerView.h
)
SET(SOURCE_FILES
${SOURCE_PATH}/GCodeObject.cpp
${SOURCE_PATH}/GCodeParser.cpp
${SOURCE_PATH}/GCodeSplicer.cpp
${SOURCE_PATH}/Main.cpp
${SOURCE_PATH}/MainWindow.cpp
${SOURCE_PATH}/PreferencesDialog.cpp
${SOURCE_PATH}/VisualizerView.cpp
)
QT4_WRAP_CPP(MOC_SOURCES ${HEADER_FILES})
SOURCE_GROUP("Auto-Generated" FILES ${MOC_SOURCES})
ADD_EXECUTABLE(${APP_NAME}
${HEADER_FILES}
${SOURCE_FILES}
${MOC_SOURCES}
)
SET_TARGET_PROPERTIES(${APP_NAME} PROPERTIES DEBUG_POSTFIX "${CMAKE_DEBUG_POSTFIX}")
# Make the required external dependency headers visible to everything
INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/inc
${OPENGL_INCLUDE_DIR}
${QT_INCLUDE_DIR}
${QT_QTCORE_INCLUDE_DIR}
${QT_QTGUI_INCLUDE_DIR}
${QT_QTOPENGL_INCLUDE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
)
TARGET_LINK_LIBRARIES( ${APP_NAME}
${OPENGL_LIBRARY}
${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY}
${QT_QTOPENGL_LIBRARY}
)
set(CPACK_GENERATOR "Bundle")
set(CPACK_PACKAGE_VERSION "005")
set(CPACK_PACKAGE_FILE_NAME "Lochegsplicer")
#set(CPACK_PACKAGE_ICON "")
set(CPACK_BUNDLE_NAME "Lochegsplicer")
#set(CPACK_BUNDLE_ICON ${CMAKE_SOURCE_DIR}/cmake/macosx/Icons.icns)
set(CPACK_BUNDLE_ICON ${CMAKE_SOURCE_DIR}/installer/macosx/Icons.icns)
set(CPACK_BUNDLE_PLIST ${CMAKE_SOURCE_DIR}/installer/macosx/Info.plist)
set(CPACK_BUNDLE_STARTUP_COMMAND "bin/lochegsplicer")
set(CPACK_PACKAGE_EXECUTABLES "lochegsplicer" "Lochegsplicer - Dual Extrusion Gcode Generator")
INCLUDE(CPack)