From ce6caa8d3e0218fade810d682eb9a20a20845d5b Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 7 Jan 2020 13:35:23 -0700 Subject: [PATCH] CMake: `/etc/*.prc` -> `/etc/panda3d/*.prc` --- dtool/Config.cmake | 7 ++++++- panda/src/configfiles/CMakeLists.txt | 19 ++++++++++++------- panda/src/configfiles/panda.prc.in | 2 +- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index bdad20b861..909782241a 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -121,7 +121,12 @@ endif() # tree starting at the location of libpandaexpress.dll for any # directories called 'etc'. -set(DEFAULT_PRC_DIR "etc" CACHE STRING +if(UNIX) + set(_default_prc "etc/panda3d") +else() + set(_default_prc "etc") +endif() +set(DEFAULT_PRC_DIR "${_default_prc}" CACHE STRING "The compiled-in default directory to look for the Config.prc file, in the absence of the PRC_DIR environment variable set, and in the absence of anything specified via the configpath directive.") diff --git a/panda/src/configfiles/CMakeLists.txt b/panda/src/configfiles/CMakeLists.txt index fe1e642589..cd7f61fc72 100644 --- a/panda/src/configfiles/CMakeLists.txt +++ b/panda/src/configfiles/CMakeLists.txt @@ -32,17 +32,22 @@ else() "$XDG_CACHE_HOME/panda3d") endif() -if(IS_MULTICONFIG) - set(_out_path "${PROJECT_BINARY_DIR}/$/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() - set(_out_path "${PROJECT_BINARY_DIR}/etc") + set(_confdir "etc") + set(_out_path "etc") + set(ETC_PARENT_PATH "..") endif() -if(WIN32) - set(_confdir "etc") +if(IS_MULTICONFIG) + set(_out_path "${PROJECT_BINARY_DIR}/$/${_out_path}") 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() # Path from the directory containing *.prc to the *parent of* models/ diff --git a/panda/src/configfiles/panda.prc.in b/panda/src/configfiles/panda.prc.in index f5f14f7dd2..3d1dc5c444 100644 --- a/panda/src/configfiles/panda.prc.in +++ b/panda/src/configfiles/panda.prc.in @@ -2,7 +2,7 @@ ################################# DO NOT EDIT ########################### # Some paths first... -plugin-path $THIS_PRC_DIR/../lib +plugin-path $THIS_PRC_DIR/${ETC_PARENT_PATH}/lib model-path $MAIN_DIR model-path $THIS_PRC_DIR/${MODELS_PARENT_PATH} model-path $THIS_PRC_DIR/${MODELS_PARENT_PATH}/models