Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
cb86803
abuse catkin extras a bit to allow downstream packages to find MakePa…
mallanmba Aug 31, 2015
2ea803d
abuse catkin extras a bit to allow downstream packages to find MakePa…
mallanmba Aug 31, 2015
92fd5dc
remove library targets from extras
mallan Sep 1, 2015
6ec54af
modify CMakeLists.txt to account for differences between catkin_make …
mallanmba Sep 15, 2015
de5bbfb
merge
mallanmba Sep 15, 2015
9ce68fa
add directive to help isolated builds
mallanmba Feb 7, 2017
4658b37
Merge branch 'master' into catkin_build
mallanmba May 9, 2017
849e6ae
Fix build for 16.04
Mar 2, 2018
d8d46e4
Improve backward compatibility of Qt5 build
Mar 5, 2018
5610f8a
Don't compile utils with Qt5 for now
Mar 15, 2018
dc484fa
Fix build switch syntax for utils switch
Mar 15, 2018
9f0f68e
Third time a charme
Mar 15, 2018
abf0a76
cleanup
Mar 15, 2018
ff87dda
Revert include renaming for now
Mar 15, 2018
1c5a2f0
Merge pull request #4 from hhutz/ubuntu_16_4
hhutz Mar 15, 2018
83f0d17
LogPlayer needs QT_QT3SUPPORT_INCLUDE_DIR
mallanmba May 1, 2018
1e7272c
Merge pull request #5 from mallanmba/catkin_build
mallanmba May 1, 2018
542db80
Make MIRO_BUILD_WITH_QT? variables available for downstream cmake con…
mallanmba Aug 3, 2018
7781f4f
Build ConfigEditor under Qt5
Sep 20, 2018
d572060
Fix typo
Sep 20, 2018
7035f6d
Update source to Qt5 method names
Sep 20, 2018
1b160b9
Fix deprecated warning
Sep 20, 2018
7c788fc
Fixes for Qt4 compatibility
Sep 20, 2018
54a7a8b
Fix Qt library linking for Qt4 vs Qt5
Sep 21, 2018
0f2deed
Merge pull request #6 from hhutz/qt_config_editor
hhutz Oct 22, 2018
d4e812f
Simplify Singleton parameters
Nov 8, 2018
a9a08f0
Solve 18.04 compile issue in less intrusive way
Nov 29, 2018
35cc40e
Fix static template member instantiation code
May 15, 2019
faba082
Add macro indirection for 14.04 compatibility
May 16, 2019
6067b58
Fix 14.04 instanciation macro
May 16, 2019
9f68c19
Add miro/Singleton for user singleton
May 16, 2019
2deae39
Merge pull request #7 from hhutz/singleton-instance-issue-17
hhutz May 17, 2019
1523eab
Newer CMake doesn't allow multiple else statements. Fixed with elseif.
impala454 Aug 13, 2019
1e84427
Merge pull request #8 from impala454/catkin_build
hhutz Aug 13, 2019
12394e7
Removed dynamic exception specifications in compliance with C++11
Mar 10, 2020
3c84a82
Merge pull request #9 from jgyorfi/dynamic_exceptions_deprecated_in_c…
hhutz Mar 12, 2020
2d43c4e
Removed dynamic exception specifications in compliance with C++11
Mar 12, 2020
cb5911b
Removed dynamic exception specifications in compliance with C++11
Mar 12, 2020
eabcf33
Merge pull request #10 from jgyorfi/dynamic_exceptions_deprecated_in_…
mallanmba Mar 16, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
150 changes: 105 additions & 45 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,40 +1,58 @@
cmake_minimum_required(VERSION 2.8.3)
project(Miro)

if (${CATKIN_TOPLEVEL})
###################################
## catkin ##
###################################
if (CATKIN_DEVEL_PREFIX)
find_package(catkin REQUIRED COMPONENTS
irg_cmake
qt_gui_cpp
)
endif(${CATKIN_TOPLEVEL})

if (catkin_FOUND)
###################################
## catkin specific configuration ##
###################################
catkin_package(
INCLUDE_DIRS src
LIBRARIES miroCore miroBase miroParams miroXml
)
else (catkin_FOUND)
## set up some defaults
set( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules ${CMAKE_MODULE_PATH})

