Commit a18210dc authored by Jussi Lindgren's avatar Jussi Lindgren
Browse files

Build: Restored compilation on VS2010

+ Minor build & dependency fixes & cleanup
parent 7bfe142d
......@@ -28,21 +28,46 @@ MESSAGE(STATUS "Appending compilation flags...")
SET(OV_CUSTOM_DEPENDENCIES_PATH "${CMAKE_SOURCE_DIR}/dependencies")
# If OpenMP is available, using it will allow Eigen to use multiple cores in matrix math.
INCLUDE("FindOpenMP")
IF(OPENMP_FOUND)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
ENDIF(OPENMP_FOUND)
IF(WIN32)
# Switch /arch:SSE2 enables vectorization. Remove if your CPU/compiler doesn't support it.
SET(OV_EIGEN_FLAGS "/arch:SSE2")
# The following is needed to keep OpenMP from hogging all the cores. Note that this works only for VS2013+. On VS2010, it may be better to disable OpenMP.
# The following is needed to keep OpenMP from hogging all the cores. Note that this env var works only for VS2013+.
# On VS2010, it may be better to disable OpenMP.
SET(OV_OMP_WAIT_POLICY "PASSIVE")
# Disable /MP if you don't like VS using all the cores for compilation
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4355 /MP ${OV_EIGEN_FLAGS}")
SET(OV_WIN32_BOOST_VERSION "1_55")
ADD_DEFINITIONS("-DNOMINMAX -DBOOST_ALL_NO_LIB")
# Find out the compiler version, deps may use this
IF(${CMAKE_MAJOR_VERSION} LESS 3)
INCLUDE(CMakeDetermineVSServicePack)
DetermineVSServicePack( MSVC_SERVICE_PACK )
ELSE(${CMAKE_MAJOR_VERSION} LESS 3)
SET(MSVC_SERVICE_PACK "unknown")
MESSAGE(STATUS "st ${CMAKE_CXX_COMPILER_VERSION}")
IF(${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER "16.0.0")
SET(MSVC_SERVICE_PACK "vc100")
ENDIF()
IF(${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER "17.0.0")
SET(MSVC_SERVICE_PACK "vc110")
ENDIF()
IF(${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER "18.0.0")
SET(MSVC_SERVICE_PACK "vc120")
ENDIF()
ENDIF(${CMAKE_MAJOR_VERSION} LESS 3)
STRING(REGEX MATCH "vc120.*" MSVC_VER120 ${MSVC_SERVICE_PACK})
IF(MSVC_VER120)
# If OpenMP is available, using it will allow Eigen to use multiple cores in matrix math. Only on VS120,
# as VS100 allocates the cores too aggressively when OpenMP is on.
INCLUDE("FindOpenMP")
IF(OPENMP_FOUND)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
ENDIF(OPENMP_FOUND)
ENDIF(MSVC_VER120)
MESSAGE(STATUS "MSVC version is ${MSVC_SERVICE_PACK}")
SET(OV_WIN32_BOOST_VERSION "1_55")
ELSEIF(UNIX)
# check for c++11 support
INCLUDE(CheckCXXCompilerFlag)
......@@ -58,6 +83,12 @@ ELSEIF(UNIX)
MESSAGE(WARNING "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. In the future this may be required.")
ENDIF(COMPILER_SUPPORTS_CXX11)
# If OpenMP is available, using it will allow Eigen to use multiple cores in matrix math.
INCLUDE("FindOpenMP")
IF(OPENMP_FOUND)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
ENDIF(OPENMP_FOUND)
# Switch -msse2 enables vectorization. Remove if your CPU/compiler doesn't support it.
SET(OV_EIGEN_FLAGS "-msse2")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall ${OV_EIGEN_FLAGS}")
......
......@@ -8,7 +8,7 @@ INCLUDE("FindThirdPartyBoost")
IF(UNIX)
FIND_LIBRARY(LIB_Boost_Math NAMES "boost_math_c99" PATHS ${OV_CUSTOM_DEPENDENCIES_PATH}/lib NO_DEFAULT_PATH NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH)
MESSAGE(STATUS " looking in ${OV_CUSTOM_DEPENDENCIES_PATH}")
# MESSAGE(STATUS " looking in ${OV_CUSTOM_DEPENDENCIES_PATH}")
IF(LIB_Boost_Math)
MESSAGE(STATUS " [ OK ] lib ${LIB_Boost_Math}")
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LIB_Boost_Math} )
......@@ -19,7 +19,6 @@ ENDIF(UNIX)
IF(WIN32)
IF(PATH_BOOST)
#LINK_DIRECTORIES("math" ${OV_WIN32_BOOST_VERSION})
OV_LINK_BOOST_LIB("math" ${OV_WIN32_BOOST_VERSION} )
OV_LINK_BOOST_LIB("math_c99" ${OV_WIN32_BOOST_VERSION} )
ENDIF(PATH_BOOST)
ENDIF(WIN32)
......@@ -22,8 +22,14 @@ IF(WIN32)
SET(CEGUI_FOUND TRUE)
SET(OgreCEGUIRenderer_FOUND TRUE)
SET(CEGUI_INCLUDE_DIRS ${PATH_CEGUI}/cegui/include)
SET(CEGUI_LIBRARIES_DEBUG CEGUIBase-0_d CEGUIOgreRenderer-0_d)
SET(CEGUI_LIBRARIES_RELEASE CEGUIBase-0 CEGUIOgreRenderer-0)
STRING(REGEX MATCH "vc120.*" MSVC_VER120 ${MSVC_SERVICE_PACK})
IF(MSVC_VER120)
SET(CEGUI_LIBRARIES_DEBUG CEGUIBase-0_d CEGUIOgreRenderer-0_d)
SET(CEGUI_LIBRARIES_RELEASE CEGUIBase-0 CEGUIOgreRenderer-0)
ELSE(MSVC_VER120)
SET(CEGUI_LIBRARIES_DEBUG CEGUIBase_d CEGUIOgreRenderer_d)
SET(CEGUI_LIBRARIES_RELEASE CEGUIBase CEGUIOgreRenderer)
ENDIF(MSVC_VER120)
SET(CEGUI_LIBRARY_DIRS ${PATH_CEGUI}/lib)
ENDIF(PATH_CEGUI)
ENDIF(WIN32)
......
# ---------------------------------
# Finds CEGUI toolkit
# Finds CEGUI & Ogre toolkit
#
# Should only be used to check the presence, include later
#
# Sets CEGUI_FOUND
# Sets CEGUI_LIBRARIES
# Sets CEGUI_LIBRARY_DIRS
# Sets CEGUI_LDFLAGS
# Sets CEGUI_LDFLAGS_OTHERS
# Sets CEGUI_INCLUDE_DIRS
# Sets CEGUI_CFLAGS
# Sets CEGUI_CFLAGS_OTHERS
# ---------------------------------
IF(OV_DISABLE_OGRE)
......@@ -20,12 +14,11 @@ IF(WIN32)
FIND_PATH(PATH_CEGUI cegui/include/CEGUI.h PATHS ${OV_CUSTOM_DEPENDENCIES_PATH}/cegui)
IF(PATH_CEGUI)
SET(CEGUI_FOUND TRUE)
SET(OgreCEGUIRenderer_FOUND TRUE)
SET(CEGUI_INCLUDE_DIRS ${PATH_CEGUI}/cegui/include)
SET(CEGUI_LIBRARIES_DEBUG CEGUIBase_d CEGUIOgreRenderer_d)
SET(CEGUI_LIBRARIES_RELEASE CEGUIBase CEGUIOgreRenderer)
SET(CEGUI_LIBRARY_DIRS ${PATH_CEGUI}/lib)
ENDIF(PATH_CEGUI)
FIND_PATH(PATH_Ogre3D include/OGRE/Ogre.h PATHS ${OV_CUSTOM_DEPENDENCIES_PATH}/ogre $ENV{OGRE_HOME})
IF(PATH_Ogre3D)
SET(OgreCEGUIRenderer_FOUND TRUE)
ENDIF(PATH_Ogre3D)
ENDIF(WIN32)
IF(UNIX)
......
......@@ -20,23 +20,7 @@ IF(WIN32)
SET(ITPP_FOUND TRUE)
SET(ITPP_INCLUDE_DIRS ${PATH_ITPP}/include)
# Currently the different versions we package for different VS have a bit different lib names...
IF(${CMAKE_MAJOR_VERSION} LESS 3)
INCLUDE(CMakeDetermineVSServicePack)
DetermineVSServicePack( MSVC_SERVICE_PACK )
ELSE(${CMAKE_MAJOR_VERSION} LESS 3)
SET(MSVC_SERVICE_PACK "unknown")
IF(${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER "16.0.0")
SET(MSVC_SERVICE_PACK "vc100")
ENDIF()
IF(${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER "17.0.0")
SET(MSVC_SERVICE_PACK "vc110")
ENDIF()
IF(${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER "18.0.0")
SET(MSVC_SERVICE_PACK "vc120")
ENDIF()
ENDIF(${CMAKE_MAJOR_VERSION} LESS 3)
# Currently the different versions we package for different VS have a bit different lib names...
STRING(REGEX MATCH "vc100.*" MSVC_VER100 ${MSVC_SERVICE_PACK})
STRING(REGEX MATCH "vc120.*" MSVC_VER120 ${MSVC_SERVICE_PACK})
......
......@@ -26,11 +26,21 @@ IF(WIN32)
SET(OIS_FOUND TRUE)
SET(Ogre3D_INCLUDE_DIRS ${PATH_Ogre3D}/include/OGRE ${PATH_Ogre3D}/include/OIS)
SET(Ogre3D_LIBRARIES_RELEASE OgreMain OgreOverlay OIS)
SET(Ogre3D_LIBRARY_DIRS_RELEASE ${PATH_Ogre3D}/lib/Release)
SET(Ogre3D_LIBRARIES_DEBUG OgreMain_d OgreOverlay_d OIS_d)
SET(Ogre3D_LIBRARY_DIRS_DEBUG ${PATH_Ogre3D}/lib/Debug)
# Currently the different versions we package for different VS have a bit different libs...
STRING(REGEX MATCH "vc100.*" MSVC_VER100 ${MSVC_SERVICE_PACK})
STRING(REGEX MATCH "vc120.*" MSVC_VER120 ${MSVC_SERVICE_PACK})
IF(MSVC_VER100)
SET(Ogre3D_LIBRARIES_RELEASE OgreMain OIS)
SET(Ogre3D_LIBRARIES_DEBUG OgreMain_d OIS_d)
SET(Ogre3D_LIBRARY_DIRS_DEBUG ${PATH_Ogre3D}/lib/Debug)
ENDIF(MSVC_VER100)
IF(MSVC_VER120)
SET(Ogre3D_LIBRARIES_RELEASE OgreMain OgreOverlay OIS)
SET(Ogre3D_LIBRARIES_DEBUG OgreMain_d OgreOverlay_d OIS_d)
ENDIF(MSVC_VER120)
SET(Ogre3D_LIBRARY_DIRS_DEBUG ${PATH_Ogre3D}/lib/Debug)
SET(Ogre3D_LIBRARY_DIRS_RELEASE ${PATH_Ogre3D}/lib/Release)
ENDIF(PATH_Ogre3D)
ENDIF(WIN32)
......
......@@ -14,22 +14,6 @@
FUNCTION(OV_LINK_BOOST_LIB BOOST_COMPONENT BOOST_VERSION)
IF(WIN32)
IF(${CMAKE_MAJOR_VERSION} LESS 3)
INCLUDE(CMakeDetermineVSServicePack)
DetermineVSServicePack( MSVC_SERVICE_PACK )
ELSE(${CMAKE_MAJOR_VERSION} LESS 3)
SET(MSVC_SERVICE_PACK "unknown")
MESSAGE(STATUS "st ${CMAKE_CXX_COMPILER_VERSION}")
IF(${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER "16.0.0")
SET(MSVC_SERVICE_PACK "vc100")
ENDIF()
IF(${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER "17.0.0")
SET(MSVC_SERVICE_PACK "vc110")
ENDIF()
IF(${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER "18.0.0")
SET(MSVC_SERVICE_PACK "vc120")
ENDIF()
ENDIF(${CMAKE_MAJOR_VERSION} LESS 3)
SET(LIB_BOOST "unknown-platform-NOTFOUND")
SET(LIB_BOOST_DEBUG "unknown-platform-NOTFOUND")
......
......@@ -17,7 +17,7 @@ REM ############################################################################
REM #
REM # By default, this script tries to find the newest VS first. If you want to use another version, execute e.g. GOTO VS2012
REM #
REM GOTO VS2012
REM GOTO VS2010
:VS2013
if exist "%VS120COMNTOOLS%vsvars32.bat" (
......
......@@ -44,6 +44,9 @@
Section "-base"
CreateDirectory "$INSTDIR"
CreateDirectory "$INSTDIR\arch"
;Finds Microsoft Platform SDK
ReadRegStr $r0 HKLM "SOFTWARE\Microsoft\Win32SDK\Directories" "Install Dir"
......@@ -103,7 +106,6 @@ Section "DirectX Runtime"
SectionIn RO
SetOutPath "$INSTDIR"
CreateDirectory "$INSTDIR\arch"
IfFileExists "$SYSDIR\d3dx9_42.dll" no_need_to_install_directx
IfFileExists "arch\openvibe-directx.exe" no_need_to_download_directx
......@@ -123,11 +125,10 @@ SectionEnd
;##########################################################################################################################################################
;##########################################################################################################################################################
Section "Visual Redistributable Packages"
Section "Visual C++ Redistributable Packages"
SectionIn RO
SetOutPath "$INSTDIR"
CreateDirectory "$INSTDIR\arch"
IfFileExists "arch\vcredist-2010.exe" no_need_to_download_vc2010_redist
NSISdl::download "http://download.microsoft.com/download/5/B/C/5BC5DBB3-652D-4DCE-B14A-475AB85EEF6E/vcredist_x86.exe" "arch\vcredist-2010.exe"
......@@ -153,11 +154,10 @@ SectionEnd
;##########################################################################################################################################################
;##########################################################################################################################################################
Section "Other"
Section "Everything else"
SectionIn RO
SetOutPath "$INSTDIR"
CreateDirectory "$INSTDIR\arch"
IfFileExists "arch\ov-dependencies-1.2.0-$suffix-dev.zip" no_need_to_download_dependencies_dev
NSISdl::download http://openvibe.inria.fr/dependencies/win32/ov-dependencies-1.2.0-$suffix-dev.zip "arch\ov-dependencies-1.2.0-$suffix-dev.zip"
......
......@@ -22,7 +22,7 @@ IF EXIST "%VSINSTALLDIR%\Common7\IDE\devenv.exe" (
)
REM VS2012 Express
IF EXIST "%VSINSTALLDIR%\Common7\IDE\WDExpress.exe"
IF EXIST "%VSINSTALLDIR%\Common7\IDE\WDExpress.exe" (
"%VSINSTALLDIR%\Common7\IDE\WDExpress.exe" ..\local-tmp\visual\OpenViBE.sln
goto terminate
)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment