root/simulator/trunk/src/utilities/animationviewer/CMakeLists.txt

Revision 1468, 9.4 kB (checked in by sehenley, 6 months ago)

Update to Ogre 1.7.0 - removed CEGUI (no mingw support).

  • Property WBS set to 1.4.4.6
  • Property svn:keywords set to
    Url
    Rev
    Author
    Date
    Id
Line 
1 #    OSRail -- a network enabled railroad operations simulator and utilities
2 #    Copyright (C) 2007,2008,2009 Samuel E. Henley sehenley@comcast.net
3 #
4 #    This program is free software; you can redistribute it and/or modify
5 #    it under the terms of the GNU General Public License as published by
6 #    the Free Software Foundation; either version 2 of the License, or
7 #    (at your option) any later version.
8 #
9 #    This program is distributed in the hope that it will be useful,
10 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
11 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 #    GNU General Public License for more details.
13 #
14 #    You should have received a copy of the GNU General Public License along
15 #    with this program; if not, write to the Free Software Foundation, Inc.,
16 #    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 #
18 #
19 #----------------------------------------------------------------------
20 ## \file
21 ## \page animationviewercmakelists AnimationViewer CMakeLists.txt File.
22 ## This is the cmakelist.txt build file for the \ref AnimationViewer.
23 ## The \ref prerequisite.cmake file checks for ogre, OIS
24 ## and wxwidgets software development kits. This script will build the
25 ## \ref AnimationViewer will allow a user to view an animated version of
26 ## a model. Animation is automatic based on sub-component name -
27 ## so this utility should also allow for the sub-component names to be
28 ## changed. The script will also build AnimationViewerXRCResources.
29 #----------------------------------------------------------------------
30
31 PROJECT( AnimationViewer )
32 CMAKE_MINIMUM_REQUIRED( VERSION 2.6.3 )
33
34 # Get Working Directory trunk tag branch
35 IF( NOT SIMULATOR_WORKING_DIRECTORY )
36
37     STRING( REGEX REPLACE "/src/utilities/animationviewer/?$" ""
38         SIMULATOR_WORKING_DIRECTORY
39         ${AnimationViewer_SOURCE_DIR}
40     )
41
42     FIND_PATH( SIMULATOR_WORKING_DIRECTORY
43             Modules/prerequisite.cmake
44             ${SIMULATOR_WORKING_DIRECTORY}
45             DOC "The working directory is trunk, or a tag or a branch name."
46     )
47
48     STRING( REGEX REPLACE "/utilities/animationviewer/?$" "/bin"
49         SIMULATOR_WORKING_BINARY_DIRECTORY
50         ${AnimationViewer_BINARY_DIR}
51     )
52
53
54     INCLUDE( ${SIMULATOR_WORKING_DIRECTORY}/Modules/prerequisite.cmake )
55
56 ENDIF( NOT SIMULATOR_WORKING_DIRECTORY )
57
58
59
60 ## \remarks
61 ## Prebuild step for vc produces animationviewerresources.cpp
62 ## Custom command for pre-build event must be done after target (animationviewer) is added
63 ## There is no pre-build event for msvc 6.0
64 ## CommandLine=wxrc -g animationviewer.xrc --uncompressed --cpp-code --output animationviewerresources.cpp
65
66
67 SET( RESOURCE_SOURCES
68      ${PROJECT_SOURCE_DIR}/animationviewer.xrc
69 )
70
71 ADD_CUSTOM_COMMAND(  OUTPUT ${PROJECT_BINARY_DIR}/animationviewerresources.cpp
72                      COMMAND ${OSRAILWXWIDGETS_WXRC_EXECUTABLE}
73                      ARGS --cpp-code ${RESOURCE_SOURCES}
74                           --output=${PROJECT_BINARY_DIR}/animationviewerresources.cpp
75                      DEPENDS ${RESOURCE_SOURCES}
76                      WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
77                      COMMENT "Build animationviewerresources.cpp"
78 )
79
80 SET_DIRECTORY_PROPERTIES( PROPERTIES
81                           ADDITIONAL_MAKE_CLEAN_FILES ${PROJECT_BINARY_DIR}/animationviewerresources.cpp
82 )
83
84 ## \note Global/Director/Target  property CODEBLOCKS_CONFIGURED_FILES = is a list
85 ## of files  that are the source for a generated source file or script - this is a clue
86 ## to programmer not to edit a generate${CMAKE_CURRENT_SOURCE_DIR} file but edit it's source and re-configure.
87 ## Files are cumulative from global, directory to target.
88
89 SET_PROPERTY( DIRECTORY ${PROJECT_SOURCE_DIR}
90               PROPERTY CODEBLOCKS_GENERATED_FILES ${PROJECT_BINARY_DIR}/animationviewerresources.cpp
91 )
92
93
94 SET( PCH_HEADER preanimationviewer.h )
95
96 SET( HEADERS
97     ${PCH_HEADER}
98     animationviewer.h
99     animationviewerlistframe.h
100     animationviewerdocument.h
101     animationviewerview.h
102     animationviewercanvas.h
103 )
104
105 SET( SOURCES
106     animationviewer.cpp
107     animationviewerlistframe.cpp
108     animationviewerdocument.cpp
109     animationviewerview.cpp
110     animationviewercanvas.cpp
111 )
112
113 # The Build is divided into source and binary paths
114 SET( ANIMATIONVIEWER_SOURCES
115      ${SOURCES}
116      ${HEADERS}
117 )
118
119 # WIN32 has no effect on any system other than Windows -
120 # on Windows uses WinMain rather then main.
121 ADD_EXECUTABLE( AnimationViewer WIN32
122     ${ANIMATIONVIEWER_SOURCES}
123 )
124
125 PACKAGE_CONFIGURE( AnimationViewer
126                   Debug wx-config ${WXPREFIX} ${WXCFG_DEBUG} --unicode=no --debug=yes --static=no --cflags
127                   debug wx-config ${WXPREFIX} ${WXCFG_DEBUG} --unicode=no --debug=yes --static=no --libs
128                   RelWithDebInfo Release MinSizeRel wx-config ${WXPREFIX} ${WXCFG} --unicode=no --debug=no --static=no --cflags
129                   optimized wx-config ${WXPREFIX} ${WXCFG} --unicode=no --debug=no --static=no --libs
130                   paths.pc
131                   boost.pc
132                   ipc.pc
133                   osrail.pc
134 )
135
136
137 ADD_LIBRARY( animationviewerxrcresources STATIC
138     ${PROJECT_BINARY_DIR}/animationviewerresources.cpp
139 )
140
141 PACKAGE_CONFIGURE( animationviewerxrcresources
142                   Debug wx-config ${WXPREFIX} ${WXCFG_DEBUG} --unicode=no --debug=yes --static=no --cflags
143                   RelWithDebInfo Release MinSizeRel wx-config ${WXPREFIX} ${WXCFG} --unicode=no --debug=no --static=no --cflags
144                   osrail.pc
145 )
146
147
148 TARGET_LINK_LIBRARIES( AnimationViewer
149                        optimized animationviewerxrcresources
150                        debug animationviewerxrcresources_d
151 )
152
153 PRECOMPILED_HEADER( "Unix Makefiles" AnimationViewer ${PCH_HEADER} ${SIMULATOR_WORKING_INCLUDE_DIRECTORY} )
154 PRECOMPILED_HEADER( "CodeBlocks" AnimationViewer ${PCH_HEADER} "1" )
155 PRECOMPILED_HEADER( "MinGW Makefiles" AnimationViewer ${PCH_HEADER} ${SIMULATOR_WORKING_INCLUDE_DIRECTORY} )
156
157 ADD_DEPENDENCIES( AnimationViewer
158     animationviewerxrcresources
159     ipc
160     paths
161     ${SIMULATOR_WORKING_INCLUDE_DIRECTORY}/${PCH_HEADER}.gch
162 )
163
164
165 ## \note Global/Director/Target property CODEBLOCKS_GENERATED_FILES = is a list
166 ## of files that are generate by other targets to be include in this project file.
167 ## Files are cumulative from global, directory to target.
168 #
169 #SET_PROPERTY( TARGET AnimationViewer
170 #              PROPERTY CODEBLOCKS_GENERATED_FILES ${PROJECT_BINARY_DIR}/animationviewerresources.cpp
171 #)
172 #
173 ## \note Target property CODEBLOCKS_VIRTUAL_BUILDS sets a list of virtual build types for a project file
174 ## As an Example All RelWithDebInfo Debug Release MinSizeRel Development Debug The build types must
175 ## be in CMAKE_BUILD_TYPES or it will be considered as an alias and probably fail.
176 #
177 #
178 #SET_PROPERTY( TARGET AnimationViewer
179 #              PROPERTY CODEBLOCKS_VIRTUAL_BUILDS Development Debug
180 #)
181 #
182 ## \note Target property CODEBLOCKS_SHOW_NOTE displays a note for a project when opened
183 #SET_PROPERTY( TARGET AnimationViewer
184 #              PROPERTY CODEBLOCKS_SHOW_NOTE OFF
185 #)
186 #
187 ### \note Target property CODEBLOCKS_NOTE sets a note for a project
188 #
189 #SET_PROPERTY( TARGET AnimationViewer
190 #              PROPERTY CODEBLOCKS_NOTE
191 #"   AnimationViewer
192 # AnimationViewer allows a user to view an animated version of a model.
193 # Animation is automatic based on sub-component name - so this utility
194 # also allows the sub-component names to be changed.
195 #
196 # OSRail version $Id$
197 # -- a network enabled railroad operations simulator and utilities ---
198 # Copyright (C) 2007,2008,2009 Samuel E. Henley sehenley@comcast.net
199 #
200 # This program is free software; you can redistribute it and/or modify
201 # it under the terms of the GNU General Public License as published by
202 # the Free Software Foundation; either version 2 of the License, or
203 # (at your option) any later version.
204 #
205 # This program is distributed in the hope that it will be useful,
206 # but WITHOUT ANY WARRANTY; without even the implied warranty of
207 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
208 # GNU General Public License for more details.
209 #
210 # You should have received a copy of the GNU General Public License along
211 # with this program; if not, write to the Free Software Foundation, Inc.,
212 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA."
213 #
214 #)
215 #
216
217
218 ## \par Win32 Resource
219 ## Resource required for application icon on windows.
220 ## Resource are a custom command because the vc ide world leave
221 ## unwanted binary files in the source tree if the rc file is
222 ## added to the project source. The resulting res file is named as a library file
223 ## so that it will go into TARGET_LINK_LIBRARIES without a name change.
224 ## RC can figure out that it's really a resource file or maybe it really is a library?
225 IF( WIN32 )
226
227     ADD_CUSTOM_COMMAND( TARGET AnimationViewer
228                         PRE_BUILD
229                         COMMAND ${RC_EXECUTABLE}
230                         ARGS -fo${SIMULATOR_WORKING_ARCHIVE_DIRECTORY}/libanimationviewerwin32resources.a
231                              ${PROJECT_SOURCE_DIR}/animationviewer.rc
232                         MAIN_DEPENDENCY ${PROJECT_SOURCE_DIR}/animationviewer.rc
233                         COMMENT "Windows Application Icon"
234     )
235
236     TARGET_LINK_LIBRARIES( AnimationViewer
237                            animationviewerwin32resources
238     )
239
240     INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR} )
241
242 ENDIF( WIN32 )
243
244 ## \par Subdirectories Scripts.
245 ## installer test
246 ## The installer is a part of the build and integration test
247 ## The installer has its own unit tests. The test sub-directory is the
248 ## unit tests for AnimationViewer.
249 SUBDIRS( test )
Note: See TracBrowser for help on using the browser.