include( SetArchitecture )
include( SetupBuildSwitch )
include( SetupConfigureFile )
include( SetupInstall )
include( SetupRPATH )
include( SetupUtilities )
include( UserOptions )
include( SetupWarnLevel )
endif(catkin_FOUND)
endif(CATKIN_DEVEL_PREFIX)

if(NOT catkin_FOUND)
## set up some defaults
set( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules ${CMAKE_MODULE_PATH})

include( SetArchitecture )
include( SetupBuildSwitch )
include( SetupConfigureFile )
include( SetupInstall )
include( SetupRPATH )
include( SetupUtilities )
include( UserOptions )
include( SetupWarnLevel )
endif(NOT catkin_FOUND)

add_build_var( WITH_TAO BUILD_DEFAULT_TRUE )
add_build_var( WITH_JSON BUILD_DEFAULT_TRUE )

find_package( ACE )
find_package( Qt4 )
if("${qt_gui_cpp_USE_QT_MAJOR_VERSION} " STREQUAL "5 ")
message(STATUS "FOUND QT 5")
find_package(Qt5Widgets REQUIRED)
find_package(Qt5Xml REQUIRED)
if (Qt5_POSITION_INDEPENDENT_CODE)
SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()
include_directories(SYSTEM "${Qt5Widgets_INCLUDE_DIRS}")
include_directories(SYSTEM "${Qt5Xml_INCLUDE_DIRS}")
set(QT_QTXML_LIBRARY Qt5::Xml)
set(QT_QTCORE_LIBRARY Qt5::Widgets)
add_build_var( WITH_QT4 BUILD_DEFAULT_FALSE )
add_build_var( WITH_QT5 BUILD_DEFAULT_TRUE )
else()
message(STATUS "FOUND QT 4")
find_package(Qt4 COMPONENTS QtCore QtGui REQUIRED)
include(${QT_USE_FILE})
include_directories(SYSTEM "${QT_INCLUDE_DIR}")
include_directories(SYSTEM "${QT_QTXML_INCLUDE_DIR}")
include_directories(SYSTEM "${QT_QTCORE_INCLUDE_DIR}")
add_build_var( WITH_QT4 BUILD_DEFAULT_TRUE )
add_build_var( WITH_QT5 BUILD_DEFAULT_FALSE )
endif()

find_package( ACE )
find_package_if( TAO MIRO_BUILD_WITH_TAO )
find_package_if( JsonCpp MIRO_BUILD_WITH_JSON )

Expand All @@ -44,7 +62,33 @@ build_with_var( WITH_JSON JSONCPP_FOUND )
## if we don't have the following components,
## we cannot continue
##-----------------------------------------------
minimum_requirements( ACE_FOUND QT4_FOUND QT_QT3SUPPORT_FOUND )
minimum_requirements( ACE_FOUND )

if (catkin_FOUND)
###################################
## catkin specific configuration ##
###################################
set(MIRO_CATKIN_DEPENDS ACE )
if(MIRO_BUILD_WITH_TAO)
set(MIRO_CATKIN_DEPENDS ${MIRO_CATKIN_DEPENDS} TAO)
endif(MIRO_BUILD_WITH_TAO)
if(MIRO_BUILD_WITH_JSON)
set(MIRO_CATKIN_DEPENDS ${MIRO_CATKIN_DEPENDS} JSONCPP)
endif(MIRO_BUILD_WITH_JSON)

catkin_package(
INCLUDE_DIRS src
LIBRARIES miroCore miroBase miroParams miroXml
CFG_EXTRAS Miro-extras.cmake
DEPENDS ${MIRO_CATKIN_DEPENDS}
)
## set variable with full path of extras file so we can append library info
set_cfg_extras_file()

# add devel/include - this should add to persistent catkin metadata
list(APPEND ${PROJECT_NAME}_INCLUDE_DIRS ${CATKIN_DEVEL_PREFIX}/include)

endif(catkin_FOUND)

