Browse Source

Get dtoolutil to build under CMake.

Sam Edwards 12 years ago
parent
commit
3f4f03229f

+ 6 - 1
dtool/Configure.cmake

@@ -339,7 +339,6 @@ check_include_file_cxx(linux/input.h PHAVE_LINUX_INPUT_H)
 check_include_file_cxx(stdint.h PHAVE_STDINT_H)
 
 set(HAVE_NAMESPACE ON)
-set(HAVE_OPEN_MASK ON)
 set(HAVE_LOCKF ON)
 set(HAVE_WCHAR_T ON)
 set(HAVE_WSTRING ON)
@@ -348,5 +347,11 @@ set(SIMPLE_STRUCT_POINTERS ON)
 set(HAVE_STREAMSIZE ON)
 set(HAVE_IOS_TYPEDEFS ON)
 
+if(WIN32)
+	set(DEFAULT_PATHSEP ";")
+else()
+	set(DEFAULT_PATHSEP ":")
+endif()
+
 configure_file(${CMAKE_CURRENT_LIST_DIR}/dtool_config.h.cmake ${CMAKE_BINARY_DIR}/include/dtool_config.h)
 include_directories("${CMAKE_BINARY_DIR}/include")

+ 1 - 0
dtool/Package.cmake

@@ -39,3 +39,4 @@ set(DEFAULT_PRC_DIR "${INSTALL_DIR}/etc" CACHE STRING "Panda uses prc files for
 ## Include dtool subpackages ##
 include(${CMAKE_CURRENT_LIST_DIR}/Configure.cmake)
 include(${CMAKE_CURRENT_LIST_DIR}/src/dtoolbase/Sources.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/src/dtoolutil/Sources.cmake)

+ 1 - 1
dtool/dtool_config.h.cmake

@@ -261,7 +261,7 @@
 
 /* The compiled-in character(s) to expect to separate different
    components of a path list (e.g. $PRC_PATH). */
-#cmakedefine DEFAULT_PATHSEP
+#define DEFAULT_PATHSEP "@DEFAULT_PATHSEP@"
 
 /* Many of the prc variables are exported by
    dtool/src/prc/prc_parameters.h.pp, instead of here.  Only those prc

+ 68 - 0
dtool/src/dtoolutil/Sources.cmake

@@ -0,0 +1,68 @@
+include_directories(${CMAKE_CURRENT_LIST_DIR}/../dtoolbase)
+
+configure_file(${CMAKE_CURRENT_LIST_DIR}/pandaVersion.h.cmake
+               ${CMAKE_CURRENT_LIST_DIR}/pandaVersion.h)
+
+configure_file(${CMAKE_CURRENT_LIST_DIR}/checkPandaVersion.h.cmake
+               ${CMAKE_CURRENT_LIST_DIR}/checkPandaVersion.h)
+
+configure_file(${CMAKE_CURRENT_LIST_DIR}/checkPandaVersion.cxx.cmake
+               ${CMAKE_CURRENT_LIST_DIR}/checkPandaVersion.cxx)
+
+set(P3DTOOLUTIL_HEADER_FILES
+	checkPandaVersion.h
+	config_dtoolutil.h
+	dSearchPath.I dSearchPath.h
+	executionEnvironment.I executionEnvironment.h filename.I 
+	filename.h
+	globPattern.I globPattern.h
+	load_dso.h
+	pandaFileStream.h pandaFileStream.I
+	pandaFileStreamBuf.h
+	pandaSystem.h pandaVersion.h
+	panda_getopt.h panda_getopt_long.h panda_getopt_impl.h
+	pfstream.h pfstream.I pfstreamBuf.h
+	preprocess_argv.h
+	stringDecoder.h stringDecoder.I
+	textEncoder.h textEncoder.I
+	unicodeLatinMap.h
+	vector_string.h
+	vector_src.h
+	win32ArgParser.h
+)
+
+if(APPLE)
+	set(P3DTOOL_HEADER_FILES ${P3DTOOL_HEADER_FILES}
+		filename_assist.mm filename_assist.h)
+endif()
+
+set(P3DTOOLUTIL_SOURCE_FILES
+	checkPandaVersion.cxx
+	config_dtoolutil.cxx
+	dSearchPath.cxx
+	executionEnvironment.cxx filename.cxx
+	globPattern.cxx
+	load_dso.cxx 
+	pandaFileStream.cxx pandaFileStreamBuf.cxx
+	pandaSystem.cxx
+	panda_getopt_impl.cxx
+	pfstreamBuf.cxx pfstream.cxx
+	preprocess_argv.cxx
+	stringDecoder.cxx
+	textEncoder.cxx
+	unicodeLatinMap.cxx
+	vector_string.cxx
+	win32ArgParser.cxx
+)
+
+foreach(FILENAME IN LISTS P3DTOOLUTIL_HEADER_FILES)
+	set(P3DTOOLUTIL_INSTALL_HEADERS ${P3DTOOLUTIL_INSTALL_HEADERS} ${CMAKE_CURRENT_LIST_DIR}/${FILENAME})
+endforeach()
+foreach(FILENAME IN LISTS P3DTOOLUTIL_SOURCE_FILES)
+	set(P3DTOOLUTIL_SOURCES ${P3DTOOLUTIL_SOURCES} ${CMAKE_CURRENT_LIST_DIR}/${FILENAME})
+endforeach()
+
+add_library(p3dtoolutil
+	${P3DTOOLUTIL_INSTALL_HEADERS}
+	${P3DTOOLUTIL_SOURCES}
+)

+ 21 - 0
dtool/src/dtoolutil/checkPandaVersion.cxx.cmake

@@ -0,0 +1,21 @@
+/* Filename: checkPandaVersion.cxx
+ * Created by:  drose (26Jan05)
+ *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * PANDA 3D SOFTWARE
+ * Copyright (c) Carnegie Mellon University.  All rights reserved.
+ *
+ * All use of this software is subject to the terms of the revised BSD
+ * license.  You should have received a copy of this license along
+ * with this source code in a file named "LICENSE."
+ *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*******************************************************************
+ *  Generated automatically by CMake.
+ ***************************** DO NOT EDIT *************************/
+
+# include "dtoolbase.h"
+
+EXPCL_DTOOL int @PANDA_VERSION_SYMBOL@ = 0;

+ 39 - 0
dtool/src/dtoolutil/checkPandaVersion.h.cmake

@@ -0,0 +1,39 @@
+/* Filename: checkPandaVersion.h
+ * Created by:  drose (26Jan05)
+ *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * PANDA 3D SOFTWARE
+ * Copyright (c) Carnegie Mellon University.  All rights reserved.
+ *
+ * All use of this software is subject to the terms of the revised BSD
+ * license.  You should have received a copy of this license along
+ * with this source code in a file named "LICENSE."
+ *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*******************************************************************
+ *  Generated automatically by CMake.
+ ***************************** DO NOT EDIT *************************/
+
+/* Include this file in code that compiles with Panda to guarantee
+   that it is linking with the same version of the Panda DLL's that it
+   was compiled with.  You should include it in one .cxx file only. */
+
+/* We guarantee this by defining an external symbol which is based on
+   the version number.  If that symbol is defined, then our DLL's
+   (probably) match.  Otherwise, we must be running with the wrong
+   DLL; but the system linker will prevent the DLL from loading with
+   an undefined symbol. */
+
+# include "dtoolbase.h"
+
+extern EXPCL_DTOOL int @PANDA_VERSION_SYMBOL@;
+
+# ifndef WIN32
+/* For Windows, exporting the symbol from the DLL is sufficient; the
+   DLL will not load unless all expected public symbols are defined.
+   Other systems may not mind if the symbol is absent unless we
+   explictly write code that references it. */
+static int check_panda_version = @PANDA_VERSION_SYMBOL@;
+# endif

+ 77 - 0
dtool/src/dtoolutil/pandaVersion.h.cmake

@@ -0,0 +1,77 @@
+/* Filename: pandaVersion.h
+ * Created by:  drose (26Jan05)
+ *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * PANDA 3D SOFTWARE
+ * Copyright (c) Carnegie Mellon University.  All rights reserved.
+ *
+ * All use of this software is subject to the terms of the revised BSD
+ * license.  You should have received a copy of this license along
+ * with this source code in a file named "LICENSE."
+ *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*******************************************************************
+ *  Generated automatically by CMake.
+ ***************************** DO NOT EDIT *************************
+
+   Do NOT attempt to edit the version number in this file.  This is a
+   generated file, and your changes to this file will not persist.  To
+   increment the version number, modify dtool/PandaVersion.pp and
+   re-run ppremake.
+
+ ***************************** DO NOT EDIT *************************/
+
+/* Include this file anywhere you need to determine the Panda version
+   number at compile time.  If you need the runtime Panda version, use
+   pandaSystem.h instead. */
+
+/* Try to avoid including this file from another .h file; include it
+   only from .cxx instead.  This helps prevent unnecessarily long
+   rebuilds just because the version number changes; if this file is
+   included in a .h file, then any other files which also include that
+   .h file will need to be rebuilt when the version number changes. */
+
+#define PANDA_MAJOR_VERSION @PANDA_MAJOR_VERSION@
+#define PANDA_MINOR_VERSION @PANDA_MINOR_VERSION@
+#define PANDA_SEQUENCE_VERSION @PANDA_SEQUENCE_VERSION@
+
+/* Define if this is an "official" version, undefine otherwise. */
+#cmakedefine PANDA_OFFICIAL_VERSION
+
+/* This is the panda numeric version as a single number, with three
+   digits reserved for each component. */
+#define PANDA_NUMERIC_VERSION @PANDA_NUMERIC_VERSION@
+
+/* This is the panda version expressed as a string.  It ends in the
+   letter "c" if this is not an "official" version (e.g. it was checked
+   out from CVS by the builder). */
+#define PANDA_VERSION_STR "@PANDA_VERSION_STR@"
+
+/* This is the version of the Panda3D ABI expressed as a string.
+   This usually means the major and minor version. It should be the
+   same for Panda3D versions that are supposed to be backward
+   ABI compatible with each other. */
+#define PANDA_ABI_VERSION_STR "@PANDA_MAJOR_VERSION@.@PANDA_MINOR_VERSION@"
+
+/* This is a string indicating who has provided this distribution. */
+#define PANDA_DISTRIBUTOR "@PANDA_DISTRIBUTOR@"
+
+/* The string indicating the version number of the associated Panda3D
+   distributable package, or empty string if there is no associated
+   package. */
+#define PANDA_PACKAGE_VERSION_STR "@PANDA_PACKAGE_VERSION@"
+
+/* The string indicating the URL from which the associated Panda3D
+   distributable package may be downloaded, or empty string if there
+   is no associated package. */
+#define PANDA_PACKAGE_HOST_URL "@PANDA_PACKAGE_HOST_URL@"
+
+#if HAVE_P3D_PLUGIN
+/* Similar definitions for the plugin versioning, if in use. */
+#define P3D_PLUGIN_MAJOR_VERSION "@P3D_PLUGIN_MAJOR_VERSION@"
+#define P3D_PLUGIN_MINOR_VERSION "@P3D_PLUGIN_MINOR_VERSION@"
+#define P3D_PLUGIN_SEQUENCE_VERSION "@P3D_PLUGIN_SEQUENCE_VERSION@"
+#define P3D_COREAPI_VERSION_STR "@P3D_COREAPI_VERSION_STR@"
+#endif