CMakeLists.txt

Tue, 03 Mar 2015 22:07:36 +0200

author
Teemu Piippo <crimsondusk64@gmail.com>
date
Tue, 03 Mar 2015 22:07:36 +0200
changeset 934
be8128aff739
parent 933
f4c80d92e71e
child 935
8d98ee0dc917
child 940
edc716c1d8e1
permissions
-rw-r--r--

- fixed: actions did not fire anymore

632
63e6243b880c - migrated to CMake again
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
1 ######################################################################
845
fec7023e91a7 - added a code generator to produce a configuration.inc which replaces the old, DIABOLIC configuration indexing mechanism
Teemu Piippo <crimsondusk64@gmail.com>
parents: 842
diff changeset
2 #
fec7023e91a7 - added a code generator to produce a configuration.inc which replaces the old, DIABOLIC configuration indexing mechanism
Teemu Piippo <crimsondusk64@gmail.com>
parents: 842
diff changeset
3 # CMake file for LDForge.
fec7023e91a7 - added a code generator to produce a configuration.inc which replaces the old, DIABOLIC configuration indexing mechanism
Teemu Piippo <crimsondusk64@gmail.com>
parents: 842
diff changeset
4 # The original QMake file was created on Sat Sep 22 17:29:49 2012
fec7023e91a7 - added a code generator to produce a configuration.inc which replaces the old, DIABOLIC configuration indexing mechanism
Teemu Piippo <crimsondusk64@gmail.com>
parents: 842
diff changeset
5 #
632
63e6243b880c - migrated to CMake again
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
6 ######################################################################
63e6243b880c - migrated to CMake again
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
7
63e6243b880c - migrated to CMake again
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
8 project (ldforge)
63e6243b880c - migrated to CMake again
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
9 cmake_minimum_required (VERSION 2.6)
933
f4c80d92e71e - rewrote codegen in python and merged updaterevision into it
Teemu Piippo <crimsondusk64@gmail.com>
parents: 932
diff changeset
10 cmake_policy (SET CMP0020 OLD)
632
63e6243b880c - migrated to CMake again
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
11
801
f6abc9eb4217 - made transparent direct colors a compile-time opt-in since it appears to be non-standard
Santeri Piippo <crimsondusk64@gmail.com>
parents: 785
diff changeset
12 option (TRANSPARENT_DIRECT_COLORS "Enables non-standard transparent direct colors" OFF)
855
e16f1587ef44 - fixed compilation on windows systems
Santeri Piippo <crimsondusk64@gmail.com>
parents: 845
diff changeset
13 option (USE_QT5 "Use Qt5 instead of Qt4" OFF)
e16f1587ef44 - fixed compilation on windows systems
Santeri Piippo <crimsondusk64@gmail.com>
parents: 845
diff changeset
14
e16f1587ef44 - fixed compilation on windows systems
Santeri Piippo <crimsondusk64@gmail.com>
parents: 845
diff changeset
15 if (USE_QT5)
e16f1587ef44 - fixed compilation on windows systems
Santeri Piippo <crimsondusk64@gmail.com>
parents: 845
diff changeset
16 find_package (Qt5Widgets REQUIRED)
e16f1587ef44 - fixed compilation on windows systems
Santeri Piippo <crimsondusk64@gmail.com>
parents: 845
diff changeset
17 find_package (Qt5Core REQUIRED)
e16f1587ef44 - fixed compilation on windows systems
Santeri Piippo <crimsondusk64@gmail.com>
parents: 845
diff changeset
18 find_package (Qt5OpenGL REQUIRED)
e16f1587ef44 - fixed compilation on windows systems
Santeri Piippo <crimsondusk64@gmail.com>
parents: 845
diff changeset
19 find_package (Qt5Network REQUIRED)
e16f1587ef44 - fixed compilation on windows systems
Santeri Piippo <crimsondusk64@gmail.com>
parents: 845
diff changeset
20 set (CMAKE_AUTOMOC ON)
e16f1587ef44 - fixed compilation on windows systems
Santeri Piippo <crimsondusk64@gmail.com>
parents: 845
diff changeset
21 else()
e16f1587ef44 - fixed compilation on windows systems
Santeri Piippo <crimsondusk64@gmail.com>
parents: 845
diff changeset
22 find_package (Qt4 REQUIRED)
e16f1587ef44 - fixed compilation on windows systems
Santeri Piippo <crimsondusk64@gmail.com>
parents: 845
diff changeset
23 endif()
e16f1587ef44 - fixed compilation on windows systems
Santeri Piippo <crimsondusk64@gmail.com>
parents: 845
diff changeset
24
e16f1587ef44 - fixed compilation on windows systems
Santeri Piippo <crimsondusk64@gmail.com>
parents: 845
diff changeset
25 find_package (OpenGL REQUIRED)
632
63e6243b880c - migrated to CMake again
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
26 include_directories (${QT_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR})
63e6243b880c - migrated to CMake again
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
27
661
577bc177a06f - renamed some cmake identifiers
Santeri Piippo <crimsondusk64@gmail.com>
parents: 660
diff changeset
28 set (LDFORGE_SOURCES
931
85080f7a1c20 - renamed .cc files to .cpp
Teemu Piippo <crimsondusk64@gmail.com>
parents: 926
diff changeset
29 src/actions.cpp
85080f7a1c20 - renamed .cc files to .cpp
Teemu Piippo <crimsondusk64@gmail.com>
parents: 926
diff changeset
30 src/actionsEdit.cpp
85080f7a1c20 - renamed .cc files to .cpp
Teemu Piippo <crimsondusk64@gmail.com>
parents: 926
diff changeset
31 src/addObjectDialog.cpp
85080f7a1c20 - renamed .cc files to .cpp
Teemu Piippo <crimsondusk64@gmail.com>
parents: 926
diff changeset
32 src/basics.cpp
85080f7a1c20 - renamed .cc files to .cpp
Teemu Piippo <crimsondusk64@gmail.com>
parents: 926
diff changeset
33 src/colors.cpp
85080f7a1c20 - renamed .cc files to .cpp
Teemu Piippo <crimsondusk64@gmail.com>
parents: 926
diff changeset
34 src/colorSelector.cpp
85080f7a1c20 - renamed .cc files to .cpp
Teemu Piippo <crimsondusk64@gmail.com>
parents: 926
diff changeset
35 src/configuration.cpp
85080f7a1c20 - renamed .cc files to .cpp
Teemu Piippo <crimsondusk64@gmail.com>
parents: 926
diff changeset
36 src/configDialog.cpp
85080f7a1c20 - renamed .cc files to .cpp
Teemu Piippo <crimsondusk64@gmail.com>
parents: 926
diff changeset
37 src/crashCatcher.cpp
85080f7a1c20 - renamed .cc files to .cpp
Teemu Piippo <crimsondusk64@gmail.com>
parents: 926
diff changeset
38 src/dialogs.cpp
85080f7a1c20 - renamed .cc files to .cpp
Teemu Piippo <crimsondusk64@gmail.com>
parents: 926
diff changeset
39 src/documentation.cpp
85080f7a1c20 - renamed .cc files to .cpp
Teemu Piippo <crimsondusk64@gmail.com>
parents: 926
diff changeset
40 src/editHistory.cpp
85080f7a1c20 - renamed .cc files to .cpp
Teemu Piippo <crimsondusk64@gmail.com>
parents: 926
diff changeset
41 src/extPrograms.cpp
85080f7a1c20 - renamed .cc files to .cpp
Teemu Piippo <crimsondusk64@gmail.com>
parents: 926
diff changeset
42 src/glRenderer.cpp
85080f7a1c20 - renamed .cc files to .cpp
Teemu Piippo <crimsondusk64@gmail.com>
parents: 926
diff changeset
43 src/glCompiler.cpp
85080f7a1c20 - renamed .cc files to .cpp
Teemu Piippo <crimsondusk64@gmail.com>
parents: 926
diff changeset
44 src/ldConfig.cpp
85080f7a1c20 - renamed .cc files to .cpp
Teemu Piippo <crimsondusk64@gmail.com>
parents: 926
diff changeset
45 src/ldDocument.cpp
85080f7a1c20 - renamed .cc files to .cpp
Teemu Piippo <crimsondusk64@gmail.com>
parents: 926
diff changeset
46 src/ldObject.cpp
85080f7a1c20 - renamed .cc files to .cpp
Teemu Piippo <crimsondusk64@gmail.com>
parents: 926
diff changeset
47 src/ldObjectMath.cpp
85080f7a1c20 - renamed .cc files to .cpp
Teemu Piippo <crimsondusk64@gmail.com>
parents: 926
diff changeset
48 src/main.cpp
85080f7a1c20 - renamed .cc files to .cpp
Teemu Piippo <crimsondusk64@gmail.com>
parents: 926
diff changeset
49 src/mainWindow.cpp
85080f7a1c20 - renamed .cc files to .cpp
Teemu Piippo <crimsondusk64@gmail.com>
parents: 926
diff changeset
50 src/messageLog.cpp
85080f7a1c20 - renamed .cc files to .cpp
Teemu Piippo <crimsondusk64@gmail.com>
parents: 926
diff changeset
51 src/miscallenous.cpp
85080f7a1c20 - renamed .cc files to .cpp
Teemu Piippo <crimsondusk64@gmail.com>
parents: 926
diff changeset
52 src/partDownloader.cpp
85080f7a1c20 - renamed .cc files to .cpp
Teemu Piippo <crimsondusk64@gmail.com>
parents: 926
diff changeset
53 src/primitives.cpp
85080f7a1c20 - renamed .cc files to .cpp
Teemu Piippo <crimsondusk64@gmail.com>
parents: 926
diff changeset
54 src/radioGroup.cpp
85080f7a1c20 - renamed .cc files to .cpp
Teemu Piippo <crimsondusk64@gmail.com>
parents: 926
diff changeset
55 src/ringFinder.cpp
85080f7a1c20 - renamed .cc files to .cpp
Teemu Piippo <crimsondusk64@gmail.com>
parents: 926
diff changeset
56 src/version.cpp
85080f7a1c20 - renamed .cc files to .cpp
Teemu Piippo <crimsondusk64@gmail.com>
parents: 926
diff changeset
57 src/editmodes/abstractEditMode.cpp
85080f7a1c20 - renamed .cc files to .cpp
Teemu Piippo <crimsondusk64@gmail.com>
parents: 926
diff changeset
58 src/editmodes/circleMode.cpp
85080f7a1c20 - renamed .cc files to .cpp
Teemu Piippo <crimsondusk64@gmail.com>
parents: 926
diff changeset
59 src/editmodes/drawMode.cpp
85080f7a1c20 - renamed .cc files to .cpp
Teemu Piippo <crimsondusk64@gmail.com>
parents: 926
diff changeset
60 src/editmodes/linePathMode.cpp
85080f7a1c20 - renamed .cc files to .cpp
Teemu Piippo <crimsondusk64@gmail.com>
parents: 926
diff changeset
61 src/editmodes/magicWandMode.cpp
85080f7a1c20 - renamed .cc files to .cpp
Teemu Piippo <crimsondusk64@gmail.com>
parents: 926
diff changeset
62 src/editmodes/rectangleMode.cpp
85080f7a1c20 - renamed .cc files to .cpp
Teemu Piippo <crimsondusk64@gmail.com>
parents: 926
diff changeset
63 src/editmodes/selectMode.cpp
632
63e6243b880c - migrated to CMake again
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
64 )
63e6243b880c - migrated to CMake again
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
65
661
577bc177a06f - renamed some cmake identifiers
Santeri Piippo <crimsondusk64@gmail.com>
parents: 660
diff changeset
66 set (LDFORGE_HEADERS
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents: 644
diff changeset
67 src/macros.h
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents: 644
diff changeset
68 src/crashCatcher.h
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents: 644
diff changeset
69 src/colors.h
842
e1c9010eb9e8 - moved ringFinder into root source directory, clearing the src/misc/ directory
Teemu Piippo <crimsondusk64@gmail.com>
parents: 841
diff changeset
70 src/ringFinder.h
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents: 644
diff changeset
71 src/ldDocument.h
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents: 644
diff changeset
72 src/addObjectDialog.h
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents: 644
diff changeset
73 src/ldConfig.h
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents: 644
diff changeset
74 src/partDownloader.h
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents: 644
diff changeset
75 src/ldObject.h
869
7184f3bae695 - circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents: 855
diff changeset
76 src/ldObjectMath.h
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents: 644
diff changeset
77 src/primitives.h
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents: 644
diff changeset
78 src/miscallenous.h
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents: 644
diff changeset
79 src/messageLog.h
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents: 644
diff changeset
80 src/dialogs.h
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents: 644
diff changeset
81 src/radioGroup.h
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents: 644
diff changeset
82 src/documentation.h
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents: 644
diff changeset
83 src/main.h
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents: 644
diff changeset
84 src/basics.h
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents: 644
diff changeset
85 src/colorSelector.h
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents: 644
diff changeset
86 src/configDialog.h
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents: 644
diff changeset
87 src/glRenderer.h
706
d79083b9f74d Merge ../ldforge into gl
Santeri Piippo <crimsondusk64@gmail.com>
parents: 690 655
diff changeset
88 src/glCompiler.h
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents: 644
diff changeset
89 src/configuration.h
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents: 644
diff changeset
90 src/mainWindow.h
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents: 644
diff changeset
91 src/editHistory.h
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents: 644
diff changeset
92 src/format.h
830
a741a0b9df49 - updated filenames
Santeri Piippo <crimsondusk64@gmail.com>
parents: 825
diff changeset
93 src/editmodes/abstractEditMode.h
a741a0b9df49 - updated filenames
Santeri Piippo <crimsondusk64@gmail.com>
parents: 825
diff changeset
94 src/editmodes/circleMode.h
a741a0b9df49 - updated filenames
Santeri Piippo <crimsondusk64@gmail.com>
parents: 825
diff changeset
95 src/editmodes/drawMode.h
876
f040f0fb3795 - renamed line loop to line path, updated changelog
Teemu Piippo <crimsondusk64@gmail.com>
parents: 874
diff changeset
96 src/editmodes/linePathMode.h
830
a741a0b9df49 - updated filenames
Santeri Piippo <crimsondusk64@gmail.com>
parents: 825
diff changeset
97 src/editmodes/magicWandMode.h
841
1243abd47381 - split the rectangle ability out of the draw mode into its own edit mode
Teemu Piippo <crimsondusk64@gmail.com>
parents: 830
diff changeset
98 src/editmodes/rectangleMode.h
830
a741a0b9df49 - updated filenames
Santeri Piippo <crimsondusk64@gmail.com>
parents: 825
diff changeset
99 src/editmodes/selectMode.h
632
63e6243b880c - migrated to CMake again
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
100 )
63e6243b880c - migrated to CMake again
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
101
661
577bc177a06f - renamed some cmake identifiers
Santeri Piippo <crimsondusk64@gmail.com>
parents: 660
diff changeset
102 set (LDFORGE_FORMS
932
738673e8a6b4 - moved ui files to src/
Teemu Piippo <crimsondusk64@gmail.com>
parents: 931
diff changeset
103 src/about.ui
738673e8a6b4 - moved ui files to src/
Teemu Piippo <crimsondusk64@gmail.com>
parents: 931
diff changeset
104 src/addhistoryline.ui
738673e8a6b4 - moved ui files to src/
Teemu Piippo <crimsondusk64@gmail.com>
parents: 931
diff changeset
105 src/bombbox.ui
738673e8a6b4 - moved ui files to src/
Teemu Piippo <crimsondusk64@gmail.com>
parents: 931
diff changeset
106 src/colorsel.ui
738673e8a6b4 - moved ui files to src/
Teemu Piippo <crimsondusk64@gmail.com>
parents: 931
diff changeset
107 src/config.ui
738673e8a6b4 - moved ui files to src/
Teemu Piippo <crimsondusk64@gmail.com>
parents: 931
diff changeset
108 src/coverer.ui
738673e8a6b4 - moved ui files to src/
Teemu Piippo <crimsondusk64@gmail.com>
parents: 931
diff changeset
109 src/downloadfrom.ui
738673e8a6b4 - moved ui files to src/
Teemu Piippo <crimsondusk64@gmail.com>
parents: 931
diff changeset
110 src/edger2.ui
738673e8a6b4 - moved ui files to src/
Teemu Piippo <crimsondusk64@gmail.com>
parents: 931
diff changeset
111 src/editraw.ui
738673e8a6b4 - moved ui files to src/
Teemu Piippo <crimsondusk64@gmail.com>
parents: 931
diff changeset
112 src/extprogpath.ui
738673e8a6b4 - moved ui files to src/
Teemu Piippo <crimsondusk64@gmail.com>
parents: 931
diff changeset
113 src/flip.ui
738673e8a6b4 - moved ui files to src/
Teemu Piippo <crimsondusk64@gmail.com>
parents: 931
diff changeset
114 src/intersector.ui
738673e8a6b4 - moved ui files to src/
Teemu Piippo <crimsondusk64@gmail.com>
parents: 931
diff changeset
115 src/isecalc.ui
738673e8a6b4 - moved ui files to src/
Teemu Piippo <crimsondusk64@gmail.com>
parents: 931
diff changeset
116 src/ldforge.ui
738673e8a6b4 - moved ui files to src/
Teemu Piippo <crimsondusk64@gmail.com>
parents: 931
diff changeset
117 src/ldrawpath.ui
738673e8a6b4 - moved ui files to src/
Teemu Piippo <crimsondusk64@gmail.com>
parents: 931
diff changeset
118 src/makeprim.ui
738673e8a6b4 - moved ui files to src/
Teemu Piippo <crimsondusk64@gmail.com>
parents: 931
diff changeset
119 src/newpart.ui
738673e8a6b4 - moved ui files to src/
Teemu Piippo <crimsondusk64@gmail.com>
parents: 931
diff changeset
120 src/openprogress.ui
738673e8a6b4 - moved ui files to src/
Teemu Piippo <crimsondusk64@gmail.com>
parents: 931
diff changeset
121 src/overlay.ui
738673e8a6b4 - moved ui files to src/
Teemu Piippo <crimsondusk64@gmail.com>
parents: 931
diff changeset
122 src/rectifier.ui
738673e8a6b4 - moved ui files to src/
Teemu Piippo <crimsondusk64@gmail.com>
parents: 931
diff changeset
123 src/replcoords.ui
738673e8a6b4 - moved ui files to src/
Teemu Piippo <crimsondusk64@gmail.com>
parents: 931
diff changeset
124 src/rotpoint.ui
738673e8a6b4 - moved ui files to src/
Teemu Piippo <crimsondusk64@gmail.com>
parents: 931
diff changeset
125 src/ytruder.ui
632
63e6243b880c - migrated to CMake again
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
126 )
63e6243b880c - migrated to CMake again
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
127
661
577bc177a06f - renamed some cmake identifiers
Santeri Piippo <crimsondusk64@gmail.com>
parents: 660
diff changeset
128 set (LDFORGE_RESOURCES ldforge.qrc)
855
e16f1587ef44 - fixed compilation on windows systems
Santeri Piippo <crimsondusk64@gmail.com>
parents: 845
diff changeset
129 # set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lGLU")
e16f1587ef44 - fixed compilation on windows systems
Santeri Piippo <crimsondusk64@gmail.com>
parents: 845
diff changeset
130
e16f1587ef44 - fixed compilation on windows systems
Santeri Piippo <crimsondusk64@gmail.com>
parents: 845
diff changeset
131 if (NOT MSVC)
e16f1587ef44 - fixed compilation on windows systems
Santeri Piippo <crimsondusk64@gmail.com>
parents: 845
diff changeset
132 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -W -Wall")
e16f1587ef44 - fixed compilation on windows systems
Santeri Piippo <crimsondusk64@gmail.com>
parents: 845
diff changeset
133 endif()
660
bc589e352f5b - now compiles with clang
Santeri Piippo <crimsondusk64@gmail.com>
parents: 657
diff changeset
134
801
f6abc9eb4217 - made transparent direct colors a compile-time opt-in since it appears to be non-standard
Santeri Piippo <crimsondusk64@gmail.com>
parents: 785
diff changeset
135 if (TRANSPARENT_DIRECT_COLORS)
f6abc9eb4217 - made transparent direct colors a compile-time opt-in since it appears to be non-standard
Santeri Piippo <crimsondusk64@gmail.com>
parents: 785
diff changeset
136 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTRANSPARENT_DIRECT_COLORS")
f6abc9eb4217 - made transparent direct colors a compile-time opt-in since it appears to be non-standard
Santeri Piippo <crimsondusk64@gmail.com>
parents: 785
diff changeset
137 endif()
f6abc9eb4217 - made transparent direct colors a compile-time opt-in since it appears to be non-standard
Santeri Piippo <crimsondusk64@gmail.com>
parents: 785
diff changeset
138
660
bc589e352f5b - now compiles with clang
Santeri Piippo <crimsondusk64@gmail.com>
parents: 657
diff changeset
139 # With clang, we need to set -Wno-deprecated since Qt headers seem to use the
bc589e352f5b - now compiles with clang
Santeri Piippo <crimsondusk64@gmail.com>
parents: 657
diff changeset
140 # register keyword which clang doesn't seem to like. It also appears that Qt
bc589e352f5b - now compiles with clang
Santeri Piippo <crimsondusk64@gmail.com>
parents: 657
diff changeset
141 # doesn't set Q_COMPILER_INITIALIZER_LISTS when compiling with clang? What's
bc589e352f5b - now compiles with clang
Santeri Piippo <crimsondusk64@gmail.com>
parents: 657
diff changeset
142 # up with that?
bc589e352f5b - now compiles with clang
Santeri Piippo <crimsondusk64@gmail.com>
parents: 657
diff changeset
143 if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
bc589e352f5b - now compiles with clang
Santeri Piippo <crimsondusk64@gmail.com>
parents: 657
diff changeset
144 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated -DQ_COMPILER_INITIALIZER_LISTS")
bc589e352f5b - now compiles with clang
Santeri Piippo <crimsondusk64@gmail.com>
parents: 657
diff changeset
145 endif()
bc589e352f5b - now compiles with clang
Santeri Piippo <crimsondusk64@gmail.com>
parents: 657
diff changeset
146
633
34d18b9c2cab - fixed compilation
Santeri Piippo <crimsondusk64@gmail.com>
parents: 632
diff changeset
147 include_directories ("${PROJECT_BINARY_DIR}")
632
63e6243b880c - migrated to CMake again
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
148 include_directories ("${PROJECT_BINARY_DIR}/src")
63e6243b880c - migrated to CMake again
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
149 include_directories ("${PROJECT_BINARY_DIR}/src/misc")
63e6243b880c - migrated to CMake again
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
150
855
e16f1587ef44 - fixed compilation on windows systems
Santeri Piippo <crimsondusk64@gmail.com>
parents: 845
diff changeset
151 if (NOT MSVC)
e16f1587ef44 - fixed compilation on windows systems
Santeri Piippo <crimsondusk64@gmail.com>
parents: 845
diff changeset
152 if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug" OR "${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
e16f1587ef44 - fixed compilation on windows systems
Santeri Piippo <crimsondusk64@gmail.com>
parents: 845
diff changeset
153 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDEBUG")
e16f1587ef44 - fixed compilation on windows systems
Santeri Piippo <crimsondusk64@gmail.com>
parents: 845
diff changeset
154 endif()
632
63e6243b880c - migrated to CMake again
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
155 endif()
63e6243b880c - migrated to CMake again
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
156
855
e16f1587ef44 - fixed compilation on windows systems
Santeri Piippo <crimsondusk64@gmail.com>
parents: 845
diff changeset
157 if (USE_QT5)
e16f1587ef44 - fixed compilation on windows systems
Santeri Piippo <crimsondusk64@gmail.com>
parents: 845
diff changeset
158 qt5_generate_moc (LDFORGE_MOC ${LDFORGE_HEADERS})
e16f1587ef44 - fixed compilation on windows systems
Santeri Piippo <crimsondusk64@gmail.com>
parents: 845
diff changeset
159 qt5_add_resources (LDFORGE_QRC ${LDFORGE_RESOURCES})
e16f1587ef44 - fixed compilation on windows systems
Santeri Piippo <crimsondusk64@gmail.com>
parents: 845
diff changeset
160 qt5_wrap_ui (LDFORGE_FORMS_HEADERS ${LDFORGE_FORMS})
926
e1ae2dbcae8e - relaced updaterevision.c with a python script
Teemu Piippo <crimsondusk64@gmail.com>
parents: 884
diff changeset
161 add_executable (${PROJECT_NAME} WIN32 ${LDFORGE_SOURCES} ${LDFORGE_MOC}
884
d820588bf4f1 - fixed: missing WIN32 keyword in cmakelists caused the command prompt to show up when ldforge was executed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 876
diff changeset
162 ${LDFORGE_QRC} ${LDFORGE_FORMS_HEADERS})
855
e16f1587ef44 - fixed compilation on windows systems
Santeri Piippo <crimsondusk64@gmail.com>
parents: 845
diff changeset
163 else()
e16f1587ef44 - fixed compilation on windows systems
Santeri Piippo <crimsondusk64@gmail.com>
parents: 845
diff changeset
164 qt4_wrap_cpp (LDFORGE_MOC ${LDFORGE_HEADERS})
e16f1587ef44 - fixed compilation on windows systems
Santeri Piippo <crimsondusk64@gmail.com>
parents: 845
diff changeset
165 qt4_wrap_ui (LDFORGE_FORMS_HEADERS ${LDFORGE_FORMS})
e16f1587ef44 - fixed compilation on windows systems
Santeri Piippo <crimsondusk64@gmail.com>
parents: 845
diff changeset
166 qt4_add_resources (LDFORGE_RCC ${LDFORGE_RESOURCES})
926
e1ae2dbcae8e - relaced updaterevision.c with a python script
Teemu Piippo <crimsondusk64@gmail.com>
parents: 884
diff changeset
167 add_executable (${PROJECT_NAME} WIN32 ${LDFORGE_SOURCES} ${LDFORGE_RCC}
884
d820588bf4f1 - fixed: missing WIN32 keyword in cmakelists caused the command prompt to show up when ldforge was executed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 876
diff changeset
168 ${LDFORGE_FORMS_HEADERS} ${LDFORGE_MOC})
855
e16f1587ef44 - fixed compilation on windows systems
Santeri Piippo <crimsondusk64@gmail.com>
parents: 845
diff changeset
169 endif()
632
63e6243b880c - migrated to CMake again
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
170
855
e16f1587ef44 - fixed compilation on windows systems
Santeri Piippo <crimsondusk64@gmail.com>
parents: 845
diff changeset
171 if (USE_QT5)
926
e1ae2dbcae8e - relaced updaterevision.c with a python script
Teemu Piippo <crimsondusk64@gmail.com>
parents: 884
diff changeset
172 target_link_libraries (${PROJECT_NAME} Qt5::Widgets Qt5::Network Qt5::OpenGL ${OPENGL_LIBRARIES})
855
e16f1587ef44 - fixed compilation on windows systems
Santeri Piippo <crimsondusk64@gmail.com>
parents: 845
diff changeset
173 else()
926
e1ae2dbcae8e - relaced updaterevision.c with a python script
Teemu Piippo <crimsondusk64@gmail.com>
parents: 884
diff changeset
174 target_link_libraries (${PROJECT_NAME}
855
e16f1587ef44 - fixed compilation on windows systems
Santeri Piippo <crimsondusk64@gmail.com>
parents: 845
diff changeset
175 ${QT_QTCORE_LIBRARY}
e16f1587ef44 - fixed compilation on windows systems
Santeri Piippo <crimsondusk64@gmail.com>
parents: 845
diff changeset
176 ${QT_QTGUI_LIBRARY}
e16f1587ef44 - fixed compilation on windows systems
Santeri Piippo <crimsondusk64@gmail.com>
parents: 845
diff changeset
177 ${QT_QTNETWORK_LIBRARY}
e16f1587ef44 - fixed compilation on windows systems
Santeri Piippo <crimsondusk64@gmail.com>
parents: 845
diff changeset
178 ${QT_QTOPENGL_LIBRARY}
e16f1587ef44 - fixed compilation on windows systems
Santeri Piippo <crimsondusk64@gmail.com>
parents: 845
diff changeset
179 ${OPENGL_LIBRARIES}
e16f1587ef44 - fixed compilation on windows systems
Santeri Piippo <crimsondusk64@gmail.com>
parents: 845
diff changeset
180 )
e16f1587ef44 - fixed compilation on windows systems
Santeri Piippo <crimsondusk64@gmail.com>
parents: 845
diff changeset
181 endif()
632
63e6243b880c - migrated to CMake again
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
182
926
e1ae2dbcae8e - relaced updaterevision.c with a python script
Teemu Piippo <crimsondusk64@gmail.com>
parents: 884
diff changeset
183 install (TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin)
e1ae2dbcae8e - relaced updaterevision.c with a python script
Teemu Piippo <crimsondusk64@gmail.com>
parents: 884
diff changeset
184
933
f4c80d92e71e - rewrote codegen in python and merged updaterevision into it
Teemu Piippo <crimsondusk64@gmail.com>
parents: 932
diff changeset
185 #
f4c80d92e71e - rewrote codegen in python and merged updaterevision into it
Teemu Piippo <crimsondusk64@gmail.com>
parents: 932
diff changeset
186 # Code generators
f4c80d92e71e - rewrote codegen in python and merged updaterevision into it
Teemu Piippo <crimsondusk64@gmail.com>
parents: 932
diff changeset
187 #
f4c80d92e71e - rewrote codegen in python and merged updaterevision into it
Teemu Piippo <crimsondusk64@gmail.com>
parents: 932
diff changeset
188
926
e1ae2dbcae8e - relaced updaterevision.c with a python script
Teemu Piippo <crimsondusk64@gmail.com>
parents: 884
diff changeset
189 add_custom_target (make_hginfo_h
e1ae2dbcae8e - relaced updaterevision.c with a python script
Teemu Piippo <crimsondusk64@gmail.com>
parents: 884
diff changeset
190 COMMAND python
933
f4c80d92e71e - rewrote codegen in python and merged updaterevision into it
Teemu Piippo <crimsondusk64@gmail.com>
parents: 932
diff changeset
191 "${CMAKE_SOURCE_DIR}/codegen.py" "hginfo"
f4c80d92e71e - rewrote codegen in python and merged updaterevision into it
Teemu Piippo <crimsondusk64@gmail.com>
parents: 932
diff changeset
192 "${CMAKE_CURRENT_BINARY_DIR}/hginfo.h"
f4c80d92e71e - rewrote codegen in python and merged updaterevision into it
Teemu Piippo <crimsondusk64@gmail.com>
parents: 932
diff changeset
193 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
f4c80d92e71e - rewrote codegen in python and merged updaterevision into it
Teemu Piippo <crimsondusk64@gmail.com>
parents: 932
diff changeset
194
f4c80d92e71e - rewrote codegen in python and merged updaterevision into it
Teemu Piippo <crimsondusk64@gmail.com>
parents: 932
diff changeset
195 add_custom_target (make_config_aux
f4c80d92e71e - rewrote codegen in python and merged updaterevision into it
Teemu Piippo <crimsondusk64@gmail.com>
parents: 932
diff changeset
196 COMMAND python
f4c80d92e71e - rewrote codegen in python and merged updaterevision into it
Teemu Piippo <crimsondusk64@gmail.com>
parents: 932
diff changeset
197 "${CMAKE_SOURCE_DIR}/codegen.py" "configaux"
f4c80d92e71e - rewrote codegen in python and merged updaterevision into it
Teemu Piippo <crimsondusk64@gmail.com>
parents: 932
diff changeset
198 "${CMAKE_CURRENT_BINARY_DIR}/config.aux"
f4c80d92e71e - rewrote codegen in python and merged updaterevision into it
Teemu Piippo <crimsondusk64@gmail.com>
parents: 932
diff changeset
199 ${LDFORGE_SOURCES}
f4c80d92e71e - rewrote codegen in python and merged updaterevision into it
Teemu Piippo <crimsondusk64@gmail.com>
parents: 932
diff changeset
200 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
f4c80d92e71e - rewrote codegen in python and merged updaterevision into it
Teemu Piippo <crimsondusk64@gmail.com>
parents: 932
diff changeset
201
f4c80d92e71e - rewrote codegen in python and merged updaterevision into it
Teemu Piippo <crimsondusk64@gmail.com>
parents: 932
diff changeset
202 add_dependencies (${PROJECT_NAME} make_hginfo_h make_config_aux)

mercurial