set( MIRO_SOVERSION_MAJOR 3 ) # epoch
set( MIRO_SOVERSION_MINOR 2 ) # revision
Expand All @@ -57,20 +101,19 @@ set( MIRO_SOVERSION "${MIRO_SOVERSION_MAJOR}.${MIRO_SOVERSION_MINOR}.${M
include( GenerateMiroMakeParams )
# we need to tell the macro where to find the executable
# because it isn't "installed" yet...
if (${CATKIN_TOPLEVEL})
if (CATKIN_DEVEL_PREFIX)
set( MIRO_MAKEPARAMS_EXECUTABLE ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_BIN_DESTINATION}/MakeParams )
else (${CATKIN_TOPLEVEL})
else (CATKIN_DEVEL_PREFIX)
set( MIRO_MAKEPARAMS_EXECUTABLE ${PROJECT_BINARY_DIR}/src/makeParams/${CMAKE_CFG_INTDIR}/MakeParams )
endif (${CATKIN_TOPLEVEL})
endif (CATKIN_DEVEL_PREFIX)


## add in and out of source dirs to include path
##-----------------------------------------------
include_directories(
${PROJECT_SOURCE_DIR}
${PROJECT_SOURCE_DIR}/src
${PROJECT_BINARY_DIR}
${PROJECT_BINARY_DIR}/src
${CATKIN_DEVEL_PREFIX}/include
)

## Set up RPATH and *Config.h
Expand All @@ -88,20 +131,10 @@ include_directories(
${TAO_INCLUDE_DIRS}
)

# everything needs to link to Qt, so set it
# up at the top level for convinience
##-----------------------------------------------
include_directories(
${QT_INCLUDE_DIR}
${QT_QT_INCLUDE_DIR}
${QT_QTXML_INCLUDE_DIR}
${QT_QTCORE_INCLUDE_DIR}
)

# always build these
#----------------------
add_subdirectory( src )
add_build_switch( utils BUILD_DEFAULT_TRUE )
add_subdirectory( utils )
add_build_switch( examples BUILD_DEFAULT_TRUE )
add_build_switch( tests BUILD_DEFAULT_TRUE )

Expand All @@ -111,11 +144,38 @@ install_export()

# package script
#------------------------------------
if (NOT ${CATKIN_TOPLEVEL})
if (NOT CATKIN_DEVEL_PREFIX)
include( CMakePack.txt )
endif (NOT ${CATKIN_TOPLEVEL})
endif (NOT CATKIN_DEVEL_PREFIX)

#------------------------------------
print_build_switches()

message(STATUS "Miro version is ${MIRO_SOVERSION}")

###############################################
## We deviate from the standard usage of catkin's CFG_EXTRAS because
## that must run before targets are added, but we want this to run
## after targets are added (so we have a list of exported libraries
## that is consistent with the build switches).
## I"M PRETTY SURE THIS WILL BREAK WHEN BUILDING INSTALLSPACE
## installation will be tricky. For now, we just acknowledge its
## probably broken and carry on...
if( Miro_CFG_EXTRAS_FILE )
# copy the develspace extras to the one that will go into installspace
execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${Miro_CFG_EXTRAS_FILE} ${Miro_CFG_EXTRAS_FILE}-install)

file( APPEND ${Miro_CFG_EXTRAS_FILE} "\n#-- Executables -----\n" )
file( APPEND ${Miro_CFG_EXTRAS_FILE} "set( MIRO_MAKEPARAMS_EXECUTABLE ${MIRO_MAKEPARAMS_EXECUTABLE} )\n" )

# install file
## there is not a consistent ordering of installation if install is called
## at this level. Therefore, we create a cmake/postinstall subdirectory and make the
## call there. The last subdirectory added will have its install commands exectued last.
file( APPEND ${Miro_CFG_EXTRAS_FILE}-install "\n#-- Executables -----\n" )
file( APPEND ${Miro_CFG_EXTRAS_FILE}-install "set( MIRO_MAKEPARAMS_EXECUTABLE ${CMAKE_INSTALL_PREFIX}/bin/MakeParams )\n" )
add_subdirectory( cmake/postinstall )

