Commit f312085a authored by Mathias Goldau's avatar Mathias Goldau
Browse files

[ADD]

 * refactored CMakeLists.txt except the static-part
 * Added new cmake function to enforce boost version
parent 7c95b72a
......@@ -2,75 +2,44 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT( OpenWalnut )
# Include local CMake modules
# append search path for FindModules:
#------------------------------------
LIST( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/../tools/CMakeModules )
# include custom CMake commands like assert
INCLUDE( ${PROJECT_SOURCE_DIR}/../tools/CMakeModules/Utils.cmake )
# First of all find out which platform we are on and set our own platform variable
SET( OPENWALNUT_PLATFORM_LINUX "Linux" )
SET( OPENWALNUT_PLATFORM_WINDOWS "Windows" )
# platform dependend stuff:
#--------------------------
IF( CMAKE_HOST_SYSTEM MATCHES Linux )
SET( OPENWALNUT_PLATFORM
${OPENWALNUT_PLATFORM_LINUX}
CACHE STRING "The platform we are building on." )
ENDIF( CMAKE_HOST_SYSTEM MATCHES Linux )
IF( CMAKE_HOST_SYSTEM MATCHES Windows )
SET( OPENWALNUT_PLATFORM
${OPENWALNUT_PLATFORM_WINDOWS}
CACHE STRING "The platform we are building on." )
ENDIF( CMAKE_HOST_SYSTEM MATCHES Windows )
SET( LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib CACHE PATH "The libraries will be put into this directory." )
ELSEIF( CMAKE_HOST_SYSTEM MATCHES Windows )
SET( LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin CACHE PATH "The libraries will be put into this directory." )
ELSE()
MESSAGE( FATAL_ERROR "Could not determine platform type! (expected Linux or Windows)!" )
ENDIF()
# Package dependencies:
#----------------------
### BOOST ###
SET( Boost_USE_MULTITHREAD ON )
IF ( CMAKE_BUILD_TYPE STREQUAL "Static" )
IF( CMAKE_BUILD_TYPE STREQUAL "Static" )
SET( Boost_USE_STATIC_LIBS ON )
ENDIF ( CMAKE_BUILD_TYPE STREQUAL "Static" )
ENDIF( CMAKE_BUILD_TYPE STREQUAL "Static" )
# To see which boost libs we currently use, you may run the following command
# in the trunk/src directory on a linux box to make some investigations:
# grep -i include `find . -type f` | grep boost | awk '{print $2}' | sort | uniq
FIND_PACKAGE( Boost 1.36.0 REQUIRED program_options thread )
include_directories( ${Boost_INCLUDE_DIR} )
FIND_PACKAGE( Boost REQUIRED program_options thread )
ASSERT_GE_VERSION( "Boost" "${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}" 1.36.0 )
INCLUDE_DIRECTORIES( ${Boost_INCLUDE_DIR} )
### OpenGL ###
FIND_PACKAGE( OpenGL REQUIRED )
### CxxTest ###
FIND_PACKAGE( CxxTest QUIET )
MARK_AS_ADVANCED ( CXXTEST_PERL_TESTGEN_EXECUTABLE )
FIND_PACKAGE( osg REQUIRED)
FIND_PACKAGE( osgUtil REQUIRED)
FIND_PACKAGE( osgDB REQUIRED)
FIND_PACKAGE( osgViewer REQUIRED)
FIND_PACKAGE( osgGA REQUIRED)
FIND_PACKAGE( OpenThreads REQUIRED)
# Platform dependencies
IF( OPENWALNUT_PLATFORM MATCHES ${OPENWALNUT_PLATFORM_WINDOWS} )
SET( LIBRARY_OUTPUT_PATH
${PROJECT_BINARY_DIR}/bin
CACHE PATH "The libraries will be put into this directory.")
ELSE( OPENWALNUT_PLATFORM MATCHES ${OPENWALNUT_PLATFORM_WINDOWS} )
SET( LIBRARY_OUTPUT_PATH
${PROJECT_BINARY_DIR}/lib
CACHE PATH "The libraries will be put into this directory.")
ENDIF( OPENWALNUT_PLATFORM MATCHES ${OPENWALNUT_PLATFORM_WINDOWS} )
MARK_AS_ADVANCED( LIBRARY_OUTPUT_PATH )
SET( EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin CACHE PATH
"The executables will be put into this directory.")
MARK_AS_ADVANCED( EXECUTABLE_OUTPUT_PATH )
# Set default build type
IF ( NOT CMAKE_BUILD_TYPE )
SET( CMAKE_BUILD_TYPE Release CACHE STRING
"Choose the type of build, options are: Debug Release RelWithDebInfo Static"
FORCE )
ENDIF ( NOT CMAKE_BUILD_TYPE )
# Enable unit tests via CxxTest
MARK_AS_ADVANCED( CXXTEST_PERL_TESTGEN_EXECUTABLE )
IF( CXXTEST_FOUND )
INCLUDE_DIRECTORIES( ${CXXTEST_INCLUDE_DIR} )
# Package settings:
......@@ -79,9 +48,35 @@ IF( CXXTEST_FOUND )
ENABLE_TESTING()
ENDIF( CXXTEST_FOUND )
### OpenSceneGraph ###
SET( MIN_OSG_VERSION 2.8.0 )
FIND_PACKAGE( osg ${MIN_OSG_VERSION} REQUIRED )
FIND_PACKAGE( osgUtil ${MIN_OSG_VERSION} REQUIRED )
FIND_PACKAGE( osgDB ${MIN_OSG_VERSION} REQUIRED )
FIND_PACKAGE( osgViewer ${MIN_OSG_VERSION} REQUIRED )
FIND_PACKAGE( osgGA ${MIN_OSG_VERSION} REQUIRED )
FIND_PACKAGE( OpenThreads ${MIN_OSG_VERSION} REQUIRED )
SET( OPENSCENEGRAPH_LIBRARIES ${OSGDB_LIBRARY} ${OSGGA_LIBRARY} ${OSGUTIL_LIBRARY} ${OSGVIEWER_LIBRARY} ${OSG_LIBRARY} ${OPENTHREADS_LIBRARY} )
SET( OPENSCENEGRAPH_INCLUDE_DIRS ${OSG_INCLUDE_DIR} ${OSGDB_INCLUDE_DIR} ${OSGGA_INCLUDE_DIR} ${OSGVIEWER_INCLUDE_DIR} ${OSGUTIL_INCLUDE_DIR} ${OPENTHREADS_INCLUDE_DIR} )
# When new cmake version available >=2.6.4 we may use this the line below instead the stuff above
# FIND_PACKAGE( OpenSceneGraph 2.8.0 REQUIRED osgDB osgUtil osgGA osgViewer OpenThreads )
INCLUDE_DIRECTORIES( ${OPENSCENEGRAPH_INCLUDE_DIRS} )
# other options:
#---------------
# Set default build type
IF( NOT CMAKE_BUILD_TYPE )
SET( CMAKE_BUILD_TYPE Release
CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo Static"
FORCE
)
ENDIF( NOT CMAKE_BUILD_TYPE )
SET( EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin CACHE PATH "The executables will be put into this directory." )
MARK_AS_ADVANCED( LIBRARY_OUTPUT_PATH )
MARK_AS_ADVANCED( EXECUTABLE_OUTPUT_PATH )
# Global compiler flags:
#-------------------------------------------------------------------------------------------------------------
#-----------------------
# -Wno-long-long since on Ubuntu 8.10 it won't compile without it
# -ansi force ISO-C++98 compliance (not GNU++98)
SET( CMAKE_CXX_FLAGS "-pedantic -ansi -Wall -Wextra -Wno-long-long" CACHE STRING "" FORCE )
......@@ -91,9 +86,7 @@ SET( CMAKE_CXX_FLAGS_STATIC "-O3" CACHE STRING "" FORCE )
MARK_AS_ADVANCED( CMAKE_CXX_FLAGS_STATIC )
SET( CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g -DDEBUG -O2" CACHE STRING "" FORCE )
INCLUDE_DIRECTORIES( ${OSG_INCLUDE_DIR} ${OSGDB_INCLUDE_DIR} ${OSGGA_INCLUDE_DIR} ${OSGVIEWER_INCLUDE_DIR} ${OSGUTIL_INCLUDE_DIR} ${OPENTHREADS_INCLUDE_DIR} )
IF ( NOT CMAKE_BUILD_TYPE STREQUAL "Static" )
IF( NOT CMAKE_BUILD_TYPE STREQUAL "Static" )
ADD_SUBDIRECTORY( math )
ADD_SUBDIRECTORY( dataHandler )
ADD_SUBDIRECTORY( graphicsEngine )
......@@ -102,12 +95,12 @@ IF ( NOT CMAKE_BUILD_TYPE STREQUAL "Static" )
ADD_SUBDIRECTORY( kernel )
ADD_SUBDIRECTORY( common )
ADD_EXECUTABLE( walnut OpenWalnut.cpp utils/WOptionHandler.cpp )
TARGET_LINK_LIBRARIES( walnut kernel dataHandler guiqt4 common ${Boost_LIBRARIES} ${OPENTHREADS_LIBRARY} )
TARGET_LINK_LIBRARIES( walnut kernel dataHandler guiqt4 common ${Boost_LIBRARIES} )
ELSE ( NOT CMAKE_BUILD_TYPE STREQUAL "Static" )
ELSE( NOT CMAKE_BUILD_TYPE STREQUAL "Static" )
FILE( GLOB_RECURSE ALL_SRC ${PROJECT_SOURCE_DIR}/*.cpp )
FILE( GLOB NIFTI_SRC "dataHandler/io/nifti/*.c" )
ADD_DEFINITIONS(-DHAVE_ZLIB)
ADD_DEFINITIONS( -DHAVE_ZLIB )
# Package dependencies:
FIND_PACKAGE( Qt4 REQUIRED )
......@@ -117,16 +110,12 @@ ELSE ( NOT CMAKE_BUILD_TYPE STREQUAL "Static" )
INCLUDE_DIRECTORIES( ${QT_INCLUDE_DIR} )
# Libraries for linking:
SET( QT_LINK_LIBRARIES ${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY}
${QT_QTOPENGL_LIBRARY} )
SET( QT_LINK_LIBRARIES ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTOPENGL_LIBRARY} )
# add here all classes that inherit from QObject
SET(GUI_QT4_MOC_HDRS
gui/qt4/WMainWindow.h
)
SET( GUI_QT4_MOC_HDRS gui/qt4/WMainWindow.h )
QT4_WRAP_CPP(GUI_QT4_MOC_SRCS ${GUI_QT4_MOC_HDRS} )
QT4_WRAP_CPP( GUI_QT4_MOC_SRCS ${GUI_QT4_MOC_HDRS} )
ADD_EXECUTABLE( walnut ${ALL_SRC} ${NIFTI_SRC} ${GUI_QT4_MOC_SRCS} )
TARGET_LINK_LIBRARIES( walnut ${Boost_LIBRARIES} ${OSG_LIBRARIES} ${QT_LINK_LIBRARIES} ${GLEW_LIBRARY} )
......@@ -139,99 +128,101 @@ execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/modules/nav
# Special targets:
#-------------------------------------------------------------------------------------------------------------
# Creates API via Doxygen
ADD_CUSTOM_TARGET(doc
COMMAND doxygen ${PROJECT_SOURCE_DIR}/../doc/developer/doxygenConfig
COMMAND chmod -R g+r ${PROJECT_SOURCE_DIR}/../doc/developer/html
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/..
COMMENT "Build doxygen documentation"
VERBATIM )
ADD_CUSTOM_TARGET( doc
COMMAND doxygen ${PROJECT_SOURCE_DIR}/../doc/developer/doxygenConfig
COMMAND chmod -R g+r ${PROJECT_SOURCE_DIR}/../doc/developer/html
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/..
COMMENT "Build doxygen documentation"
VERBATIM
)
#-------------------------------------------------------------------------------------------------------------
# Uses ctags to create source tags, usable in many editors like VIM or Emacs
ADD_CUSTOM_COMMAND(OUTPUT ctags
COMMAND ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/
COMMENT "Build ctags tagfile"
ADD_CUSTOM_COMMAND( OUTPUT ctags
COMMAND ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/
COMMENT "Build ctags tagfile"
)
#-------------------------------------------------------------------------------------------------------------
# Uses cscope to create several source graphs (dependency, call, caller, ...), usable in many editors like VIM or Emacs
ADD_CUSTOM_COMMAND(OUTPUT cscope
COMMAND cscope -R -b
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/
COMMENT "Build cscope tagfile"
ADD_CUSTOM_COMMAND( OUTPUT cscope
COMMAND cscope -R -b
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/
COMMENT "Build cscope tagfile"
)
#-------------------------------------------------------------------------------------------------------------
# The command "make tags" creates ctags and cscope tag files
ADD_CUSTOM_TARGET(tags
DEPENDS ctags
DEPENDS cscope
)
ADD_CUSTOM_TARGET( tags DEPENDS ctags DEPENDS cscope )
#-------------------------------------------------------------------------------------------------------------
# Checks style guide lines via the BrainLint tool against all source code files
# The output is colored when variable CMAKE_COLOR_MAKEFILE is set to ON,
# noncolored if it is set to OFF
FILE(GLOB_RECURSE STYLE_CPP ${PROJECT_SOURCE_DIR}/*.cpp)
FILE(GLOB_RECURSE STYLE_H ${PROJECT_SOURCE_DIR}/*.h)
#-------------------------------------------------------------------------------------------------------------
#Set dirs to exclude from stylecheck
SET ( EXCLUDE_DIRS "/dataHandler/io/nifti/;/dataHandler/io/biosig/;/dataHandler/io/biosig/XMLParser/" )
FILE( GLOB_RECURSE STYLE_CPP ${PROJECT_SOURCE_DIR}/*.cpp )
FILE( GLOB_RECURSE STYLE_H ${PROJECT_SOURCE_DIR}/*.h )
# Set dirs to exclude from stylecheck
SET( EXCLUDE_DIRS "/dataHandler/io/nifti/;/dataHandler/io/biosig/;/dataHandler/io/biosig/XMLParser/" )
FOREACH( dirname ${EXCLUDE_DIRS} )
FILE( GLOB EXCLUDE_H ${PROJECT_SOURCE_DIR}${dirname}*.h )
FILE( GLOB EXCLUDE_CPP ${PROJECT_SOURCE_DIR}${dirname}*.cpp )
FOREACH( fname ${EXCLUDE_H} )
LIST ( REMOVE_ITEM STYLE_H ${fname} )
LIST( REMOVE_ITEM STYLE_H ${fname} )
ENDFOREACH( fname )
FOREACH( fname ${EXCLUDE_CPP} )
LIST ( REMOVE_ITEM STYLE_CPP ${fname} )
LIST( REMOVE_ITEM STYLE_CPP ${fname} )
ENDFOREACH( fname )
ENDFOREACH( dirname )
IF( CMAKE_COLOR_MAKEFILE )
ADD_CUSTOM_TARGET(stylecheck
COMMAND ${PROJECT_SOURCE_DIR}/../tools/brainlint.py --color ${STYLE_CPP} ${STYLE_H}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMENT "Check if code complies to CodingStandard" )
ELSE( CMAKE_COLOR_MAKEFILE )
ADD_CUSTOM_TARGET(stylecheck
COMMAND ${PROJECT_SOURCE_DIR}/../tools/brainlint.py ${STYLE_CPP} ${STYLE_H}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMENT "Check if code complies to CodingStandard and use noncolored output for violation messages" )
ENDIF( CMAKE_COLOR_MAKEFILE )
ADD_CUSTOM_TARGET( stylecheck
COMMAND ${PROJECT_SOURCE_DIR}/../tools/brainlint.py --color ${STYLE_CPP} ${STYLE_H}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMENT "Check if code complies to CodingStandard"
)
ELSE()
ADD_CUSTOM_TARGET( stylecheck
COMMAND ${PROJECT_SOURCE_DIR}/../tools/brainlint.py ${STYLE_CPP} ${STYLE_H}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMENT "Check if code complies to CodingStandard and use noncolored output for violation messages"
)
ENDIF()
#-------------------------------------------------------------------------------------------------------------
# Prints the verbose output of the test runners, so you may identify the source of error early, if any
ADD_CUSTOM_TARGET(vtest
COMMAND make test ARGS="-V"
COMMENT "Runs the test in verboseness to see what actually went wrong" )
ADD_CUSTOM_TARGET( vtest
COMMAND make test ARGS="-V"
COMMENT "Runs the test in verboseness to see what actually went wrong"
)
#-------------------------------------------------------------------------------------------------------------
# Removes all tests thus forcing them to be recompiled during the next "make"
ADD_CUSTOM_TARGET(cleantest
COMMAND rm -f ${PROJECT_BINARY_DIR}/*/*_test.cc
COMMENT "Remove all tests to force them to be recompiled" )
ADD_CUSTOM_TARGET( cleantest
COMMAND rm -f ${PROJECT_BINARY_DIR}/*/*_test.cc
COMMENT "Remove all tests to force them to be recompiled"
)
#-------------------------------------------------------------------------------------------------------------
# Checks if all is well to commit (aka commitCheck, cicheck)
ADD_CUSTOM_TARGET(cicheck
COMMAND make test && make stylecheck
COMMENT "Checks if all is well to commit" )
ADD_CUSTOM_TARGET( cicheck
COMMAND make test && make stylecheck
COMMENT "Checks if all is well to commit"
)
#-------------------------------------------------------------------------------------------------------------
# Copies fixtures used for tests to the binary directory (where they are expected).
ADD_CUSTOM_TARGET( fixtures
ALL
COMMAND cp -rf ${PROJECT_SOURCE_DIR}/dataHandler/test/fixtures
${PROJECT_BINARY_DIR}/dataHandler/
COMMENT "Copy fixtures to the right place." )
COMMAND cp -rf ${PROJECT_SOURCE_DIR}/dataHandler/test/fixtures ${PROJECT_BINARY_DIR}/dataHandler/
COMMENT "Copy fixtures to the right place."
)
#-------------------------------------------------------------------------------------------------------------
# Makes many special make targets in comination.
ADD_CUSTOM_TARGET( many
cmake . && make all -j4 && make fixtures && make stylecheck && make test && make doc
COMMENT "Make many special make targets in combination." )
COMMENT "Make many special make targets in combination."
)
......@@ -6,20 +6,20 @@ MESSAGE( STATUS "Inlcuded NIfTI lib building information." )
INCLUDE_DIRECTORIES(.)
OPTION ( BUILD_SHARED_LIBS "Toggle building shared libraries" ON)
#Zlib support currently only on Linux
IF( OPENWALNUT_PLATFORM MATCHES ${OPENWALNUT_PLATFORM_LINUX} )
# Zlib support currently only on Linux
IF( CMAKE_HOST_SYSTEM MATCHES Linux )
ADD_DEFINITIONS(-DHAVE_ZLIB)
ENDIF( OPENWALNUT_PLATFORM MATCHES ${OPENWALNUT_PLATFORM_LINUX} )
ENDIF()
SET(ZNZLIB_SRC znzlib.c)
SET(NIFTI_ZNZLIB_NAME ${PACKAGE_PREFIX}znz)
ADD_LIBRARY(${NIFTI_ZNZLIB_NAME} ${ZNZLIB_SRC} )
TARGET_LINK_LIBRARIES( ${NIFTI_ZNZLIB_NAME} ${NIFTI_ZLIB_LIBRARIES} )
#Zlib support currently only on Linux
IF( OPENWALNUT_PLATFORM MATCHES ${OPENWALNUT_PLATFORM_LINUX} )
# Zlib support currently only on Linux
IF( CMAKE_HOST_SYSTEM MATCHES Linux )
TARGET_LINK_LIBRARIES( ${NIFTI_ZNZLIB_NAME} z)
ENDIF( OPENWALNUT_PLATFORM MATCHES ${OPENWALNUT_PLATFORM_LINUX} )
ENDIF()
# Set library version when building shared libs.
IF (BUILD_SHARED_LIBS)
......
# Package dependencies:
FIND_PACKAGE( GLEW REQUIRED ) # required anymore?
FIND_PACKAGE( GLEW REQUIRED )
ADD_SUBDIRECTORY( exceptions )
......@@ -10,5 +10,5 @@ FILE( GLOB GE_EXCEPTIONS_SRC "exceptions/*.cpp" )
FILE( GLOB GE_SRC "*.cpp" )
ADD_LIBRARY( ge SHARED ${GE_SRC} ${GE_EXCEPTIONS_SRC} )
TARGET_LINK_LIBRARIES( ge "common" ${OPENGL_gl_LIBRARY} ${GLEW_LIBRARY} ${OPENTHREADS_LIBRARY} ${OSG_LIBRARY} ${OSGUTIL_LIBRARY} ${OSGVIEWER_LIBRARY} ${OSGDB_LIBRARY} ${OSGGA_LIBRARY})
TARGET_LINK_LIBRARIES( ge common ${OPENGL_gl_LIBRARY} ${GLEW_LIBRARY} ${OPENSCENEGRAPH_LIBRARIES} )
FILE( GLOB KERNEL_SRC "*.cpp" )
FILE( GLOB MODULES_SRC "../modules/navigationSlices/*.cpp" )
ADD_LIBRARY( kernel SHARED ${KERNEL_SRC} ${MODULES_SRC})
TARGET_LINK_LIBRARIES( kernel common ge )
ADD_LIBRARY( kernel SHARED ${KERNEL_SRC} ${MODULES_SRC} )
TARGET_LINK_LIBRARIES( kernel common ge ${OPENSCENEGRAPH_LIBRARIES} )
# Unit tests
......
FUNCTION( SPLIT_VERSION_STRING _VersionString _Major _Minor _Patch )
STRING( STRIP _VersionString ${_VersionString} )
STRING( REGEX MATCH "^[0-9]+" _MajorProxy "${_VersionString}" )
STRING( REGEX MATCH "[^0-9][0-9]+[^0-9]" _MinorProxy "${_VersionString}" )
STRING( REGEX MATCH "[0-9]+" _MinorProxy "${_MinorProxy}" )
STRING( REGEX MATCH "[0-9]+$" _PatchProxy "${_VersionString}" )
SET( ${_Major} "${_MajorProxy}" PARENT_SCOPE )
SET( ${_Minor} "${_MinorProxy}" PARENT_SCOPE )
SET( ${_Patch} "${_PatchProxy}" PARENT_SCOPE )
ENDFUNCTION( SPLIT_VERSION_STRING )
FUNCTION( ASSERT_GE_VERSION _PackageName _ActualVersion _MinimumVersion )
SPLIT_VERSION_STRING( ${_ActualVersion} _ActualMajor _ActualMinor _ActualPatch )
SPLIT_VERSION_STRING( ${_MinimumVersion} _MinimumMajor _MinimumMinor _MinimumPatch )
SET( _FAIL_MSG "Version conflict for package ${_PackageName}: needed at least ${_MinimumVersion} but got: ${_ActualVersion}" )
# CMake 2.6 issue:
# The reason for writing here stupid code and repeating my self is that cmake
# is not able to evaluate AND expressions before OR expressions nor it does
# not support operator precedence. Just look into the book of crap:
# "Mastering CMake" page 38 for the most moronic way of operator precedence!
IF( _ActualMajor LESS _MinimumMajor )
MESSAGE( FATAL_ERROR "Assertion failed: ${_FAIL_MSG}" )
ELSEIF( _ActualMajor EQUAL _MinimumMajor AND _ActualMinor LESS _MinimumMinor )
MESSAGE( FATAL_ERROR "Assertion failed: ${_FAIL_MSG}" )
ELSEIF( _ActualMajor EQUAL _MinimumMajor AND _ActualMinor EQUAL _MinimumMinor AND _ActualPatch LESS _MinimumPatch )
MESSAGE( FATAL_ERROR "Assertion failed: ${_FAIL_MSG}" )
ENDIF()
ENDFUNCTION( ASSERT_GE_VERSION )
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