From: Thomas Debesse Date: Wed, 2 Jan 2019 03:06:29 +0000 (+0100) Subject: cmake/radiant: FHS fixes X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b8f0b2351d49fedbcc3a67dab5f9852a246b0b3d;p=xonotic%2Fnetradiant.git cmake/radiant: FHS fixes really install game files in share/netradiant look for glsl stuff in share/netradiant/gl and a bit more --- diff --git a/CMakeLists.txt b/CMakeLists.txt index c18cf13e..c13b2ca8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -319,8 +319,13 @@ if (BUILD_BINARIES) endif () if (DOWNLOAD_GAMEPACKS) + if (FHS_INSTALL) + set(GAME_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/share/netradiant") + else () + set(GAME_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") + endif () install(CODE - "execute_process(COMMAND \"${PROJECT_SOURCE_DIR}/gamepack-manager\" --license ${GAMEPACKS_LICENSE_LIST} --name ${GAMEPACKS_NAME_LIST} --download-dir \"${PROJECT_BINARY_DIR}/download\" --install-dir \"${CMAKE_INSTALL_PREFIX}\" --install)" + "execute_process(COMMAND \"${PROJECT_SOURCE_DIR}/gamepack-manager\" --license ${GAMEPACKS_LICENSE_LIST} --name ${GAMEPACKS_NAME_LIST} --download-dir \"${PROJECT_BINARY_DIR}/download\" --install-dir \"${GAME_INSTALL_PREFIX}\" --install)" ) endif() diff --git a/include/qerplugin.h b/include/qerplugin.h index b6a8865f..1868b745 100644 --- a/include/qerplugin.h +++ b/include/qerplugin.h @@ -120,6 +120,7 @@ struct _QERFuncTable_1 const char* ( *getLocalRcPath )( ); const char* ( *getGameToolsPath )( ); const char* ( *getAppPath )( ); + const char* ( *getDataPath )( ); const char* ( *getSettingsPath )( ); const char* ( *getMapsPath )( ); diff --git a/radiant/plugin.cpp b/radiant/plugin.cpp index 9d55cf3b..2c3d6dd0 100644 --- a/radiant/plugin.cpp +++ b/radiant/plugin.cpp @@ -128,6 +128,7 @@ RadiantCoreAPI(){ m_radiantcore.getEnginePath = &EnginePath_get; m_radiantcore.getLocalRcPath = &LocalRcPath_get; m_radiantcore.getAppPath = &AppPath_get; + m_radiantcore.getDataPath = &DataPath_get; m_radiantcore.getGameToolsPath = &GameToolsPath_get; m_radiantcore.getSettingsPath = &SettingsPath_get; m_radiantcore.getMapsPath = &getMapsPath; diff --git a/radiant/qe3.cpp b/radiant/qe3.cpp index 230fa154..38028e7d 100644 --- a/radiant/qe3.cpp +++ b/radiant/qe3.cpp @@ -86,7 +86,7 @@ void QE_InitVFS(){ // editor builtin VFS StringOutputStream editorGamePath( 256 ); - editorGamePath << GlobalRadiant().getAppPath() << DEFAULT_EDITORVFS_DIRNAME; + editorGamePath << GlobalRadiant().getDataPath() << DEFAULT_EDITORVFS_DIRNAME; GlobalFileSystem().initDirectory( editorGamePath.c_str() ); // if we have a mod dir diff --git a/radiant/renderstate.cpp b/radiant/renderstate.cpp index fa4fa1a3..f714fc7e 100644 --- a/radiant/renderstate.cpp +++ b/radiant/renderstate.cpp @@ -224,10 +224,10 @@ void create(){ // create shader { StringOutputStream filename( 256 ); - filename << GlobalRadiant().getAppPath() << "gl/lighting_DBS_omni_vp.glsl"; + filename << GlobalRadiant().getDataPath() << "gl/lighting_DBS_omni_vp.glsl"; createShader( m_program, filename.c_str(), GL_VERTEX_SHADER_ARB ); filename.clear(); - filename << GlobalRadiant().getAppPath() << "gl/lighting_DBS_omni_fp.glsl"; + filename << GlobalRadiant().getDataPath() << "gl/lighting_DBS_omni_fp.glsl"; createShader( m_program, filename.c_str(), GL_FRAGMENT_SHADER_ARB ); } @@ -333,10 +333,10 @@ void create(){ // create shader { StringOutputStream filename( 256 ); - filename << GlobalRadiant().getAppPath() << "gl/zfill_vp.glsl"; + filename << GlobalRadiant().getDataPath() << "gl/zfill_vp.glsl"; createShader( m_program, filename.c_str(), GL_VERTEX_SHADER_ARB ); filename.clear(); - filename << GlobalRadiant().getAppPath() << "gl/zfill_fp.glsl"; + filename << GlobalRadiant().getDataPath() << "gl/zfill_fp.glsl"; createShader( m_program, filename.c_str(), GL_FRAGMENT_SHADER_ARB ); } @@ -407,13 +407,13 @@ void create(){ glGenProgramsARB( 1, &m_vertex_program ); glBindProgramARB( GL_VERTEX_PROGRAM_ARB, m_vertex_program ); StringOutputStream filename( 256 ); - filename << GlobalRadiant().getAppPath() << "gl/lighting_DBS_omni_vp.glp"; + filename << GlobalRadiant().getDataPath() << "gl/lighting_DBS_omni_vp.glp"; createProgram( filename.c_str(), GL_VERTEX_PROGRAM_ARB ); glGenProgramsARB( 1, &m_fragment_program ); glBindProgramARB( GL_FRAGMENT_PROGRAM_ARB, m_fragment_program ); filename.clear(); - filename << GlobalRadiant().getAppPath() << "gl/lighting_DBS_omni_fp.glp"; + filename << GlobalRadiant().getDataPath() << "gl/lighting_DBS_omni_fp.glp"; createProgram( filename.c_str(), GL_FRAGMENT_PROGRAM_ARB ); } @@ -509,13 +509,13 @@ void create(){ glGenProgramsARB( 1, &m_vertex_program ); glBindProgramARB( GL_VERTEX_PROGRAM_ARB, m_vertex_program ); StringOutputStream filename( 256 ); - filename << GlobalRadiant().getAppPath() << "gl/zfill_vp.glp"; + filename << GlobalRadiant().getDataPath() << "gl/zfill_vp.glp"; createProgram( filename.c_str(), GL_VERTEX_PROGRAM_ARB ); glGenProgramsARB( 1, &m_fragment_program ); glBindProgramARB( GL_FRAGMENT_PROGRAM_ARB, m_fragment_program ); filename.clear(); - filename << GlobalRadiant().getAppPath() << "gl/zfill_fp.glp"; + filename << GlobalRadiant().getDataPath() << "gl/zfill_fp.glp"; createProgram( filename.c_str(), GL_FRAGMENT_PROGRAM_ARB ); } @@ -590,13 +590,13 @@ void createVertexProgram(){ glGenProgramsNV( 1, &m_vertex_program ); glBindProgramNV( GL_VERTEX_PROGRAM_NV, m_vertex_program ); StringOutputStream filename( 256 ); - filename << GlobalRadiant().getAppPath() << "gl/lighting_DBS_omni_vp.nv30"; + filename << GlobalRadiant().getDataPath() << "gl/lighting_DBS_omni_vp.nv30"; createProgram( m_vertex_program, filename.c_str(), GL_VERTEX_PROGRAM_NV ); glGenProgramsNV( 1, &m_fragment_program ); glBindProgramNV( GL_FRAGMENT_PROGRAM_NV, m_fragment_program ); filename.clear(); - filename << GlobalRadiant().getAppPath() << "gl/lighting_DBS_omni_fp.nv30"; + filename << GlobalRadiant().getDataPath() << "gl/lighting_DBS_omni_fp.nv30"; createProgram( m_fragment_program, filename.c_str(), GL_FRAGMENT_PROGRAM_NV ); }