]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
cmake/radiant: FHS fixes 109/head
authorThomas Debesse <dev@illwieckz.net>
Wed, 2 Jan 2019 03:06:29 +0000 (04:06 +0100)
committerThomas Debesse <dev@illwieckz.net>
Sat, 18 May 2019 20:47:42 +0000 (22:47 +0200)
really install game files in share/netradiant
look for glsl stuff in share/netradiant/gl
and a bit more

CMakeLists.txt
include/qerplugin.h
radiant/plugin.cpp
radiant/qe3.cpp
radiant/renderstate.cpp

index c18cf13e8b0483722cecd014da1ad512c15d0d39..c13b2ca86c019b25796ec4f1334141082068bff9 100644 (file)
@@ -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()
 
index b6a8865f2bcc6c9b42c147f6469c3704cdb834e8..1868b74555fd7ea82129fdc4206c063d5c60d466 100644 (file)
@@ -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 )( );
 
index 9d55cf3b4a5126afe5d54d8da82ce96097d762ea..2c3d6dd0cc5e05570c302caa3231f32e76589683 100644 (file)
@@ -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;
index 230fa1546bb8990172ddfa18fb61118df6bfaaee..38028e7dd5918d087aea2d0b8ea2dc44dc26df00 100644 (file)
@@ -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
index fa4fa1a358a0ccaf07a23a48765d4a2f8ea91b74..f714fc7eb2dd16712ae6486829ae7d81ea8965c0 100644 (file)
@@ -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 );
        }