diff --git a/CMakeLists.txt b/CMakeLists.txt index 227fd39d83c13daefb676a3c0abd4177eed35b29..8d813ec73b8f5686565f1acde7e25b6e686fae72 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,10 +31,24 @@ ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) option(DD4HEP_USE_XERCESC "Enable 'Detector Builders' based on XercesC" OFF) option(DD4HEP_USE_PYROOT "Enable 'Detector Builders' based on PyROOT" OFF) # does not work (compile error) option(DD4HEP_USE_GEANT4 "Enable the simulation part based on Geant4" OFF) -#option(DD4HEP_USE_BOOST "build with boost - needed only if built with Geant4" OFF) option(DD4HEP_USE_GEAR "Build gear wrapper for backward compatibility" OFF) option(DD4HEP_USE_LCIO "Build lcio extensions" OFF) option(BUILD_TESTING "Enable and build tests" ON) +option(DD4HEP_USE_CXX11 "Build DD4hep using c++11" OFF) + + +#--------------------------------------------------------------------------------------------------- +#fg: moved to here from DD4hep.cmake to not force CMAKE_CXX_FLAGS upon dependent packages +if(DD4HEP_USE_CXX11) + SET( CMAKE_CXX_FLAGS "-std=c++11 -Wall -Wextra -pedantic -Wno-long-long -Wdeprecated -Wformat-security -Wshadow") + ADD_DEFINITIONs(-DDD4HEP_USE_CXX11) +else() + SET( CMAKE_CXX_FLAGS "-Wall -Wextra -pedantic -Wno-long-long") +endif() + +add_definitions(-DBOOST_SPIRIT_USE_PHOENIX_V3) + +#----------------------------------------------------------------------------------------------------- #For backward compatibility for now IF( DEFINED DD4HEP_WITH_GEANT4 ) diff --git a/cmake/DD4hep.cmake b/cmake/DD4hep.cmake index 9160c6271210bc2cc9754a38090a79f35a08d9b7..ab19d1fb0042ed831cfc404998fc1f3913c645ce 100644 --- a/cmake/DD4hep.cmake +++ b/cmake/DD4hep.cmake @@ -1,12 +1,3 @@ -#--------------------------------------------------------------------------------------------------- -if(DD4HEP_USE_CXX11) - SET( CMAKE_CXX_FLAGS "-std=c++11 -Wall -Wextra -pedantic -Wno-long-long -Wdeprecated -Wformat-security -Wshadow") - ADD_DEFINITIONs(-DDD4HEP_USE_CXX11) -else() - SET( CMAKE_CXX_FLAGS "-Wall -Wextra -pedantic -Wno-long-long") -endif() - -add_definitions(-DBOOST_SPIRIT_USE_PHOENIX_V3) #--------------------------------------------------------------------------------------------------- # add_dd4hep_plugin ( libraryName )