Browse Source

CMake: Start cleaning up configuration variables.

kestred 12 years ago
parent
commit
905f0a8c55
2 changed files with 24 additions and 7 deletions
  1. 24 3
      dtool/CMakeLists.txt
  2. 0 4
      dtool/src/prc/CMakeLists.txt

+ 24 - 3
dtool/CMakeLists.txt

@@ -27,10 +27,31 @@ else()
 endif()
 endif()
 string(REPLACE "." "," P3D_PLUGIN_DLL_COMMA_VERSION "${P3D_PLUGIN_DLL_DOT_VERSION}")
 string(REPLACE "." "," P3D_PLUGIN_DLL_COMMA_VERSION "${P3D_PLUGIN_DLL_DOT_VERSION}")
 
 
+# PRC Config settings
+set(PRC_DEFAULT_DIR_ABSOLUTE "" CACHE STRING "Specify the PRC_DEFAULT_DIR as an absolute path.")
+if(NOT PRC_DEFAULT_DIR_ABSOLUTE)
+	set(PRC_DEFAULT_DIR "etc" CACHE STRING
+	"Panda uses prc files for runtime configuration. Panda will search the default
+	.prc directory if the PRC_PATH and PRC_DIR environment variables are not defined.")
+else()
+	set(PRC_DEFAULT_DIR "" CACHE STRING
+	"Panda uses prc files for runtime configuration. Panda will search the default
+	.prc directory if the PRC_PATH and PRC_DIR environment variables are not defined.")
+endif()
+set(PRC_DCONFIG_TRUST_LEVEL 0 CACHE STRING "The trust level value for any legacy (DConfig) variables.")
+set(PRC_INC_TRUST_LEVEL 0 CACHE STRING "The amount by which we globally increment the trust level.")
+if(PRC_DEFAULT_DIR AND PRC_DEFAULT_DIR_ABSOLUTE)
+	message(FATAL_ERROR "Cannot have both PRC_DEFAULT_DIR and PRC_DEFAULT_DIR_ABSOLUTE, choose one.")
+endif()
+
+# PRC special values for config headers
+if(PRC_DEFAULT_DIR_ABSOLUTE)
+	set(DEFAULT_PRC_DIR ${PRC_ABSOLUTE_DIR})
+else()
+	set(DEFAULT_PRC_DIR "${CMAKE_INSTALL_PREFIX}/panda/${PRC_DEFAULT_DIR}")
+endif()
+
 
 
-## Dtool Config ##
-set(INSTALL_DIR "/usr/local/panda" CACHE STRING "The directory in which to install Panda3D.")
-set(DTOOL_INSTALL "${INSTALL_DIR}" CACHE STRING "The directory in which to install the dtool package.")
 
 
 include(Configure.cmake)
 include(Configure.cmake)
 
 

+ 0 - 4
dtool/src/prc/CMakeLists.txt

@@ -1,10 +1,6 @@
 include_directories(../dtoolutil)
 include_directories(../dtoolutil)
 include_directories(../dtoolbase)
 include_directories(../dtoolbase)
 
 
-set(DEFAULT_PRC_DIR "${INSTALL_DIR}/etc" CACHE STRING "Panda uses prc files for runtime configuration. Panda will search the default .prc directory if the PRC_PATH and PRC_DIR environment variables are not defined.")
-set(PRC_DCONFIG_TRUST_LEVEL 0 CACHE STRING "The trust level value for any legacy (DConfig) variables.")
-set(PRC_INC_TRUST_LEVEL 0 CACHE STRING "The amount by which we globally increment the trust level.")
-
 configure_file(prc_parameters.h.cmake
 configure_file(prc_parameters.h.cmake
                prc_parameters.h)
                prc_parameters.h)
 include_directories(${CMAKE_CURRENT_BINARY_DIR})
 include_directories(${CMAKE_CURRENT_BINARY_DIR})