Commit 60ca3f47 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum

[CLEAN] - removed several useles msvc directives.

parent 06541930
......@@ -49,10 +49,8 @@ INCLUDE( BuildUtils )
INCLUDE( BuildModuleUtils )
# CMAKE automatism to select static vs. shared building:
IF( NOT CMAKE_GENERATOR MATCHES "Visual Studio" )
OPTION( BUILD_SHARED_LIBS "Build shared libs" ON )
MARK_AS_ADVANCED( BUILD_SHARED_LIBS )
ENDIF()
OPTION( BUILD_SHARED_LIBS "Build shared libs" ON )
MARK_AS_ADVANCED( BUILD_SHARED_LIBS )
# The build types
IF( NOT CMAKE_BUILD_TYPE )
......@@ -112,30 +110,21 @@ SET( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${OW_ARCHIVE_DIR} )
# -Wno-long-long since on Ubuntu 8.10 it won't compile without it
# -ansi force ISO-C++98 compliance (not GNU++98)
IF( CMAKE_GENERATOR MATCHES "Visual Studio" )
FILE( GLOB EXCLUDE_LIBRARIES RELATIVE ${Boost_LIBRARY_DIRS} ${Boost_LIBRARY_DIRS}/libboost* )
SET( CMAKE_SHARED_LINKER_FLAGS " /STACK:10000000 /machine:I386 /NODEFAULTLIB:${EXCLUDE_LIBRARIES}" CACHE STRING "" FORCE )
SET( CMAKE_EXE_LINKER_FLAGS " /STACK:10000000 /machine:I386 /NODEFAULTLIB:${EXCLUDE_LIBRARIES}" CACHE STRING "" FORCE )
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D \"NOMINMAX\"" )
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP /wd4101" )
SET( CMAKE_DEBUG_POSTFIX "d" CACHE STRING "add a postfix, usually d on windows" )
# Unfortunately libstdc++'s header files don't work with mingw in ansi mode (basically libstdc++'s fault)
IF( CMAKE_HOST_SYSTEM MATCHES "Windows" )
SET( CMAKE_CXX_FLAGS "-frtti -pedantic -Wall -Wno-long-long -Wextra " CACHE STRING "" FORCE )
ELSE()
# Unfortunately libstdc++'s header files don't work with mingw in ansi mode (basically libstdc++'s fault)
IF( CMAKE_HOST_SYSTEM MATCHES "Windows" )
SET( CMAKE_CXX_FLAGS "-frtti -pedantic -Wall -Wno-long-long -Wextra " CACHE STRING "" FORCE )
ELSE()
SET( CMAKE_CXX_FLAGS "-frtti -pedantic -ansi -Wall -Wno-long-long -Wextra " CACHE STRING "" FORCE )
ENDIF()
# Darwin's ld isn't GNU and doesn't like the following
IF( NOT CMAKE_SYSTEM_NAME MATCHES "Darwin" )
## The following allows us to prevent cyclic dependencies even on linux
SET( CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined -Wl,--allow-shlib-undefined,--as-needed" CACHE STRING "" FORCE )
SET( CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed" CACHE STRING "" FORCE )
ENDIF()
SET( CMAKE_CXX_FLAGS_RELEASE "-O3" CACHE STRING "" FORCE )
SET( CMAKE_CXX_FLAGS_DEBUG "-g -DDEBUG -O0" CACHE STRING "" FORCE )
SET( CMAKE_CXX_FLAGS "-frtti -pedantic -ansi -Wall -Wno-long-long -Wextra " CACHE STRING "" FORCE )
ENDIF()
# Darwin's ld isn't GNU and doesn't like the following
IF( NOT CMAKE_SYSTEM_NAME MATCHES "Darwin" )
## The following allows us to prevent cyclic dependencies even on linux
SET( CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined -Wl,--allow-shlib-undefined,--as-needed" CACHE STRING "" FORCE )
SET( CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed" CACHE STRING "" FORCE )
ENDIF()
SET( CMAKE_CXX_FLAGS_RELEASE "-O3" CACHE STRING "" FORCE )
SET( CMAKE_CXX_FLAGS_DEBUG "-g -DDEBUG -O0" CACHE STRING "" FORCE )
SET( CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g -DDEBUG -O2" CACHE STRING "" FORCE )
# -----------------------------------------------------------------------------------------------------------------------------------------------
......@@ -208,10 +197,6 @@ SET( OW_SOVERSION ${OW_VERSION_MAJOR} )
# Setup boost options
SET( Boost_USE_MULTITHREAD ON )
# As every time: do something Visual Studio specific: only use static boost libs
IF( CMAKE_GENERATOR MATCHES "Visual Studio" )
SET( Boost_USE_STATIC_LIBS ON )
ENDIF()
# find the boost packages
FIND_PACKAGE( Boost 1.39.0 REQUIRED program_options thread filesystem date_time system signals regex )
......@@ -237,11 +222,6 @@ INCLUDE_DIRECTORIES( ${OPENGL_INCLUDE_DIR} )
# find the needed packages
SET( MIN_OSG_VERSION 2.8.0 )
IF( CMAKE_GENERATOR MATCHES "Visual Studio" )
IF( NOT VERSION LESS 2.6.3 )
SET ( CMAKE_PREFIX_PATH "$ENV{ProgramFiles}/OpenSceneGraph" )
ENDIF()
ENDIF()
FIND_PACKAGE( OpenSceneGraph ${MIN_OSG_VERSION} REQUIRED osgDB osgUtil osgGA osgViewer osgSim osgWidget osgText )
IF( OPENSCENEGRAPH_FOUND )
INCLUDE_DIRECTORIES( ${OPENSCENEGRAPH_INCLUDE_DIRS} )
......@@ -328,17 +308,15 @@ ENDIF()
# TODO(ebaum): use try_run for this
# Determines the number of cores available on this machine
IF( NOT CMAKE_GENERATOR MATCHES "Visual Studio" )
SET( NUM_CORES_SOURCE_DIR ${OW_TOOLS_DIR}/cmake/numCores )
SET( NUM_CORES_BINARY_DIR ${PROJECT_BINARY_DIR}/numCores )
SET( NUM_CORES_BINARY ${NUM_CORES_BINARY_DIR}/numCores )
ADD_CUSTOM_TARGET( numCores
COMMAND ${CMAKE_COMMAND} -E make_directory ${NUM_CORES_BINARY_DIR}
COMMAND cd ${NUM_CORES_BINARY_DIR} && ${CMAKE_COMMAND} ${NUM_CORES_SOURCE_DIR} > /dev/null
COMMAND $(MAKE) -C ${NUM_CORES_BINARY_DIR} > /dev/null
COMMENT "Determines the number of cores available on this machine"
)
ENDIF()
SET( NUM_CORES_SOURCE_DIR ${OW_TOOLS_DIR}/cmake/numCores )
SET( NUM_CORES_BINARY_DIR ${PROJECT_BINARY_DIR}/numCores )
SET( NUM_CORES_BINARY ${NUM_CORES_BINARY_DIR}/numCores )
ADD_CUSTOM_TARGET( numCores
COMMAND ${CMAKE_COMMAND} -E make_directory ${NUM_CORES_BINARY_DIR}
COMMAND cd ${NUM_CORES_BINARY_DIR} && ${CMAKE_COMMAND} ${NUM_CORES_SOURCE_DIR} > /dev/null
COMMAND $(MAKE) -C ${NUM_CORES_BINARY_DIR} > /dev/null
COMMENT "Determines the number of cores available on this machine"
)
# ---------------------------------------------------------------------------------------------------------------------------------------------------
#
......
......@@ -30,14 +30,10 @@ SET( LibName ${OWCoreName} )
# Set the prefix and suffix of dynamically loadable modules to match
# CMAKEs naming of them. The quotes are necessary so the shell doesn't mess
# with these defines. Unfortunately, the Visual Studio has problems handling
# the quotes on the command line. WSharedLib::getSystemPrefix and
# with these defines. WSharedLib::getSystemPrefix and
# getSystemSuffix hard codes the right strings for VC.
# Maybe you have to spend another 500 bucks to have your VC support quotes.
IF( NOT CMAKE_GENERATOR MATCHES "Visual Studio" )
ADD_DEFINITIONS( '-DW_LIB_PREFIX="${CMAKE_SHARED_LIBRARY_PREFIX}"' )
ADD_DEFINITIONS( '-DW_LIB_SUFFIX="${CMAKE_SHARED_LIBRARY_SUFFIX}"' )
ENDIF()
ADD_DEFINITIONS( '-DW_LIB_PREFIX="${CMAKE_SHARED_LIBRARY_PREFIX}"' )
ADD_DEFINITIONS( '-DW_LIB_SUFFIX="${CMAKE_SHARED_LIBRARY_SUFFIX}"' )
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# Add sources as target
......
......@@ -28,7 +28,7 @@
#include <string>
#include "WException.h"
#include "WExportCommon.h"
/**
* Implements assertion logic.
......@@ -41,7 +41,7 @@
* \param line The line in the file.
* \param msg An optional message.
*/
void OWCOMMON_EXPORT wAssertFailed( std::string const& expression, std::string const& file, std::size_t line, std::string const& msg );
void wAssertFailed( std::string const& expression, std::string const& file, std::size_t line, std::string const& msg );
//! the actual assertion macro
#define WAssert( e, msg ) ( ( e ) ? ( ( void )0 ) : ( wAssertFailed( #e, __FILE__, __LINE__, msg ) ) )
......
......@@ -28,7 +28,7 @@
#include <osg/Vec4>
#include <osg/io_utils> // for the operator<< and operator>> for Vec4
#include "WExportCommon.h"
/**
* Represents a RGBA Color.
......@@ -46,7 +46,7 @@ typedef osg::Vec4 WColor;
*
* \return The same color but in rgba format.
*/
WColor OWCOMMON_EXPORT convertHSVtoRGBA( double h, double s, double v );
WColor convertHSVtoRGBA( double h, double s, double v );
/**
* Computes the inverse of this color in means of RGB space. The alpha value is untouched.
......@@ -55,7 +55,7 @@ WColor OWCOMMON_EXPORT convertHSVtoRGBA( double h, double s, double v );
*
* \param other The color (RGBA) from which the inverse should be calculated.
*/
WColor OWCOMMON_EXPORT inverseColor( const WColor& other );
WColor inverseColor( const WColor& other );
/**
* Some default colors.
......
......@@ -30,13 +30,13 @@
#include <boost/signals2/signal.hpp>
#include <boost/thread.hpp>
#include "WExportCommon.h"
/**
* Class to encapsulate boost::condition_variable_any. You may use it to efficiently wait for events (a condition comes true). It
* is a very simple implementation. It might be extended easily. Timed wait functions and so on.
*/
class OWCOMMON_EXPORT WCondition // NOLINT
class WCondition // NOLINT
{
friend class WCondition_test;
public:
......
......@@ -33,8 +33,6 @@ WConditionOneShot::WConditionOneShot()
WConditionOneShot::~WConditionOneShot()
{
// win crashes here sometimes
#ifndef _MSC_VER
// cleanup
try
{
......@@ -44,7 +42,6 @@ WConditionOneShot::~WConditionOneShot()
{
// ignore this particular error since it is thrown when the lock is not locked anymore
}
#endif
}
void WConditionOneShot::wait() const
......
......@@ -28,7 +28,7 @@
#include <boost/thread.hpp>
#include "WCondition.h"
#include "WExportCommon.h"
/**
* Implements a WCondition, but can be fired only ONCE. This is useful if you want to have a thread waiting for a condition but
......@@ -37,7 +37,7 @@
* on a mutex. All waiting threads try to get a read lock which is not possible as long it is write-locked. The notify method
* releases the write lock and all waiting threads can continue.
*/
class OWCOMMON_EXPORT WConditionOneShot: public WCondition
class WConditionOneShot: public WCondition
{
friend class WConditionOneShot_test;
public:
......
......@@ -32,14 +32,14 @@
#include <boost/thread.hpp>
#include "WCondition.h"
#include "WExportCommon.h"
/**
* Class allowing multiple conditions to be used for one waiting cycle. Since wait() can not be used for waiting on multiple
* conditions, this class can encapsulate multiple conditions and offer a wait() command to wait for one of them to change its
* state. Please not that this class can also be used as condition.
*/
class OWCOMMON_EXPORT WConditionSet: public WCondition
class WConditionSet: public WCondition
{
friend class WConditionSetTest;
public:
......
......@@ -31,12 +31,12 @@
#include <sstream>
#include "WTerminalColor.h"
#include "WExportCommon.h"
/**
* Basic exception handler.
*/
class OWCOMMON_EXPORT WException: public std::exception
class WException: public std::exception
{
/**
* Only UnitTests are allowed to be a friend of this class.
......
//---------------------------------------------------------------------------
//
// Project: OpenWalnut ( http://www.openwalnut.org )
//
// Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
// For more information see http://www.openwalnut.org/copying
//
// This file is part of OpenWalnut.
//
// OpenWalnut is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// OpenWalnut is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
//
//---------------------------------------------------------------------------
#ifndef WEXPORTCOMMON_H
#define WEXPORTCOMMON_H
#ifdef _MSC_VER
#pragma warning( disable: 4251 )
#if defined( owcommon_EXPORTS ) || defined( OWcommon_EXPORTS )
#define OWCOMMON_EXPORT __declspec( dllexport )
#else
#define OWCOMMON_EXPORT __declspec( dllimport )
#endif
#else
#define OWCOMMON_EXPORT
#endif // _MSC_VER
#endif // WEXPORTCOMMON_H
......@@ -29,7 +29,7 @@
#include <boost/signals2/signal.hpp>
#include "WFlag.h"
#include "WExportCommon.h"
/**
* This class helps especially container module programmers to easily synchronize the value of one flag with several other
......@@ -50,7 +50,7 @@
* \param T the encapsulated type inside the flag. I.e. for WFlag< int32_t > use T=int32_t
*/
template < typename T >
class OWCOMMON_EXPORT WFlagForwarder // NOLINT
class WFlagForwarder // NOLINT
{
public:
/**
......
......@@ -33,12 +33,12 @@
#include <boost/shared_ptr.hpp>
#include "WColor.h"
#include "WExportCommon.h"
/**
* base class for hierarchical tree implementations
*/
class OWCOMMON_EXPORT WHierarchicalTree // NOLINT
class WHierarchicalTree // NOLINT
{
public:
/**
......
......@@ -35,12 +35,12 @@
#include "WColor.h"
#include "WHierarchicalTree.h"
#include "WExportCommon.h"
/**
* Class implements a hierarchical tree and provides helper functions for selection and navigation
*/
class OWCOMMON_EXPORT WHierarchicalTreeFibers : public WHierarchicalTree
class WHierarchicalTreeFibers : public WHierarchicalTree
{
public:
/**
......
......@@ -35,12 +35,12 @@
#include "WColor.h"
#include "WHierarchicalTree.h"
#include "WExportCommon.h"
/**
* Class implements a hierarchical tree and provides helper functions for selection and navigation
*/
class OWCOMMON_EXPORT WHierarchicalTreeVoxels : public WHierarchicalTree // NOLINT
class WHierarchicalTreeVoxels : public WHierarchicalTree // NOLINT
{
public:
/**
......
......@@ -27,13 +27,13 @@
#include <utility>
#include "WExportCommon.h"
/**
* Container which associate values with (uniform width) bins (aka intervals or buckets). This class implements the abstract interface and
* therefore builds the base class for all histogram classes. The interface also allows programming histogram of different bucket sizes.
*/
class OWCOMMON_EXPORT WHistogram // NOLINT
class WHistogram // NOLINT
{
public:
/**
......
......@@ -29,13 +29,13 @@
#include <vector>
#include "WHistogram.h"
#include "WExportCommon.h"
/**
* Container which associate values with (uniform width) bins (aka intervals or buckets). This class implements a very simple and easy to use
* generic histogram with uniform bucket sizes.
*/
class OWCOMMON_EXPORT WHistogramBasic: public WHistogram
class WHistogramBasic: public WHistogram
{
public:
/**
......
......@@ -32,7 +32,7 @@
#include <boost/filesystem.hpp>
#include "WExportCommon.h"
#include "WAssert.h"
/**
......@@ -133,7 +133,7 @@ boost::filesystem::path tempFileName();
*
* \return The file content in as string.
*/
std::string OWCOMMON_EXPORT readFileIntoString( const boost::filesystem::path& path );
std::string readFileIntoString( const boost::filesystem::path& path );
/**
* Get the contens of a file as a string.
......@@ -146,7 +146,7 @@ std::string OWCOMMON_EXPORT readFileIntoString( const boost::filesystem::path& p
*
* \return The file content in as string.
*/
std::string OWCOMMON_EXPORT readFileIntoString( const std::string& name );
std::string readFileIntoString( const std::string& name );
/**
* Writes the contens of a string to the given path.
......@@ -156,7 +156,7 @@ std::string OWCOMMON_EXPORT readFileIntoString( const std::string& name );
*
* \throw WFileOpenFailed If file cannot be opened for writing
*/
void OWCOMMON_EXPORT writeStringIntoFile( const boost::filesystem::path& path, const std::string& content );
void writeStringIntoFile( const boost::filesystem::path& path, const std::string& content );
/**
* Writes the contens of a string to the given path.
......@@ -166,6 +166,6 @@ void OWCOMMON_EXPORT writeStringIntoFile( const boost::filesystem::path& path, c
*
* \throw WFileOpenFailed If file cannot be opened for writing
*/
void OWCOMMON_EXPORT writeStringIntoFile( const std::string& name, const std::string& content );
void writeStringIntoFile( const std::string& name, const std::string& content );
#endif // WIOTOOLS_H
......@@ -36,7 +36,7 @@
#include "WSharedSequenceContainer.h"
#include "WItemSelectionItem.h"
#include "WExportCommon.h"
class WItemSelector;
......@@ -47,7 +47,7 @@ class WItemSelector;
* not implement any function that might change the item list, use the provided ones. If the item list changes, existing selectors get invalid
* automatically using the change condition of the inherited WSharedSequenceContainer.
*/
class OWCOMMON_EXPORT WItemSelection: public boost::enable_shared_from_this< WItemSelection >,
class WItemSelection: public boost::enable_shared_from_this< WItemSelection >,
public WSharedSequenceContainer< std::vector< boost::shared_ptr< WItemSelectionItem > > >
{
friend class WItemSelector; // for proper locking and unlocking
......
......@@ -27,12 +27,12 @@
#include <string>
#include "WExportCommon.h"
/**
* Class for keeping a single named item in a WItemSelection.
*/
class OWCOMMON_EXPORT WItemSelectionItem // NOLINT
class WItemSelectionItem // NOLINT
{
public:
/**
......
......@@ -35,7 +35,7 @@
#include "WItemSelection.h"
#include "WItemSelectionItem.h"
#include "WExportCommon.h"
/**
* This class represents a subset of a WItemSelection. It is a class for managing selections. The class is kept very restrictive. The selection
......@@ -49,7 +49,7 @@
* \note the protected constructor avoids instance creation of classes not the WItemSelection. This is restrictive but needed. Nobody can create
* instances of it, changing the underlying WItemSelection and using it as selector for another ItemSelection instance.
*/
class OWCOMMON_EXPORT WItemSelector // NOLINT
class WItemSelector // NOLINT
{
friend class WItemSelection;
public:
......
......@@ -28,7 +28,7 @@
#include <string>
#include "WTerminalColor.h"
#include "WExportCommon.h"
/**
* Various log levels, to distinguish output on its level.
......@@ -53,7 +53,7 @@ LogLevel logLevelFromString( const std::string& str );
/**
* Represents a simple log message with some attributes.
*/
class OWCOMMON_EXPORT WLogEntry // NOLINT
class WLogEntry // NOLINT
{
public:
/**
......
......@@ -34,7 +34,7 @@
/**
* Class implementing a capsule for an output stream and the needed level and format information.
*/
class OWCOMMON_EXPORT WLogStream // NOLINT
class WLogStream // NOLINT
{
public:
typedef boost::shared_ptr< WLogStream > SharedPtr; //!< shared pointer type
......
......@@ -37,13 +37,13 @@
#include "WLogStream.h"
#include "WStringUtils.h"
#include "WSharedSequenceContainer.h"
#include "WExportCommon.h"
/**
* This class defines the interface for adding logs and managing several output streams for them. The actual log entry is in \ref WLogEntry and
* the output is done in \ref WLogStream.
*/
class OWCOMMON_EXPORT WLogger // NOLINT
class WLogger // NOLINT
{
public:
/**
......@@ -169,7 +169,7 @@ namespace wlog
/**
* Resource class for streamed logging.
*/
class OWCOMMON_EXPORT WStreamedLogger // NOLINT
class WStreamedLogger // NOLINT
{
public:
/**
......
......@@ -30,13 +30,13 @@
#include <boost/filesystem.hpp>
#include <boost/shared_ptr.hpp>
#include "WExportCommon.h"
/**
* Singleton class helping to find files and paths. It is a useful to to search for resources and the central place to "hardcode" relative paths.
* It contains global paths only. Modules have their OWN local paths.
*/
class OWCOMMON_EXPORT WPathHelper // NOLINT
class WPathHelper // NOLINT
{
public:
/**
......
......@@ -30,7 +30,7 @@
#include <boost/shared_ptr.hpp>
#include "WExportCommon.h"