CMakeLists.txt

changeset 972
a34b73114823
parent 971
c00f9665a9f8
child 974
b2fa5f89798a
equal deleted inserted replaced
971:c00f9665a9f8 972:a34b73114823
26 add_custom_target (revision_check ALL 26 add_custom_target (revision_check ALL
27 COMMAND python "${CMAKE_SOURCE_DIR}/tools/updaterevision.py" hginfo.h 27 COMMAND python "${CMAKE_SOURCE_DIR}/tools/updaterevision.py" hginfo.h
28 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) 28 WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
29 29
30 include_directories (${QT_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR}) 30 include_directories (${QT_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR})
31
32 set_source_files_properties (${CMAKE_BINARY_DIR}/configurationvaluebag.cpp PROPERTIES GENERATED TRUE)
31 33
32 set (LDFORGE_SOURCES 34 set (LDFORGE_SOURCES
33 src/addObjectDialog.cpp 35 src/addObjectDialog.cpp
34 src/basics.cpp 36 src/basics.cpp
35 src/colors.cpp 37 src/colors.cpp
70 src/toolsets/extprogramtoolset.cpp 72 src/toolsets/extprogramtoolset.cpp
71 src/toolsets/filetoolset.cpp 73 src/toolsets/filetoolset.cpp
72 src/toolsets/movetoolset.cpp 74 src/toolsets/movetoolset.cpp
73 src/toolsets/toolset.cpp 75 src/toolsets/toolset.cpp
74 src/toolsets/viewtoolset.cpp 76 src/toolsets/viewtoolset.cpp
75 ${CMAKE_BINARY_DIR}/configurationvaluebag.cpp
76 ) 77 )
77 78
78 set (LDFORGE_HEADERS 79 set (LDFORGE_HEADERS
79 src/macros.h 80 src/macros.h
80 src/crashCatcher.h 81 src/crashCatcher.h
148 149
149 set (LDFORGE_RESOURCES ldforge.qrc) 150 set (LDFORGE_RESOURCES ldforge.qrc)
150 # set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lGLU") 151 # set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lGLU")
151 152
152 if (NOT MSVC) 153 if (NOT MSVC)
153 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -W -Wall -Wno-maybe-uninitialized") 154 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -W -Wall")
154 endif() 155 endif()
155 156
156 if (TRANSPARENT_DIRECT_COLORS) 157 if (TRANSPARENT_DIRECT_COLORS)
157 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTRANSPARENT_DIRECT_COLORS") 158 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTRANSPARENT_DIRECT_COLORS")
158 endif() 159 endif()
160 # With clang, we need to set -Wno-deprecated since Qt headers seem to use the 161 # With clang, we need to set -Wno-deprecated since Qt headers seem to use the
161 # register keyword which clang doesn't seem to like. It also appears that Qt 162 # register keyword which clang doesn't seem to like. It also appears that Qt
162 # doesn't set Q_COMPILER_INITIALIZER_LISTS when compiling with clang? What's 163 # doesn't set Q_COMPILER_INITIALIZER_LISTS when compiling with clang? What's
163 # up with that? 164 # up with that?
164 if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") 165 if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
165 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated -DQ_COMPILER_INITIALIZER_LISTS") 166 #set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated")
166 endif() 167 endif()
167 168
168 include_directories ("${PROJECT_BINARY_DIR}") 169 include_directories ("${PROJECT_BINARY_DIR}")
169 include_directories ("${PROJECT_BINARY_DIR}/src") 170 include_directories ("${PROJECT_BINARY_DIR}/src")
170 include_directories ("${PROJECT_BINARY_DIR}/src/misc") 171 include_directories ("${PROJECT_BINARY_DIR}/src/misc")
178 if (USE_QT5) 179 if (USE_QT5)
179 qt5_generate_moc (LDFORGE_MOC ${LDFORGE_HEADERS}) 180 qt5_generate_moc (LDFORGE_MOC ${LDFORGE_HEADERS})
180 qt5_add_resources (LDFORGE_QRC ${LDFORGE_RESOURCES}) 181 qt5_add_resources (LDFORGE_QRC ${LDFORGE_RESOURCES})
181 qt5_wrap_ui (LDFORGE_FORMS_HEADERS ${LDFORGE_FORMS}) 182 qt5_wrap_ui (LDFORGE_FORMS_HEADERS ${LDFORGE_FORMS})
182 add_executable (ldforge WIN32 ${LDFORGE_SOURCES} ${LDFORGE_MOC} 183 add_executable (ldforge WIN32 ${LDFORGE_SOURCES} ${LDFORGE_MOC}
183 ${LDFORGE_QRC} ${LDFORGE_FORMS_HEADERS}) 184 ${LDFORGE_QRC} ${LDFORGE_FORMS_HEADERS}
185 ${CMAKE_BINARY_DIR}/configurationvaluebag.cpp)
184 else() 186 else()
185 qt4_wrap_cpp (LDFORGE_MOC ${LDFORGE_HEADERS}) 187 qt4_wrap_cpp (LDFORGE_MOC ${LDFORGE_HEADERS})
186 qt4_wrap_ui (LDFORGE_FORMS_HEADERS ${LDFORGE_FORMS}) 188 qt4_wrap_ui (LDFORGE_FORMS_HEADERS ${LDFORGE_FORMS})
187 qt4_add_resources (LDFORGE_RCC ${LDFORGE_RESOURCES}) 189 qt4_add_resources (LDFORGE_RCC ${LDFORGE_RESOURCES})
188 add_executable (ldforge WIN32 ${LDFORGE_SOURCES} ${LDFORGE_RCC} 190 add_executable (ldforge WIN32 ${LDFORGE_SOURCES} ${LDFORGE_RCC}
189 ${LDFORGE_FORMS_HEADERS} ${LDFORGE_MOC}) 191 ${LDFORGE_FORMS_HEADERS} ${LDFORGE_MOC}
192 ${CMAKE_BINARY_DIR}/configurationvaluebag.cpp)
190 endif() 193 endif()
191 194
192 if (USE_QT5) 195 if (USE_QT5)
193 target_link_libraries (ldforge Qt5::Widgets Qt5::Network Qt5::OpenGL ${OPENGL_LIBRARIES}) 196 target_link_libraries (ldforge Qt5::Widgets Qt5::Network Qt5::OpenGL ${OPENGL_LIBRARIES})
194 else() 197 else()

mercurial