endif( Miro_CFG_EXTRAS_FILE )
###############################################

12 changes: 12 additions & 0 deletions cmake/Miro-extras.cmake.develspace.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# source: Miro-extras.cmake.develspace.in

include( GenerateMiroMakeParams )

## we have to add devel/include to catkin_INCLUDE_DIRS
## so generated MakeParams include files can be seen
set( MIRO_INCLUDE_DIR @CATKIN_DEVEL_PREFIX@/include )

set( catkin_INCLUDE_DIRS ${catkin_INCLUDE_DIRS} ${MIRO_INCLUDE_DIR} )

set( MIRO_BUILD_WITH_QT4 @MIRO_BUILD_WITH_QT4@ )
set( MIRO_BUILD_WITH_QT5 @MIRO_BUILD_WITH_QT5@ )
11 changes: 11 additions & 0 deletions cmake/Miro-extras.cmake.installspace.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
##
## Miro-extras.cmake.installspace.in
##
## NOTE: This file is not used - it is here to trick catkin into thinking it
## should install a Miro-extras.cmake file. What we actually install is
## a modified Miro-extras.cmake.develspace.in which has the install
## destination for MIRO_MAKEPARAMS_EXECUTABLE.
## Prior to installing, the file is stored in develspace as
## devel/share/Miro/cmake/Miro-extras.cmake-install
##

4 changes: 2 additions & 2 deletions cmake/Modules/FindACE.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ if( ACE_ROOT_DIR )
# FIXME - do a proper header search
if( EXISTS ${ACE_ROOT_DIR}/ace/ACE.h )
set( ACE_INCLUDE_DIR ${ACE_ROOT_DIR} CACHE PATH "ACE include path" )
else( EXISTS ${ACE_ROOT_DIR}/ace/ACE.h )
elseif( EXISTS ${ACE_ROOT_DIR}/ace/ACE.h )
set( ACE_INCLUDE_DIR ${ACE_ROOT_DIR}/include CACHE PATH "ACE include path" )
else( EXISTS ${ACE_ROOT_DIR}/include/ace/ACE.h )
elseif( EXISTS ${ACE_ROOT_DIR}/include/ace/ACE.h )
set( ACE_INCLUDE_DIR ${ACE_ROOT_DIR}/include CACHE PATH "ACE include path" )
endif( EXISTS ${ACE_ROOT_DIR}/ace/ACE.h )

Expand Down
2 changes: 2 additions & 0 deletions cmake/postinstall/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
install( CODE "message( STATUS \"#### Do the install of Miro_CFG_EXTRAS_FILE in postinstall to make sure it's the last thing executed\") ####" )
install( FILES ${Miro_CFG_EXTRAS_FILE}-install DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/cmake RENAME ${PROJECT_NAME}-extras.cmake )
6 changes: 3 additions & 3 deletions examples/params/convertParams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ SimpleSurveyParameters readJson(const string& jsonName)
Json::Reader reader;
bool success = reader.parse(jsonStream, root);
if (!success) {
cerr << reader.getFormatedErrorMessages() << endl;
cerr << reader.getFormattedErrorMessages() << endl;
exit(1);
}
jsonStream.close();
Expand Down Expand Up @@ -88,7 +88,7 @@ SimpleSurveyParameters readXml(const string& xmlName)
QFile xmlFile(xmlName.c_str());
if (!xmlFile.open(QIODevice::ReadOnly)) {
cerr << "couldn't open " << xmlName << " for reading: "
<< ((const char*) xmlFile.errorString().toAscii()) << endl;
<< ((const char*) xmlFile.errorString().toLatin1()) << endl;
exit(1);
}

Expand Down Expand Up @@ -116,7 +116,7 @@ void writeXml(const string& xmlName, const SimpleSurveyParameters& params)
QFile xmlFile(xmlName.c_str());
if (!xmlFile.open(QIODevice::WriteOnly)) {
cerr << "couldn't open " << xmlName << " for writing: "
<< ((const char*) xmlFile.errorString().toAscii()) << endl;
<< ((const char*) xmlFile.errorString().toLatin1()) << endl;
exit(1);
}
QTextStream ts(&xmlFile);
Expand Down
6 changes: 4 additions & 2 deletions src/makeParams/MakeParams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
#include "params/Generator.h"
#include "params/TextErrorHandler.h"

