Просмотр исходного кода

Use CMake to set CROWN_VERSION_*

Daniele Bartolini 12 лет назад
Родитель
Сommit
acd7dfe7e9
4 измененных файлов с 35 добавлено и 11 удалено
  1. 4 0
      CMakeLists.txt
  2. 30 0
      src/Config.h.in
  3. 1 5
      src/Device.cpp
  4. 0 6
      src/Device.h

+ 4 - 0
CMakeLists.txt

@@ -2,6 +2,10 @@ cmake_minimum_required(VERSION 2.8)
 
 
 project(crown)
 project(crown)
 
 
+set (CROWN_VERSION_MAJOR 0)
+set (CROWN_VERSION_MINOR 1)
+set (CROWN_VERSION_MICRO 0)
+
 option (CROWN_USE_FLOAT "Whether to use float or double for representing real numbers." ON)
 option (CROWN_USE_FLOAT "Whether to use float or double for representing real numbers." ON)
 option (CROWN_BUILD_OPENGL "Whether to build the OpenGL renderer or not." ON)
 option (CROWN_BUILD_OPENGL "Whether to build the OpenGL renderer or not." ON)
 option (CROWN_BUILD_OPENGLES "Whether to build the OpenGL|ES 1.0 renderer or not." OFF)
 option (CROWN_BUILD_OPENGLES "Whether to build the OpenGL|ES 1.0 renderer or not." OFF)

+ 30 - 0
src/Config.h.in

@@ -1,3 +1,33 @@
+/*
+Copyright (c) 2013 Daniele Bartolini, Michele Rossi
+Copyright (c) 2012 Daniele Bartolini, Simone Boscaratto
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+#define CROWN_VERSION_MAJOR @CROWN_VERSION_MAJOR@
+#define CROWN_VERSION_MINOR @CROWN_VERSION_MINOR@
+#define CROWN_VERSION_MICRO @CROWN_VERSION_MICRO@
+
 #cmakedefine LINUX
 #cmakedefine LINUX
 #cmakedefine WINDOWS
 #cmakedefine WINDOWS
 #cmakedefine CROWN_BUILD_OPENGL
 #cmakedefine CROWN_BUILD_OPENGL

+ 1 - 5
src/Device.cpp

@@ -41,10 +41,6 @@ OTHER DEALINGS IN THE SOFTWARE.
 namespace crown
 namespace crown
 {
 {
 
 
-const uint16_t Device::CROWN_MAJOR = 0;
-const uint16_t Device::CROWN_MINOR = 1;
-const uint16_t Device::CROWN_MICRO = 0;
-
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 Device::Device() :
 Device::Device() :
 	m_preferred_window_width(1000),
 	m_preferred_window_width(1000),
@@ -80,7 +76,7 @@ bool Device::init(int argc, char** argv)
 	}
 	}
 
 
 	// Initialize
 	// Initialize
-	Log::I("Initializing Crown Engine %d.%d.%d...", CROWN_MAJOR, CROWN_MINOR, CROWN_MICRO);
+	Log::I("Initializing Crown Engine %d.%d.%d...", CROWN_VERSION_MAJOR, CROWN_VERSION_MINOR, CROWN_VERSION_MICRO);
 
 
 	// Set the root path
 	// Set the root path
 	// GetFilesystem()->Init(m_preferred_root_path.c_str(), m_preferred_user_path.c_str());
 	// GetFilesystem()->Init(m_preferred_root_path.c_str(), m_preferred_user_path.c_str());

+ 0 - 6
src/Device.h

@@ -60,12 +60,6 @@ private:
 	bool					parse_command_line(int argc, char** argv);
 	bool					parse_command_line(int argc, char** argv);
 	void					print_help_message();
 	void					print_help_message();
 
 
-private:
-
-	static const uint16_t	CROWN_MAJOR;
-	static const uint16_t	CROWN_MINOR;
-	static const uint16_t	CROWN_MICRO;
-
 private:
 private:
 
 
 	// Preferred settings from command line
 	// Preferred settings from command line