X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=CMakeLists.txt;h=823705ed308fc168bc3f9b7f8cc7c865437d136d;hb=31f36736e1c12e7247a01bf514e528dfd1188a10;hp=76b21ce10d7efb99d67b0bb61fddbc09a66cd609;hpb=e7b04cfe67f670cb8da522890df8c81b80770bda;p=cpPlugins.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 76b21ce..823705e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,13 +21,10 @@ ENDFOREACH(policy) ## ================ PROJECT(cpPlugins) -SET(prj_MAJOR_VERSION "0") -SET(prj_MINOR_VERSION "0") -SET(prj_RELEASE_VERSION "1") -SET( - prj_VERSION - "${prj_MAJOR_VERSION}.${prj_MINOR_VERSION}.${prj_RELEASE_VERSION}" - ) +SET(prj_MAJ_VER "0") +SET(prj_MIN_VER "0") +SET(prj_REL_VER "2") +SET(prj_VERSION "${prj_MAJ_VER}.${prj_MIN_VER}.${prj_REL_VER}") ## =========== ## = Options = @@ -36,30 +33,32 @@ SET( OPTION(USE_QT4 "Build Qt4-based code" OFF) OPTION(BUILD_EXAMPLES "Build examples" OFF) -OPTION(BUILD_SHARED_LIBRARIES "Build libraries as shared" OFF) -IF(BUILD_SHARED_LIBRARIES) - SET(LIBRARY_TYPE SHARED) -ELSE(BUILD_SHARED_LIBRARIES) - SET(LIBRARY_TYPE STATIC) -ENDIF(BUILD_SHARED_LIBRARIES) +SET(LIBRARY_TYPE SHARED) ## ======================== ## = Packages and options = ## ======================== -# it seems that by default on Visual Studio Compiler supports c++11, so it only need to be test on other O.S. - if(NOT MSVC) - INCLUDE(CheckCXXCompilerFlag) - CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) - CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X) - IF(COMPILER_SUPPORTS_CXX11) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") - ELSEIF(COMPILER_SUPPORTS_CXX0X) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") - ELSE() - MESSAGE(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.") - ENDIF() -endif(NOT MSVC) +# Force c++11 language version +# NOTE: It seems that by default on Visual Studio Compiler supports c++11, +# so it only need to be test on other O.S. +IF(NOT MSVC) + INCLUDE(CheckCXXCompilerFlag) + CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) + IF(COMPILER_SUPPORTS_CXX11) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + ELSE(COMPILER_SUPPORTS_CXX11) + CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X) + IF(COMPILER_SUPPORTS_CXX0X) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") + ELSE(COMPILER_SUPPORTS_CXX0X) + MESSAGE( + FATAL_ERROR + "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support." + ) + ENDIF(COMPILER_SUPPORTS_CXX0X) + ENDIF(COMPILER_SUPPORTS_CXX11) +ENDIF(NOT MSVC) # Prepare header to build shared libs (windows) INCLUDE(GenerateExportHeader)