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

Revision 1468, 8.0 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 pathbuildercmakelists PathBuilder CMakeLists.txt File.
22 ## This is the cmakelist.txt build file for the \ref PathBuilder.
23 ## The \ref prerequisite.cmake file checks for ogre, OIS
24 ## and wxwidgets software development kits. \ref PathBuilder
25 ## will allow the user to plot the track paths. It will allow the user
26 ## to reconcile both digital and scanned maps, and scanned track
27 ## profiles. Pathbuilder will create an xml output representing a
28 ## track path. The xml file will include the user's notes and
29 ## source data references and other properties for the RouteBuilder.
30 ## The script will also build PathbuilderXRCResources.
31 #----------------------------------------------------------------------
32
33 # This project can be built independently
34 PROJECT( PathBuilder CXX )
35 CMAKE_MINIMUM_REQUIRED( VERSION 2.6.3 )
36
37 # Get Working Directory trunk tag branch
38 IF( NOT SIMULATOR_WORKING_DIRECTORY )
39     STRING( REGEX REPLACE "/src/utilities/pathbuilder$" ""
40         SIMULATOR_WORKING_DIRECTORY
41         ${TrainGear_SOURCE_DIR}
42     )
43
44     FIND_PATH( SIMULATOR_WORKING_DIRECTORY
45             Modules/prerequisite.cmake
46             ${SIMULATOR_WORKING_DIRECTORY}
47             DOC "The working directory is trunk, or a tag or a branch name."
48     )
49
50     STRING( REGEX REPLACE "/utilities/pathbuilder$" "/bin"
51         SIMULATOR_WORKING_BINARY_DIRECTORY
52         ${PathBuilder_BINARY_DIR}
53     )
54
55     INCLUDE( ${SIMULATOR_WORKING_DIRECTORY}/Modules/prerequisite.cmake )
56
57 ENDIF( NOT SIMULATOR_WORKING_DIRECTORY )
58
59
60 ## \remarks
61 ## Prebuild step for vc produces pathbuilderresources.cpp
62 ## Custom command for pre-build event must be done after target (pathbuilder) is added
63 ## There is no pre-build event for msvc 6.0
64 ## CommandLine=wxrc -g pathbuilder.xrc --uncompressed --cpp-code --output pathbuilderresources.cpp
65
66
67 SET( RESOURCE_SOURCES
68      ${PROJECT_SOURCE_DIR}/pathbuilder.xrc
69 )
70
71 ADD_CUSTOM_COMMAND(  OUTPUT ${PROJECT_BINARY_DIR}/pathbuilderresources.cpp
72                      COMMAND ${OSRAILWXWIDGETS_WXRC_EXECUTABLE}
73                      ARGS --cpp-code ${RESOURCE_SOURCES}
74                           --output=${PROJECT_BINARY_DIR}/pathbuilderresources.cpp
75                      DEPENDS ${RESOURCE_SOURCES}
76                      WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
77                      COMMENT "Build pathbuilderresources.cpp"
78 )
79
80 SET_DIRECTORY_PROPERTIES( PROPERTIES
81                           ADDITIONAL_MAKE_CLEAN_FILES ${PROJECT_BINARY_DIR}/pathbuilderresources.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}/pathbuilderresources.cpp
91 )
92
93 SET( PCH_HEADER prepathbuilder.h )
94
95 SET( HEADERS
96     ${PCH_HEADER}
97     pathbuilder.h
98     pathlistframe.h
99     pathdrgframe.h
100     pathimageframe.h
101     pathdoqqframe.h
102     pathned2dframe.h
103     pathned3dframe.h
104     pathdocument.h
105     pathlistview.h
106     pathtreeview.h
107     pathcanvas.h
108     path3dcanvas.h
109 )
110
111 SET( SOURCES
112     pathbuilder.cpp
113     pathlistframe.cpp
114     pathdrgframe.cpp
115     pathimageframe.cpp
116     pathdoqqframe.cpp
117     pathned2dframe.cpp
118     pathned3dframe.cpp
119     pathdocument.cpp
120     pathlistview.cpp
121     pathtreeview.cpp
122     pathcanvas.cpp
123     path3dcanvas.cpp
124 )
125
126 # The Build is divided into source and binary paths
127 SET( PATHBUILDER_SOURCES
128      ${PCH_DUMMY}
129      ${SOURCES}
130      ${HEADERS}
131 )
132
133 SOURCE_GROUP( "Source Files"
134     FILES ${SOURCES}
135 )
136
137 SOURCE_GROUP( "Header Files"
138     FILES ${HEADERS}
139 )
140
141 SOURCE_GROUP( "Pre-Compiled Header"
142     FILES ${PCH_HEADER}
143     ${PCH_DUMMY}
144 )
145
146 # WIN32 has no effect on any system other than Windows -
147 # on Windows uses WinMain rather then main.
148 ADD_EXECUTABLE( PathBuilder WIN32
149     ${PATHBUILDER_SOURCES}
150 )
151
152 PACKAGE_CONFIGURE( PathBuilder
153                   Debug wx-config ${WXPREFIX} ${WXCFG_DEBUG} --unicode=no --debug=yes --static=no --cflags
154                   debug wx-config ${WXPREFIX} ${WXCFG_DEBUG} --unicode=no --debug=yes --static=no --libs
155                   RelWithDebInfo Release MinSizeRel wx-config ${WXPREFIX} ${WXCFG} --unicode=no --debug=no --static=no --cflags
156                   optimized wx-config ${WXPREFIX} ${WXCFG} --unicode=no --debug=no --static=no --libs
157                   paths.pc
158                   boost.pc
159                   ipc.pc
160                   launcher.pc
161                   angelscript.pc
162                   gdalogr.pc
163                   mststokens.pc
164                   gdalutilities.pc
165                   location.pc
166                   nationalgrid.pc
167                   scriptmanager.pc
168                   ogrewindowmanager.pc
169                   gtk+-2.0
170                   curl.pc
171                   processor.pc
172                   OGRE.pc
173                   OIS.pc
174                   osrail.pc
175 )
176
177 ADD_LIBRARY( pathbuilderxrcresources STATIC
178     ${PROJECT_BINARY_DIR}/pathbuilderresources.cpp
179 )
180
181 PACKAGE_CONFIGURE( pathbuilderxrcresources
182                   Debug wx-config ${WXPREFIX} ${WXCFG_DEBUG} --unicode=no --debug=yes --static=no --cflags
183                   RelWithDebInfo Release MinSizeRel wx-config ${WXPREFIX} ${WXCFG} --unicode=no --debug=no --static=no --cflags
184                   osrail.pc
185 )
186
187 TARGET_LINK_LIBRARIES( PathBuilder
188     optimized pathbuilderxrcresources
189     debug pathbuilderxrcresources_d
190 )
191
192
193 PRECOMPILED_HEADER( "Unix Makefiles" PathBuilder ${PCH_HEADER} ${SIMULATOR_WORKING_INCLUDE_DIRECTORY} )
194 PRECOMPILED_HEADER( "CodeBlocks" PathBuilder ${PCH_HEADER} "1" )
195 PRECOMPILED_HEADER( "MinGW Makefiles" PathBuilder ${PCH_HEADER} ${SIMULATOR_WORKING_INCLUDE_DIRECTORY} )
196
197 ADD_DEPENDENCIES( PathBuilder
198     pathbuilderxrcresources
199     nationalgrid
200     ipc
201     launcher
202     gdalutilities
203     ogrewindowmanager
204     scriptmanager
205 )
206
207 ## \par Win32 Resource
208 ## Resource required for application icon on windows.
209 ## Resource are a custom command because the vc ide world leave
210 ## unwanted binary files in the source tree if the rc file is
211 ## added to the project source. The resulting res file is named as a library file
212 ## so that it will go into TARGET_LINK_LIBRARIES without a name change.
213 ## RC can figure out that it's really a resource file or maybe it really is a library?
214
215 IF( WIN32 )
216
217     ADD_CUSTOM_COMMAND( TARGET PathBuilder
218                         PRE_BUILD
219                         COMMAND ${RC_EXECUTABLE}
220                         ARGS -fo${SIMULATOR_WORKING_ARCHIVE_DIRECTORY}/libpathbuilderwin32resources.a
221                              ${PROJECT_SOURCE_DIR}/pathbuilder.rc
222                         MAIN_DEPENDENCY ${PROJECT_SOURCE_DIR}/pathbuilder.rc
223                         COMMENT "Windows Application Icon"
224     )
225
226     TARGET_LINK_LIBRARIES( PathBuilder
227                            pathbuilderwin32resources
228     )
229
230     INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR} )
231
232 ENDIF( WIN32 )
233
234 ## \par Subdirectories Scripts.
235 ## installer test
236 ## The installer is a part of the build and integration test
237 ## The installer has its own unit tests. The test sub-directory is the
238 ## unit tests for PathBuilder.
239 SUBDIRS( test )
Note: See TracBrowser for help on using the browser.