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 c18cf13..c13b2ca 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 b6a8865..1868b74 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 9d55cf3..2c3d6dd 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 230fa15..38028e7 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 fa4fa1a..f714fc7 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 );
        }