Browse Source

CMake: `/etc/*.prc` -> `/etc/panda3d/*.prc`

Sam Edwards 6 years ago
parent
commit
ce6caa8d3e
3 changed files with 19 additions and 9 deletions
  1. 6 1
      dtool/Config.cmake
  2. 12 7
      panda/src/configfiles/CMakeLists.txt
  3. 1 1
      panda/src/configfiles/panda.prc.in

+ 6 - 1
dtool/Config.cmake

@@ -121,7 +121,12 @@ endif()
 # tree starting at the location of libpandaexpress.dll for any
 # tree starting at the location of libpandaexpress.dll for any
 # directories called 'etc'.
 # directories called 'etc'.
 
 
-set(DEFAULT_PRC_DIR "<auto>etc" CACHE STRING
+if(UNIX)
+  set(_default_prc "<auto>etc/panda3d")
+else()
+  set(_default_prc "<auto>etc")
+endif()
+set(DEFAULT_PRC_DIR "${_default_prc}" CACHE STRING
   "The compiled-in default directory to look for the Config.prc file,
   "The compiled-in default directory to look for the Config.prc file,
 in the absence of the PRC_DIR environment variable set, and in
 in the absence of the PRC_DIR environment variable set, and in
 the absence of anything specified via the configpath directive.")
 the absence of anything specified via the configpath directive.")

+ 12 - 7
panda/src/configfiles/CMakeLists.txt

@@ -32,17 +32,22 @@ else()
     "$XDG_CACHE_HOME/panda3d")
     "$XDG_CACHE_HOME/panda3d")
 endif()
 endif()
 
 
-if(IS_MULTICONFIG)
-  set(_out_path "${PROJECT_BINARY_DIR}/$<CONFIG>/etc")
+if(UNIX)
+  # On Unices, ask the GNUInstallDirs module where /etc is -- and then install
+  # ourselves into /etc/panda3d
+  set(_confdir "${CMAKE_INSTALL_FULL_SYSCONFDIR}/panda3d")
+  set(_out_path "etc/panda3d")
+  set(ETC_PARENT_PATH "../..")
 else()
 else()
-  set(_out_path "${PROJECT_BINARY_DIR}/etc")
+  set(_confdir "etc")
+  set(_out_path "etc")
+  set(ETC_PARENT_PATH "..")
 endif()
 endif()
 
 
-if(WIN32)
-  set(_confdir "etc")
+if(IS_MULTICONFIG)
+  set(_out_path "${PROJECT_BINARY_DIR}/$<CONFIG>/${_out_path}")
 else()
 else()
-  # On Unices, ask the GNUInstallDirs module where /etc is
-  set(_confdir "${CMAKE_INSTALL_FULL_SYSCONFDIR}")
+  set(_out_path "${PROJECT_BINARY_DIR}/${_out_path}")
 endif()
 endif()
 
 
 # Path from the directory containing *.prc to the *parent of* models/
 # Path from the directory containing *.prc to the *parent of* models/

+ 1 - 1
panda/src/configfiles/panda.prc.in

@@ -2,7 +2,7 @@
 ################################# DO NOT EDIT ###########################
 ################################# DO NOT EDIT ###########################
 
 
 # Some paths first...
 # Some paths first...
-plugin-path $THIS_PRC_DIR/../lib
+plugin-path $THIS_PRC_DIR/${ETC_PARENT_PATH}/lib
 model-path $MAIN_DIR
 model-path $MAIN_DIR
 model-path $THIS_PRC_DIR/${MODELS_PARENT_PATH}
 model-path $THIS_PRC_DIR/${MODELS_PARENT_PATH}
 model-path $THIS_PRC_DIR/${MODELS_PARENT_PATH}/models
 model-path $THIS_PRC_DIR/${MODELS_PARENT_PATH}/models