#include <qstring.h>
#include <QApplication>

#include <QString>
#include <qfile.h>
#include <qxml.h>

Expand Down Expand Up @@ -152,7 +154,7 @@ main(int argc, char * argv[])
QString headerFilename(baseName + "." + headerExtension);
ofstream headerFile(qPrintable(headerFilename));

generator.generateSource(sourceFile);
generator.generateSource(sourceFile, exportDirective);
generator.generateHeader(headerFile, exportDirective);
}
else {
Expand Down
4 changes: 2 additions & 2 deletions src/miro/ConfigDocument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ namespace Miro
delete document_;
}

void ConfigDocument::init(QDomDocument * _document) throw(Exception)
void ConfigDocument::init(QDomDocument * _document) //throw(Exception)
{
delete document_;
document_ = _document;
}

void ConfigDocument::init(std::string const& _fileName,
SearchPaths const& _paths)
throw(Exception)
//throw(Exception)
{
delete document_;
document_ = NULL;
Expand Down
6 changes: 3 additions & 3 deletions src/miro/ConfigDocument.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ namespace Miro
~ConfigDocument();

void init(std::string const& _defaultName = std::string(""),
SearchPaths const& _paths = SearchPaths())
throw(Exception);
void init(QDomDocument * _document) throw(Exception);
SearchPaths const& _paths = SearchPaths());
//throw(Exception);
void init(QDomDocument * _document);// throw(Exception);

void fini();

Expand Down
4 changes: 3 additions & 1 deletion src/miro/Configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespace Miro
{
Singleton<ConfigDocument> Configuration::document;

void Configuration::init(int& argc, char * argv[], const std::string& etcPath) throw(Exception)
void Configuration::init(int& argc, char * argv[], const std::string& etcPath) //throw(Exception)
{
if (initialized)
return;
Expand Down Expand Up @@ -99,3 +99,5 @@ namespace Miro
initialized = true;
}
}

MIRO_SINGLETON_TEMPLATE_INSTANTIATE(ACE_Singleton, Miro::ConfigDocument, ACE_SYNCH_RECURSIVE_MUTEX);
2 changes: 1 addition & 1 deletion src/miro/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace Miro
* Loading the document from default location if not overridden
* by command line parameter -MiroConfigFile (-MCF).
*/
static void init(int& argc, char * argv[], const std::string& etcPath = "") throw(Exception);
static void init(int& argc, char * argv[], const std::string& etcPath = "");// throw(Exception);
//! Singleton accesor for the robots configuation document.
static Singleton<ConfigDocument> document;
};
Expand Down
10 changes: 5 additions & 5 deletions src/miro/Enumeration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace Miro
{
using namespace std;

Enumeration::Enumeration(string const& _enum, string const& _values) throw(EInvalid, EDuplicates)
Enumeration::Enumeration(string const& _enum, string const& _values) //throw(EInvalid, EDuplicates)
{
// tokenize input values
int pos = 0;
Expand All @@ -46,15 +46,15 @@ namespace Miro
}


Enumeration::Enumeration(string const& _enum, vector<string> const& _values) throw(EInvalid, EDuplicates) :
values_(_values)
Enumeration::Enumeration(string const& _enum, vector<string> const& _values) //throw(EInvalid, EDuplicates)
: values_(_values)
{
makeSet();
value(_enum);
}

void
Enumeration::value(string const& _value) throw(EInvalid, EDuplicates)
Enumeration::value(string const& _value) //throw(EInvalid, EDuplicates)
{
StringVector::const_iterator i;

Expand All @@ -66,7 +66,7 @@ namespace Miro
}

void
Enumeration::makeSet() throw(EDuplicates)
Enumeration::makeSet() //throw(EDuplicates)
{
sort(values_.begin(), values_.end());
StringVector::iterator i = unique(values_.begin(), values_.end());
Expand Down
Loading