mirror of https://github.com/fwbuilder/fwbuilder
refactor: Reduce cmake global defines
This commit is contained in:
parent
751eb46be9
commit
598e2fafde
|
@ -7,7 +7,13 @@ set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9"
|
|||
|
||||
project(firewallbuilder LANGUAGES CXX C)
|
||||
|
||||
### Version variables and include file
|
||||
|
||||
include(VERSION)
|
||||
configure_file("${CMAKE_SOURCE_DIR}/src/version.h.in" "${CMAKE_BINARY_DIR}/src/version.h" @ONLY)
|
||||
include_directories(${CMAKE_BINARY_DIR}/src)
|
||||
|
||||
### Build type
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE Release CACHE STRING
|
||||
|
@ -38,19 +44,6 @@ set(CXX_DEFAULT_FLAGS # clang/GCC warnings
|
|||
$<$<CXX_COMPILER_ID:MSVC>:/WX;/W4>)
|
||||
|
||||
add_definitions(-D__STDC_FORMAT_MACROS)
|
||||
add_definitions(-DGENERATION="${PROJECT_GENERATION}")
|
||||
add_definitions(-DVERSION="${PROJECT_VERSION}")
|
||||
add_definitions(-DFS_SEPARATOR="/")
|
||||
add_definitions(-DFWBUILDER_XML_VERSION="${FWBUILDER_XML_VERSION}")
|
||||
add_definitions(-DPREFIX="${CMAKE_INSTALL_PREFIX}")
|
||||
|
||||
if(APPLE)
|
||||
add_definitions(-DRES_DIR="../Resources")
|
||||
elseif(WIN32)
|
||||
add_definitions(-DRES_DIR="resources")
|
||||
else()
|
||||
add_definitions(-DRES_DIR="${CMAKE_INSTALL_PREFIX}/${FWB_INSTALL_DATADIR}")
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
#add_definitions(-DIN_LIBXML) # Enable for static build
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
project(doc)
|
||||
|
||||
FILE(GLOB readme_files "${PROJECT_SOURCE_DIR}/README.*")
|
||||
FILE(GLOB readme_files "${CMAKE_CURRENT_SOURCE_DIR}/README.*")
|
||||
|
||||
install(FILES
|
||||
AUTHORS
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
project(antlr)
|
||||
|
||||
set(antlr_srcs
|
||||
ANTLRUtil.cpp
|
||||
ASTFactory.cpp
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
project(cisco_lib)
|
||||
|
||||
set(cisco_lib_srcs
|
||||
PolicyCompiler_cisco.cpp
|
||||
PolicyCompiler_cisco_acls.cpp
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
project(common)
|
||||
|
||||
set(common_srcs
|
||||
init.cpp
|
||||
init2.cpp)
|
||||
|
@ -13,5 +11,7 @@ target_link_libraries(common fwbuilder)
|
|||
|
||||
target_compile_options(common PRIVATE ${CXX_DEFAULT_FLAGS})
|
||||
|
||||
set_source_files_properties(init.cpp PROPERTIES COMPILE_DEFINITIONS PREFIX=\"${CMAKE_INSTALL_PREFIX}\")
|
||||
|
||||
qt5_use_modules(common Core)
|
||||
|
||||
|
|
|
@ -44,14 +44,14 @@ using namespace libfwbuilder;
|
|||
|
||||
void init(char * const*)
|
||||
{
|
||||
appRootDir = string(PREFIX) + FS_SEPARATOR + "bin";
|
||||
appRootDir = string(PREFIX) + "/" + "bin";
|
||||
|
||||
/* On Unix RES_DIR and LIBFWBUILDER_TEMPLATE_DIR are absolute paths */
|
||||
|
||||
libfwbuilder::init();
|
||||
|
||||
/* need argv0 for built-in installer on unix and mac */
|
||||
argv0 = appRootDir + FS_SEPARATOR + "fwbuilder";
|
||||
argv0 = appRootDir + "/" + "fwbuilder";
|
||||
|
||||
/* default directory where the user may want to save files */
|
||||
userDataDir = string(getenv("HOME"));
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
project(compiler_lib)
|
||||
|
||||
set(compiler_lib_srcs
|
||||
CompilerDriver.cpp
|
||||
CompilerDriver_files.cpp
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include <iostream>
|
||||
#include <iomanip>
|
||||
|
||||
#include "version.h"
|
||||
#include "CompilerDriver.h"
|
||||
#include "Configlet.h"
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
project(fwbedit)
|
||||
|
||||
find_package(OpenSSL REQUIRED)
|
||||
|
||||
set(fwbedit_srcs
|
||||
|
@ -30,6 +28,8 @@ ENDIF()
|
|||
|
||||
target_compile_options(fwbedit PRIVATE ${CXX_DEFAULT_FLAGS})
|
||||
|
||||
set_source_files_properties(fwbedit.cpp PROPERTIES COMPILE_DEFINITIONS PREFIX=\"${CMAKE_INSTALL_PREFIX}\")
|
||||
|
||||
install(TARGETS fwbedit RUNTIME DESTINATION ${FWB_INSTALL_BINDIR})
|
||||
|
||||
qt5_use_modules(fwbedit Widgets PrintSupport)
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
*/
|
||||
|
||||
|
||||
#include "version.h"
|
||||
#include "fwbuilder/Constants.h"
|
||||
|
||||
#include <qsettings.h>
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
project(fwbuilder-gui)
|
||||
|
||||
find_package(OpenSSL REQUIRED)
|
||||
|
||||
set(fwbuilder-gui_srcs
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
*/
|
||||
|
||||
|
||||
#include "version.h"
|
||||
#include "global.h"
|
||||
#include "../common/commoninit.h"
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
project(import)
|
||||
|
||||
set(import_srcs
|
||||
getProtoByName.cpp
|
||||
PreImport.cpp
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
project(iosacl)
|
||||
|
||||
set(iosacl_srcs
|
||||
iosacl.cpp
|
||||
)
|
||||
|
@ -18,6 +16,8 @@ ENDIF()
|
|||
|
||||
target_compile_options(fwb_iosacl PRIVATE ${CXX_DEFAULT_FLAGS})
|
||||
|
||||
set_source_files_properties(iosacl.cpp PROPERTIES COMPILE_DEFINITIONS PREFIX=\"${CMAKE_INSTALL_PREFIX}\")
|
||||
|
||||
install(TARGETS fwb_iosacl RUNTIME DESTINATION ${FWB_INSTALL_BINDIR})
|
||||
|
||||
qt5_use_modules(fwb_iosacl Widgets)
|
||||
|
|
|
@ -45,6 +45,7 @@
|
|||
#include <assert.h>
|
||||
#include <cstring>
|
||||
|
||||
#include "version.h"
|
||||
#include "CompilerDriver_iosacl.h"
|
||||
|
||||
#include "fwbuilder/Resources.h"
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
project(ipf)
|
||||
|
||||
set(ipf_srcs
|
||||
ipf.cpp)
|
||||
|
||||
|
@ -17,6 +15,8 @@ ENDIF()
|
|||
|
||||
target_compile_options(fwb_ipf PRIVATE ${CXX_DEFAULT_FLAGS})
|
||||
|
||||
set_source_files_properties(ipf.cpp PROPERTIES COMPILE_DEFINITIONS PREFIX=\"${CMAKE_INSTALL_PREFIX}\")
|
||||
|
||||
install(TARGETS fwb_ipf RUNTIME DESTINATION ${FWB_INSTALL_BINDIR})
|
||||
|
||||
qt5_use_modules(fwb_ipf Widgets)
|
||||
|
|
|
@ -50,6 +50,7 @@
|
|||
#include <assert.h>
|
||||
#include <cstring>
|
||||
|
||||
#include "version.h"
|
||||
#include "CompilerDriver_ipf.h"
|
||||
|
||||
#include "fwbuilder/Resources.h"
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
project(ipfw)
|
||||
|
||||
set(ipfw_srcs
|
||||
ipfw.cpp)
|
||||
|
||||
|
@ -17,6 +15,8 @@ ENDIF()
|
|||
|
||||
target_compile_options(fwb_ipfw PRIVATE ${CXX_DEFAULT_FLAGS})
|
||||
|
||||
set_source_files_properties(ipfw.cpp PROPERTIES COMPILE_DEFINITIONS PREFIX=\"${CMAKE_INSTALL_PREFIX}\")
|
||||
|
||||
install(TARGETS fwb_ipfw RUNTIME DESTINATION ${FWB_INSTALL_BINDIR})
|
||||
|
||||
qt5_use_modules(fwb_ipfw Widgets)
|
||||
|
|
|
@ -50,6 +50,7 @@
|
|||
#include <cstring>
|
||||
#include <assert.h>
|
||||
|
||||
#include "version.h"
|
||||
#include "CompilerDriver_ipfw.h"
|
||||
|
||||
#include "fwbuilder/Resources.h"
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
project(ipt)
|
||||
|
||||
set(ipt_srcs
|
||||
ipt.cpp)
|
||||
|
||||
|
@ -17,6 +15,8 @@ ENDIF()
|
|||
|
||||
target_compile_options(fwb_ipt PRIVATE ${CXX_DEFAULT_FLAGS})
|
||||
|
||||
set_source_files_properties(ipt.cpp PROPERTIES COMPILE_DEFINITIONS PREFIX=\"${CMAKE_INSTALL_PREFIX}\")
|
||||
|
||||
install(TARGETS fwb_ipt RUNTIME DESTINATION ${FWB_INSTALL_BINDIR})
|
||||
|
||||
qt5_use_modules(fwb_ipt Widgets)
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include <functional>
|
||||
#include <stdexcept>
|
||||
|
||||
#include "version.h"
|
||||
#include "CompilerDriver_ipt.h"
|
||||
|
||||
#include "fwbuilder/Resources.h"
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
project(iptlib)
|
||||
|
||||
set(iptlib_srcs
|
||||
CompilerDriver_ipt_policy.cpp
|
||||
OSData_ipt.cpp
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
#include <iomanip>
|
||||
#include <memory>
|
||||
|
||||
#include "version.h"
|
||||
#include "CompilerDriver_ipt.h"
|
||||
#include "PolicyCompiler_ipt.h"
|
||||
#include "NATCompiler_ipt.h"
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
project(juniper_lib)
|
||||
|
||||
set(juniper_lib_srcs
|
||||
CompilerDriver_junosacl.cpp
|
||||
CompilerDriver_junosacl_run.cpp
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
project(junosacl)
|
||||
|
||||
set(junosacl_srcs
|
||||
junosacl.cpp
|
||||
)
|
||||
|
@ -18,6 +16,8 @@ ENDIF()
|
|||
|
||||
target_compile_options(fwb_junosacl PRIVATE ${CXX_DEFAULT_FLAGS})
|
||||
|
||||
set_source_files_properties(junosacl.cpp PROPERTIES COMPILE_DEFINITIONS PREFIX=\"${CMAKE_INSTALL_PREFIX}\")
|
||||
|
||||
install(TARGETS fwb_junosacl RUNTIME DESTINATION ${FWB_INSTALL_BINDIR})
|
||||
|
||||
qt5_use_modules(fwb_junosacl Widgets)
|
||||
|
|
|
@ -45,6 +45,7 @@
|
|||
#include <assert.h>
|
||||
#include <cstring>
|
||||
|
||||
#include "version.h"
|
||||
#include "CompilerDriver_junosacl.h"
|
||||
|
||||
#include "fwbuilder/Resources.h"
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
project(etc)
|
||||
configure_file(fwbuilder.dtd.in fwbuilder.dtd)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/fwbuilder.dtd DESTINATION ${FWB_INSTALL_DATADIR})
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
project(migration)
|
||||
FILE(GLOB migration_files "${PROJECT_SOURCE_DIR}/*.xslt")
|
||||
FILE(GLOB migration_files "${CMAKE_CURRENT_SOURCE_DIR}/*.xslt")
|
||||
install(FILES ${migration_files} DESTINATION ${FWB_INSTALL_DATADIR}/migration)
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
project(libfwbuilder)
|
||||
|
||||
set(libfwbuilder_srcs
|
||||
InetAddr.cpp
|
||||
InetAddrMask.cpp
|
||||
|
@ -75,6 +73,16 @@ set(libfwbuilder_srcs
|
|||
inet_net_pton.c
|
||||
uint128.cpp)
|
||||
|
||||
if(APPLE)
|
||||
set(RES_DIR "../Resources")
|
||||
elseif(WIN32)
|
||||
set(RES_DIR "resources")
|
||||
else()
|
||||
set(RES_DIR "${CMAKE_INSTALL_PREFIX}/${FWB_INSTALL_DATADIR}")
|
||||
endif()
|
||||
|
||||
set_source_files_properties(Constants.cpp PROPERTIES COMPILE_DEFINITIONS RES_DIR=\"${RES_DIR}\")
|
||||
|
||||
add_library(fwbuilder STATIC ${libfwbuilder_srcs})
|
||||
|
||||
target_include_directories(fwbuilder PUBLIC
|
||||
|
|
|
@ -15,13 +15,14 @@
|
|||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
|
||||
To get a copy of the GNU General Public License, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#include "version.h"
|
||||
#include "fwbuilder/Constants.h"
|
||||
|
||||
#if defined (__linux__) || defined (__FreeBSD_kernel__) || defined (__MINGW64__) || defined (__MINGW32__) || defined (__APPLE__)
|
||||
|
@ -36,7 +37,7 @@ string Constants::res_dir;
|
|||
void Constants::init(const std::string &app_root_dir)
|
||||
{
|
||||
if (app_root_dir.empty()) res_dir = string(RES_DIR);
|
||||
else res_dir = app_root_dir + FS_SEPARATOR + string(RES_DIR);
|
||||
else res_dir = app_root_dir + "/" + string(RES_DIR);
|
||||
}
|
||||
|
||||
const string Constants::getLibraryDescription()
|
||||
|
@ -73,17 +74,17 @@ string Constants::getResourcesDirectory()
|
|||
|
||||
string Constants::getResourcesFilePath()
|
||||
{
|
||||
return getResourcesDirectory() + FS_SEPARATOR + "resources.xml";
|
||||
return getResourcesDirectory() + "/resources.xml";
|
||||
}
|
||||
|
||||
string Constants::getStandardObjectsFilePath()
|
||||
{
|
||||
return getResourcesDirectory() + FS_SEPARATOR + "objects_init.xml";
|
||||
return getResourcesDirectory() + "/objects_init.xml";
|
||||
}
|
||||
|
||||
string Constants::getTemplatesObjectsFilePath()
|
||||
{
|
||||
return getResourcesDirectory() + FS_SEPARATOR + "templates.xml";
|
||||
return getResourcesDirectory() + "/templates.xml";
|
||||
}
|
||||
|
||||
string Constants::getLocaleDirectory()
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
#include <cstring>
|
||||
#include <signal.h>
|
||||
|
||||
#include "version.h"
|
||||
#include "fwbuilder/FWObject.h"
|
||||
#include "fwbuilder/FWObjectDatabase.h"
|
||||
|
||||
|
|
|
@ -162,25 +162,25 @@ void Resources::loadSystemResources()
|
|||
string::size_type n=resfile.find_last_of("/\\");
|
||||
string resDir = resfile.substr(0,n);
|
||||
|
||||
list<string> pllist = getDirList( resDir + FS_SEPARATOR +PLATFORM_RES_DIR_NAME,
|
||||
list<string> pllist = getDirList( resDir + "/" +PLATFORM_RES_DIR_NAME,
|
||||
"xml" );
|
||||
|
||||
for (list<string>::iterator lsi1=pllist.begin(); lsi1!=pllist.end(); lsi1++)
|
||||
{
|
||||
string::size_type n=lsi1->find_last_of("/\\")+1;
|
||||
string platform=lsi1->substr(n, lsi1->rfind(".xml")-n);
|
||||
Resources *tr=new Resources(*lsi1);
|
||||
Resources *tr=new Resources(*lsi1);
|
||||
platform_res[platform]=tr;
|
||||
}
|
||||
|
||||
|
||||
list<string> oslist = getDirList( resDir + FS_SEPARATOR +OS_RES_DIR_NAME,
|
||||
list<string> oslist = getDirList( resDir + "/" +OS_RES_DIR_NAME,
|
||||
"xml" );
|
||||
for (list<string>::iterator lsi2=oslist.begin(); lsi2!=oslist.end(); lsi2++)
|
||||
{
|
||||
string::size_type n=lsi2->find_last_of("/\\")+1;
|
||||
string os=lsi2->substr(n, lsi2->rfind(".xml")-n);
|
||||
Resources *tr=new Resources(*lsi2);
|
||||
Resources *tr=new Resources(*lsi2);
|
||||
os_res[os]=tr;
|
||||
}
|
||||
|
||||
|
|
|
@ -139,7 +139,7 @@ list<string> getDirList(const std::string &dir,
|
|||
continue;
|
||||
|
||||
string pfile=de->d_name;
|
||||
string rfile=dir+FS_SEPARATOR+pfile;
|
||||
string rfile=dir+"/"+pfile;
|
||||
if (rfile.rfind(string(".")+ext)==rfile.size()-ext.size()-1)
|
||||
res.push_back(rfile);
|
||||
}
|
||||
|
@ -149,16 +149,16 @@ list<string> getDirList(const std::string &dir,
|
|||
|
||||
struct _finddata_t c_file;
|
||||
intptr_t hFile;
|
||||
string filepath=dir + FS_SEPARATOR + "*." + ext;
|
||||
string filepath=dir + "/*." + ext;
|
||||
/* Find first file in current directory */
|
||||
if( (hFile = _findfirst( filepath.c_str(), &c_file )) != -1L )
|
||||
{
|
||||
string rfile=dir+FS_SEPARATOR+c_file.name;
|
||||
string rfile=dir+"/"+c_file.name;
|
||||
res.push_back(rfile);
|
||||
/* Find the rest of the files */
|
||||
while( _findnext( hFile, &c_file ) == 0 )
|
||||
{
|
||||
string rfile=dir+FS_SEPARATOR+c_file.name;
|
||||
string rfile=dir+"/"+c_file.name;
|
||||
res.push_back(rfile);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
|
||||
|
||||
|
||||
#include "version.h"
|
||||
#include "fwbuilder/XMLTools.h"
|
||||
#include "fwbuilder/ThreadTools.h"
|
||||
|
||||
|
@ -115,6 +115,8 @@ static void xslt_error_handler(void *ctx, const char *msg, ...)
|
|||
*((string*)ctx)+=buf;
|
||||
}
|
||||
|
||||
const std::string XMLTools::defaultVersion = std::string(FWBUILDER_XML_VERSION);
|
||||
|
||||
xmlNodePtr XMLTools::getXmlChildNode(xmlNodePtr r,const char *child_name)
|
||||
{
|
||||
xmlNodePtr cur;
|
||||
|
@ -197,7 +199,7 @@ xmlParserInputPtr fwbExternalEntityLoader(const char *URL,
|
|||
|
||||
string fname;
|
||||
|
||||
fname=string(current_template_dir) + FS_SEPARATOR;
|
||||
fname=string(current_template_dir) + "/";
|
||||
|
||||
string url=URL;
|
||||
string::size_type pos=url.find_last_of("/\\");
|
||||
|
@ -778,7 +780,7 @@ xmlDocPtr XMLTools::convert(xmlDocPtr doc,
|
|||
|
||||
fname = template_dir;
|
||||
|
||||
fname = fname+FS_SEPARATOR+"migration"+FS_SEPARATOR+type_name+"_"+vers+".xslt";
|
||||
fname = fname+"/migration/"+type_name+"_"+vers+".xslt";
|
||||
|
||||
if (access(fname.c_str() , R_OK )!=0)
|
||||
{
|
||||
|
|
|
@ -52,7 +52,7 @@ namespace libfwbuilder
|
|||
class XMLTools
|
||||
{
|
||||
public:
|
||||
|
||||
static const std::string defaultVersion;
|
||||
static const char * FromXmlCast(xmlChar * c) { return reinterpret_cast<const char *>(c); }
|
||||
static const char * FromXmlCast(const xmlChar * c) { return reinterpret_cast<const char *>(c); }
|
||||
static xmlChar * ToXmlCast(char * c) { return reinterpret_cast<xmlChar *>(c); }
|
||||
|
@ -94,7 +94,7 @@ class XMLTools
|
|||
const std::string &dtd_file,
|
||||
const UpgradePredicate *upgrade,
|
||||
const std::string &template_dir,
|
||||
const std::string ¤t_version = std::string(FWBUILDER_XML_VERSION)
|
||||
const std::string ¤t_version = defaultVersion
|
||||
);
|
||||
|
||||
static void setDTD(xmlDocPtr doc,
|
||||
|
@ -197,7 +197,7 @@ class XMLTools
|
|||
const std::string &file_name,
|
||||
const std::string &type_name,
|
||||
const std::string &template_dir,
|
||||
const std::string ¤t_version = std::string(FWBUILDER_XML_VERSION)
|
||||
const std::string ¤t_version = defaultVersion
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
project(libfwcompiler)
|
||||
|
||||
set(libfwcompiler_srcs
|
||||
BaseCompiler.cpp
|
||||
Compiler.cpp
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
project(libgui)
|
||||
|
||||
set(libgui_srcs
|
||||
ProjectPanel.cpp
|
||||
ProjectPanel_events.cpp
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include "FWBTree.h"
|
||||
#include "CustomServiceDialog.h"
|
||||
#include "FWBSettings.h"
|
||||
#include "FWBSettings_config.h"
|
||||
#include "FWCmdChange.h"
|
||||
|
||||
#include "fwbuilder/Library.h"
|
||||
|
|
|
@ -17,13 +17,14 @@
|
|||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
|
||||
To get a copy of the GNU General Public License, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#include "version.h"
|
||||
#include "global.h"
|
||||
#include "FWBAboutDialog.h"
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "global.h"
|
||||
|
||||
#include "FWBSettings.h"
|
||||
#include "FWBSettings_config.h"
|
||||
#include "FWWindow.h"
|
||||
#include "ObjectManipulator.h"
|
||||
|
||||
|
@ -180,6 +181,11 @@ FWBSettings::~FWBSettings()
|
|||
#endif
|
||||
}
|
||||
|
||||
const QString FWBSettings::getApplicationNameForSettings()
|
||||
{
|
||||
return "FirewallBuilder" GENERATION;
|
||||
}
|
||||
|
||||
/**
|
||||
* to preserve behavior of the old versions of fwbuilder on Unix, the
|
||||
* default working dir is set to "." - current dir.
|
||||
|
|
|
@ -38,8 +38,6 @@
|
|||
|
||||
#include <set>
|
||||
|
||||
#define SETTINGS_PATH_PREFIX "/" GENERATION
|
||||
|
||||
#include <fwbuilder/FWObject.h>
|
||||
|
||||
|
||||
|
@ -74,10 +72,7 @@ class FWBSettings : public QSettings
|
|||
FWBSettings(bool testData = false);
|
||||
~FWBSettings();
|
||||
|
||||
static QString getApplicationNameForSettings()
|
||||
{
|
||||
return "FirewallBuilder" GENERATION;
|
||||
}
|
||||
static const QString getApplicationNameForSettings();
|
||||
|
||||
void init(bool force_first_time_run=false);
|
||||
void save();
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
#ifndef __FWBSETTINGS_CONFIG_H_
|
||||
#define __FWBSETTINGS_CONFIG_H_
|
||||
|
||||
#include "version.h"
|
||||
#define SETTINGS_PATH_PREFIX "/" GENERATION
|
||||
|
||||
#endif
|
||||
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
*/
|
||||
|
||||
#include "version.h"
|
||||
#include "global.h"
|
||||
#include "check_update_url.h"
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
|
||||
*/
|
||||
|
||||
#include "version.h"
|
||||
#include "global.h"
|
||||
#include "utils.h"
|
||||
#include "platforms.h"
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include "FWObjectDropArea.h"
|
||||
#include "FWBTree.h"
|
||||
#include "FWBSettings.h"
|
||||
#include "FWBSettings_config.h"
|
||||
#include "ObjectTreeView.h"
|
||||
#include "RuleSetView.h"
|
||||
#include "ObjectEditor.h"
|
||||
|
|
|
@ -30,9 +30,6 @@
|
|||
#include "FWBApplication.h"
|
||||
#include "RCS.h"
|
||||
|
||||
// need this for FS_SEPARATOR
|
||||
#include "fwbuilder/Tools.h"
|
||||
|
||||
//#include "FWWindow.h"
|
||||
|
||||
#include <qdir.h>
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
|
||||
*/
|
||||
|
||||
#include "version.h"
|
||||
#include "global.h"
|
||||
#include "utils.h"
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
*/
|
||||
|
||||
|
||||
|
||||
#include "version.h"
|
||||
#include "global.h"
|
||||
#include "utils.h"
|
||||
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
#include "instDialog.h"
|
||||
#include "FirewallInstaller.h"
|
||||
#include "FWBSettings.h"
|
||||
#include "FWBSettings_config.h"
|
||||
#include "FWWindow.h"
|
||||
#include "InstallFirewallViewItem.h"
|
||||
#include "instOptionsDialog.h"
|
||||
|
|
|
@ -123,6 +123,6 @@ string strip(const string &s)
|
|||
|
||||
string getPathToBinary(const string &pgm_name)
|
||||
{
|
||||
return appRootDir + FS_SEPARATOR + pgm_name;
|
||||
return appRootDir + "/" + pgm_name;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
project(nxosacl)
|
||||
|
||||
set(nxosacl_srcs
|
||||
nxosacl.cpp
|
||||
)
|
||||
|
@ -18,6 +16,8 @@ ENDIF()
|
|||
|
||||
target_compile_options(fwb_nxosacl PRIVATE ${CXX_DEFAULT_FLAGS})
|
||||
|
||||
set_source_files_properties(nxosacl.cpp PROPERTIES COMPILE_DEFINITIONS PREFIX=\"${CMAKE_INSTALL_PREFIX}\")
|
||||
|
||||
install(TARGETS fwb_nxosacl RUNTIME DESTINATION ${FWB_INSTALL_BINDIR})
|
||||
|
||||
qt5_use_modules(fwb_nxosacl Widgets)
|
||||
|
|
|
@ -45,6 +45,7 @@
|
|||
#include <assert.h>
|
||||
#include <cstring>
|
||||
|
||||
#include "version.h"
|
||||
#include "CompilerDriver_nxosacl.h"
|
||||
|
||||
#include "fwbuilder/Resources.h"
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
project(parsers)
|
||||
|
||||
set(parsers_srcs
|
||||
IOSCfgLexer.cpp
|
||||
IOSCfgParser.cpp
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
project(pf)
|
||||
|
||||
set(pf_srcs
|
||||
pf.cpp)
|
||||
|
||||
|
@ -17,6 +15,8 @@ ENDIF()
|
|||
|
||||
target_compile_options(fwb_pf PRIVATE ${CXX_DEFAULT_FLAGS})
|
||||
|
||||
set_source_files_properties(pf.cpp PROPERTIES COMPILE_DEFINITIONS PREFIX=\"${CMAKE_INSTALL_PREFIX}\")
|
||||
|
||||
install(TARGETS fwb_pf RUNTIME DESTINATION ${FWB_INSTALL_BINDIR})
|
||||
|
||||
qt5_use_modules(fwb_pf Widgets)
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include <stdexcept>
|
||||
#include <utility>
|
||||
|
||||
#include "version.h"
|
||||
#include "CompilerDriver_pf.h"
|
||||
|
||||
#include "fwbuilder/Resources.h"
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
project(pflib)
|
||||
|
||||
set(pflib_srcs
|
||||
AutomaticRules_pf.cpp
|
||||
CompilerDriver_ipf.cpp
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
project(pix)
|
||||
|
||||
set(pix_srcs
|
||||
pix.cpp)
|
||||
|
||||
|
@ -17,6 +15,8 @@ ENDIF()
|
|||
|
||||
target_compile_options(fwb_pix PRIVATE ${CXX_DEFAULT_FLAGS})
|
||||
|
||||
set_source_files_properties(pix.cpp PROPERTIES COMPILE_DEFINITIONS PREFIX=\"${CMAKE_INSTALL_PREFIX}\")
|
||||
|
||||
install(TARGETS fwb_pix RUNTIME DESTINATION ${FWB_INSTALL_BINDIR})
|
||||
|
||||
qt5_use_modules(fwb_pix Widgets)
|
||||
|
|
|
@ -45,6 +45,7 @@
|
|||
#include <assert.h>
|
||||
#include <cstring>
|
||||
|
||||
#include "version.h"
|
||||
#include "CompilerDriver_pix.h"
|
||||
|
||||
#include "fwbuilder/Resources.h"
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
project(procurve_acl)
|
||||
|
||||
set(procurve_acl_srcs
|
||||
procurve_acl.cpp
|
||||
)
|
||||
|
@ -18,6 +16,8 @@ ENDIF()
|
|||
|
||||
target_compile_options(fwb_procurve_acl PRIVATE ${CXX_DEFAULT_FLAGS})
|
||||
|
||||
set_source_files_properties(procurve_acl.cpp PROPERTIES COMPILE_DEFINITIONS PREFIX=\"${CMAKE_INSTALL_PREFIX}\")
|
||||
|
||||
install(TARGETS fwb_procurve_acl RUNTIME DESTINATION ${FWB_INSTALL_BINDIR})
|
||||
|
||||
qt5_use_modules(fwb_procurve_acl Widgets)
|
||||
|
|
|
@ -45,6 +45,7 @@
|
|||
#include <assert.h>
|
||||
#include <cstring>
|
||||
|
||||
#include "version.h"
|
||||
#include "CompilerDriver_procurve_acl.h"
|
||||
|
||||
#include "fwbuilder/Resources.h"
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
project(res)
|
||||
configure_file(objects_init.xml.in objects_init.xml)
|
||||
configure_file(templates.xml.in templates.xml)
|
||||
FILE(GLOB os_files "${PROJECT_SOURCE_DIR}/os/*.xml")
|
||||
FILE(GLOB platform_files "${PROJECT_SOURCE_DIR}/platform/*.xml")
|
||||
FILE(GLOB help_files "${PROJECT_SOURCE_DIR}/help/en_US/*.html" "${PROJECT_SOURCE_DIR}/help/en_US/*.png" "${PROJECT_SOURCE_DIR}/help/en_US/*.jpg")
|
||||
FILE(GLOB os_files "${CMAKE_CURRENT_SOURCE_DIR}/os/*.xml")
|
||||
FILE(GLOB platform_files "${CMAKE_CURRENT_SOURCE_DIR}/platform/*.xml")
|
||||
FILE(GLOB help_files "${CMAKE_CURRENT_SOURCE_DIR}/help/en_US/*.html" "${CMAKE_CURRENT_SOURCE_DIR}/help/en_US/*.png" "${CMAKE_CURRENT_SOURCE_DIR}/help/en_US/*.jpg")
|
||||
|
||||
install(FILES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/objects_init.xml
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
#ifndef FWBUILDER_VERSION_H
|
||||
#define FWBUILDER_VERSION_H
|
||||
|
||||
#define GENERATION "@PROJECT_GENERATION@"
|
||||
#define GENERATION_SHORT "@PROJECT_GENERATION_SHORT@"
|
||||
#define VERSION "@PROJECT_VERSION@"
|
||||
#define FWBUILDER_XML_VERSION "@FWBUILDER_XML_VERSION@"
|
||||
|
||||
#endif // FWBUILDER_VERSION_H
|
Loading…
Reference in New Issue