4
4
# This is the main file where we prepare the general build environment
5
5
# and provide build configuration options.
6
6
######################################################################
7
- # cmake system for PagedGeometry updated on the 5th of April by thomas {at}thomasfischer {DOT}biz
7
+ # cmake system for PagedGeometry updated on 6-10-2017 by Edgar {at}AnotherFoxGuy {DOT}com
8
8
9
- cmake_minimum_required (VERSION 2.4 )
10
- # loose if - else constructs
11
- SET (CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS TRUE )
12
- if (COMMAND cmake_policy )
13
- cmake_policy (SET CMP0003 NEW )
14
- endif (COMMAND cmake_policy )
9
+ cmake_minimum_required ( VERSION 3.0.2 )
10
+ set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR} /cmake )
15
11
16
12
17
13
# add some functions we use that are shipped with cmake
@@ -21,16 +17,23 @@ INCLUDE(CheckIncludeFileCXX)
21
17
INCLUDE (CheckCCompilerFlag )
22
18
INCLUDE (CheckCSourceCompiles )
23
19
20
+ # some versioning things
21
+ SET (LIB_MAJOR_VERSION "1" )
22
+ SET (LIB_MINOR_VERSION "2" )
23
+ SET (LIB_BUILD_VERSION "0" )
24
+ SET (LIB_VERSION "${LIB_MAJOR_VERSION} .${LIB_MINOR_VERSION} .${LIB_BUILD_VERSION} " )
25
+ IF (NOT DEFINED LIB_INSTALL_DIR )
26
+ SET (LIB_INSTALL_DIR "lib${LIB_SUFFIX} " )
27
+ ENDIF (NOT DEFINED LIB_INSTALL_DIR )
24
28
25
29
# define the project
26
- project (PagedGeometry )
27
-
28
- # find all dependencies
29
- include (CMakeDependenciesConfig.txt )
30
+ project (PagedGeometry VERSION ${LIB_VERSION} )
30
31
31
32
# build static libs by default
32
33
SET (BUILD_SHARED_LIBS OFF )
33
34
35
+ SET (CMAKE_USE_RELATIVE_PATHS OFF )
36
+
34
37
# setup paths
35
38
SET (RUNTIME_OUTPUT_DIRECTORY "${PagedGeometry_SOURCE_DIR} /bin/" )
36
39
SET (LIBRARY_OUTPUT_DIRECTORY "${PagedGeometry_SOURCE_DIR} /lib/" )
@@ -66,19 +69,11 @@ ELSEIF(UNIX)
66
69
endif (WIN32 )
67
70
68
71
# some PG build options
69
- set (PAGEDGEOMETRY_BUILD_SAMPLES "TRUE" CACHE BOOL "build the examples" )
72
+ set (PAGEDGEOMETRY_BUILD_SAMPLES "FALSE" CACHE BOOL "build the examples" )
70
73
set (PAGEDGEOMETRY_ALTERNATE_COORDSYSTEM "FALSE" CACHE BOOL "alternate coordinate system, do not use unless you are very sure about it" )
71
74
set (PAGEDGEOMETRY_USE_OGRE_RANDOM "FALSE" CACHE BOOL "fallback to Ogre's PRNG instead of using our own (not recommended)" )
72
75
set (PAGEDGEOMETRY_USER_DATA "FALSE" CACHE BOOL "ability to attach user data to entities" )
73
76
74
- # some versioning things
75
- SET (LIB_MAJOR_VERSION "1" )
76
- SET (LIB_MINOR_VERSION "2" )
77
- SET (LIB_BUILD_VERSION "0" )
78
- SET (LIB_VERSION "${LIB_MAJOR_VERSION} .${LIB_MINOR_VERSION} .${LIB_BUILD_VERSION} " )
79
- IF (NOT DEFINED LIB_INSTALL_DIR )
80
- SET (LIB_INSTALL_DIR "lib${LIB_SUFFIX} " )
81
- ENDIF (NOT DEFINED LIB_INSTALL_DIR )
82
77
83
78
# Needed for PagedGeometry.pc.in
84
79
SET (prefix ${CMAKE_INSTALL_PREFIX} )
@@ -102,34 +97,34 @@ INSTALL(FILES "${PagedGeometry_BINARY_DIR}/PagedGeometry.pc" DESTINATION "${LIB_
102
97
103
98
# some additional compiler flags
104
99
IF (NOT WIN32 )
105
- ADD_DEFINITIONS (-Wall )
106
- CHECK_C_COMPILER_FLAG (-Wextra HAVE_W_EXTRA )
107
- IF (HAVE_W_EXTRA )
108
- ADD_DEFINITIONS (-Wextra )
109
- ENDIF ()
100
+ ADD_DEFINITIONS (-Wall )
101
+ CHECK_C_COMPILER_FLAG (-Wextra HAVE_W_EXTRA )
102
+ IF (HAVE_W_EXTRA )
103
+ ADD_DEFINITIONS (-Wextra )
104
+ ENDIF ()
110
105
endif ()
111
106
112
107
# Set visibility options if available
113
108
IF (NOT WIN32 )
114
- CHECK_C_SOURCE_COMPILES ("int foo() __attribute__((destructor));
115
- int main() {return 0;}" HAVE_GCC_DESTRUCTOR )
116
-
117
- CHECK_C_COMPILER_FLAG (-fvisibility=hidden HAVE_VISIBILITY_SWITCH )
118
- IF (HAVE_VISIBILITY_SWITCH )
119
- CHECK_C_SOURCE_COMPILES ("int foo() __attribute__((visibility(\" default\" )));
120
- int main() {return 0;}" HAVE_GCC_VISIBILITY )
121
- IF (HAVE_GCC_VISIBILITY )
122
- ADD_DEFINITIONS (-fvisibility=hidden -DHAVE_GCC_VISIBILITY )
123
- ENDIF ()
124
- ENDIF ()
109
+ CHECK_C_SOURCE_COMPILES ("int foo() __attribute__((destructor));
110
+ int main() {return 0;}" HAVE_GCC_DESTRUCTOR )
111
+
112
+ CHECK_C_COMPILER_FLAG (-fvisibility=hidden HAVE_VISIBILITY_SWITCH )
113
+ IF (HAVE_VISIBILITY_SWITCH )
114
+ CHECK_C_SOURCE_COMPILES ("int foo() __attribute__((visibility(\" default\" )));
115
+ int main() {return 0;}" HAVE_GCC_VISIBILITY )
116
+ IF (HAVE_GCC_VISIBILITY )
117
+ ADD_DEFINITIONS (-fvisibility=hidden -DHAVE_GCC_VISIBILITY )
118
+ ENDIF ()
119
+ ENDIF ()
125
120
ENDIF ()
126
121
127
122
128
123
# now add the directories
129
124
add_subdirectory (source )
130
125
131
126
if (PAGEDGEOMETRY_BUILD_SAMPLES )
132
- add_subdirectory (examples )
127
+ add_subdirectory (examples )
133
128
endif (PAGEDGEOMETRY_BUILD_SAMPLES )
134
129
135
130
@@ -138,17 +133,22 @@ endif(PAGEDGEOMETRY_BUILD_SAMPLES)
138
133
set (CPACK_PACKAGE_DESCRIPTION "PagedGeometry" )
139
134
set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "The PagedGeometry engine is an add-on to Ogre which provides highly optimized methods for rendering massive amounts of small meshes, covering a possibly infinite area." )
140
135
set (CPACK_PACKAGE_NAME "pagedgeometry" )
141
- set (CPACK_DEBIAN_PACKAGE_DEPENDS "pagedgeometry" )
142
- set (
CPACK_PACKAGE_CONTACT "[email protected] " )
143
- set (
CPACK_PACKAGE_VENDOR "[email protected] " )
136
+ set (CPACK_DEBIAN_PACKAGE_DEPENDS "libogre-1.9-dev, libois-dev" )
137
+ set (
CPACK_PACKAGE_CONTACT "[email protected] " )
138
+ set (
CPACK_PACKAGE_VENDOR "[email protected] " )
139
+ SET (CPACK_PACKAGE_VERSION ${LIB_VERSION} )
140
+ SET (CPACK_PACKAGE_VERSION_MAJOR ${LIB_MAJOR_VERSION} )
141
+ SET (CPACK_PACKAGE_VERSION_MINOR ${LIB_MINOR_VERSION} )
142
+ SET (CPACK_PACKAGE_VERSION_PATCH ${LIB_BUILD_VERSION} )
144
143
set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR} /zlib.txt" )
144
+ set (CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR} /README" )
145
145
146
146
SET (CPACK_GENERATOR ZIP )
147
147
IF (UNIX )
148
- SET (CPACK_GENERATOR ${CPACK_GENERATOR} ;STGZ;TGZ )
148
+ SET (CPACK_GENERATOR ${CPACK_GENERATOR} ;STGZ;TGZ;DEB;RPM )
149
149
ENDIF (UNIX )
150
150
IF (LINUX )
151
- SET (CPACK_GENERATOR ${CPACK_GENERATOR} ;DEB;RPM )
151
+ SET (CPACK_GENERATOR ${CPACK_GENERATOR} ;DEB;RPM )
152
152
ENDIF (LINUX )
153
153
IF (MSVC )
154
154
SET (CPACK_GENERATOR ${CPACK_GENERATOR} ;NSIS )
@@ -162,26 +162,25 @@ include(CPack)
162
162
# doxygen stuff
163
163
find_package (Doxygen )
164
164
if (DOXYGEN_FOUND )
165
- message ("found doxygen, generating documentation" )
166
- # prepare doxygen configuration file
167
- configure_file (${CMAKE_CURRENT_SOURCE_DIR} /docs/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR} /docs/Doxyfile )
168
- # add doxygen as target
169
- add_custom_target (doxygen ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR} /docs/Doxyfile )
170
-
171
- # cleanup $build/api-doc on "make clean"
172
- set_property (DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES api-doc )
173
-
174
- # add doxygen as dependency to doc-target
175
- get_target_property (DOC_TARGET doc TYPE )
176
- if (NOT DOC_TARGET )
177
- add_custom_target (doc )
178
- endif ()
179
- add_dependencies (doc doxygen )
180
- #install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/docs/html/ DESTINATION doc/api)
181
- # install man pages into packages, scope is now project root..
182
- #install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/api-doc/man/man3 DESTINATION share/man/man3/ )
165
+ message ("found doxygen, generating documentation" )
166
+ # prepare doxygen configuration file
167
+ configure_file (${CMAKE_CURRENT_SOURCE_DIR} /docs/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR} /Doxyfile )
168
+
169
+ add_custom_target ( doc -doxygen
170
+ COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR} /Doxyfile
171
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
172
+ COMMENT "Generating documentation with Doxygen."
173
+ VERBATIM
174
+ )
175
+
176
+ # cleanup $build/api-doc on "make clean"
177
+ set_property (DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES api-doc )
178
+
179
+ #install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/docs/html/ DESTINATION doc/pagedgeometry/api)
180
+ # install man pages into packages, scope is now project root..
181
+ #install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/api-doc/man/man3 DESTINATION share/man/man3/ )
183
182
endif (DOXYGEN_FOUND )
184
183
185
184
# other doc files
186
- set (DOC_FILES Contributors.txt zlib.txt GettingStarted.txt Todo.txt )
187
- install (FILES ${DOC_FILES} DESTINATION doc / )
185
+ set (DOC_FILES Contributors.txt zlib.txt GettingStarted.txt Todo.txt docs/Tutorial-1.odt docs/Tutorial-2.odt docs/Tutorial-3.odt docs/Tutorial-4.odt )
186
+ install (FILES ${DOC_FILES} DESTINATION doc /pagedgeometry/ )
0 commit comments