@ -95,7 +95,7 @@ else(CLANG)
# A s C L A N G i s n o t s e t a s a v a r i a b l e , w e n e e d t o s e t i t i n c a s e w e h a v e n o t m a t c h e d a n o t h e r c o m p i l e r .
set ( CLANG ON )
# S e t s t a n d a r d f l a g s f o r c l a n g
set ( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -funroll-loops -O4" )
set ( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -funroll-loops -O4" )
set ( CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++ -Wall -Werror -pedantic -Wno-unused-variable -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE" )
set ( CMAKE_CXX_FLAGS_DEBUG "-g" )
@ -131,6 +131,7 @@ file(GLOB_RECURSE STORM_IR_FILES ${PROJECT_SOURCE_DIR}/src/ir/*.h ${PROJECT_SOUR
# T e s t S o u r c e s
# N o t e t h a t t h e t e s t s a l s o n e e d t h e s o u r c e f i l e s , e x c e p t f o r t h e m a i n f i l e
file ( GLOB_RECURSE STORM_FUNCTIONAL_TEST_FILES ${ PROJECT_SOURCE_DIR } /test/functional/*.h ${ PROJECT_SOURCE_DIR } /test/functional/*.cpp )
file ( GLOB_RECURSE STORM_PERFORMANCE_TEST_FILES ${ PROJECT_SOURCE_DIR } /test/performance/*.h ${ PROJECT_SOURCE_DIR } /test/performance/*.cpp )
# G r o u p t h e h e a d e r s a n d s o u r c e s
source_group ( main FILES ${ STORM_MAIN_FILE } )
@ -143,7 +144,8 @@ source_group(parser FILES ${STORM_PARSER_FILES})
source_group ( storage FILES ${ STORM_STORAGE_FILES } )
source_group ( utility FILES ${ STORM_UTILITY_FILES } )
source_group ( ir FILES ${ STORM_IR_FILES } )
source_group ( test FILES ${ STORM_TEST_FILES } )
source_group ( functional-test FILES ${ STORM_FUNCTIONAL_TEST_FILES } )
source_group ( performance-test FILES ${ STORM_PERFORMANCE_TEST_FILES } )
# A d d b a s e f o l d e r f o r b e t t e r i n c l u s i o n p a t h s
include_directories ( "${PROJECT_SOURCE_DIR}" )
@ -231,11 +233,13 @@ add_executable(storm-performance-tests ${STORM_PERFORMANCE_TEST_FILES} ${STORM_S
# A d d t a r g e t l i n k d e p s f o r B o o s t p r o g r a m o p t i o n s
target_link_libraries ( storm ${ Boost_LIBRARIES } )
target_link_libraries ( storm-tests ${ Boost_LIBRARIES } )
target_link_libraries ( storm-functional-tests ${ Boost_LIBRARIES } )
target_link_libraries ( storm-performance-tests ${ Boost_LIBRARIES } )
if ( USE_INTELTBB )
target_link_libraries ( storm tbb tbbmalloc )
target_link_libraries ( storm-tests tbb tbbmalloc )
target_link_libraries ( storm-functional-tests tbb tbbmalloc )
target_link_libraries ( storm-performance-tests tbb tbbmalloc )
endif ( USE_INTELTBB )
if ( APPLE )
@ -256,14 +260,16 @@ if (STORM_USE_COTIRE)
cotire ( storm )
target_link_libraries ( storm_unity ${ Boost_LIBRARIES } )
# cotire ( storm-tests )
# cotire ( storm-functional-tests )
# cotire ( storm-performance-tests )
endif ( )
# L i n k a g a i n s t l i b c + + a b i i f r e q u e s t e d . M a y b e n e e d e d t o b u i l d o n L i n u x s y s t e m s u s i n g c l a n g .
if ( LINK_LIBCXXABI )
message ( STATUS "Linking against libc++abi." )
target_link_libraries ( storm "c++abi" )
target_link_libraries ( storm-tests "c++abi" )
target_link_libraries ( storm-functional-tests "c++abi" )
target_link_libraries ( storm-performance-tests "c++abi" )
endif ( LINK_LIBCXXABI )
# A d d a t a r g e t t o g e n e r a t e A P I d o c u m e n t a t i o n w i t h D o x y g e n
@ -282,9 +288,11 @@ if (GTEST_INCLUDE_DIR)
enable_testing ( )
include_directories ( ${ GTEST_INCLUDE_DIR } )
target_link_libraries ( storm-tests ${ GTEST_LIBRARIES } )
target_link_libraries ( storm-functional-tests ${ GTEST_LIBRARIES } )
target_link_libraries ( storm-performance-tests ${ GTEST_LIBRARIES } )
add_test ( NAME storm-tests COMMAND storm-tests )
add_test ( NAME storm-functional-tests COMMAND storm-functional-tests )
add_test ( NAME storm-performance-tests COMMAND storm-performance-tests )
if ( MSVC ) # V S 2 0 1 2 d o e s n ' t s u p p o r t c o r r e c t l y t h e t u p l e s y e t
add_definitions ( /D _VARIADIC_MAX=10 )
endif ( )
@ -296,20 +304,23 @@ if (LOG4CPLUS_INCLUDE_DIR)
if ( STORM_USE_COTIRE )
target_link_libraries ( storm_unity ${ LOG4CPLUS_LIBRARIES } )
endif ( STORM_USE_COTIRE )
target_link_libraries ( storm-tests ${ LOG4CPLUS_LIBRARIES } )
target_link_libraries ( storm-functional-tests ${ LOG4CPLUS_LIBRARIES } )
target_link_libraries ( storm-performance-tests ${ LOG4CPLUS_LIBRARIES } )
# O n L i n u x , w e h a v e t o l i n k a g a i n s t l i b r t
if ( UNIX AND NOT APPLE )
target_link_libraries ( storm rt )
if ( STORM_USE_COTIRE )
target_link_libraries ( storm_unity rt )
endif ( STORM_USE_COTIRE )
target_link_libraries ( storm-tests rt )
target_link_libraries ( storm-functional-tests rt )
target_link_libraries ( storm-performance-tests rt )
endif ( UNIX AND NOT APPLE )
endif ( LOG4CPLUS_INCLUDE_DIR )
if ( CUDD_LIBRARY_DIRS )
target_link_libraries ( storm "-lobj -lcudd -lmtr -lst -lutil -lepd" )
target_link_libraries ( storm-tests "-lobj -lcudd -lmtr -lst -lutil -lepd" )
target_link_libraries ( storm-functional-tests "-lobj -lcudd -lmtr -lst -lutil -lepd" )
target_link_libraries ( storm-performance-tests "-lobj -lcudd -lmtr -lst -lutil -lepd" )
endif ( CUDD_LIBRARY_DIRS )
if ( THREADS_FOUND )
@ -318,7 +329,8 @@ if (THREADS_FOUND)
if ( STORM_USE_COTIRE )
target_link_libraries ( storm_unity ${ CMAKE_THREAD_LIBS_INIT } )
endif ( STORM_USE_COTIRE )
target_link_libraries ( storm-tests ${ CMAKE_THREAD_LIBS_INIT } )
target_link_libraries ( storm-functional-tests ${ CMAKE_THREAD_LIBS_INIT } )
target_link_libraries ( storm-performance-tests ${ CMAKE_THREAD_LIBS_INIT } )
endif ( THREADS_FOUND )
# C o n f i g u r e a h e a d e r f i l e t o p a s s s o m e o f t h e C M a k e s e t t i n g s t o t h e s o u r c e c o d e
@ -327,10 +339,9 @@ configure_file (
" $ { P R O J E C T _ B I N A R Y _ D I R } / s t o r m - c o n f i g . h "
)
add_custom_target ( memcheck valgrind --leak-check=full --show-reachable=yes ${ PROJECT_BINARY_DIR } /storm -v --fix-deadlocks ${ PROJECT_SOURCE_DIR } /examples/dtmc/crowds/crowds5_5.tra examples/dtmc/crowds/crowds5_5.lab
D E P E N D S s t o r m )
add_custom_target ( memcheck-tests valgrind --leak-check=full --show-reachable=yes ${ PROJECT_BINARY_DIR } /storm-tests -v --fix-deadlocks
D E P E N D S s t o r m - t e s t s )
add_custom_target ( memcheck valgrind --leak-check=full --show-reachable=yes ${ PROJECT_BINARY_DIR } /storm -v --fix-deadlocks ${ PROJECT_SOURCE_DIR } /examples/dtmc/crowds/crowds5_5.tra examples/dtmc/crowds/crowds5_5.lab DEPENDS storm )
add_custom_target ( memcheck-functional-tests valgrind --leak-check=full --show-reachable=yes ${ PROJECT_BINARY_DIR } /storm-functional-tests -v --fix-deadlocks DEPENDS storm-functional-tests )
add_custom_target ( memcheck-performance-tests valgrind --leak-check=full --show-reachable=yes ${ PROJECT_BINARY_DIR } /storm-performance-tests -v --fix-deadlocks DEPENDS storm-performance-tests )
set ( CPPLINT_ARGS --filter=-whitespace/tab,-whitespace/line_length,-legal/copyright,-readability/streams )
add_custom_target ( style python cpplint.py ${ CPPLINT_ARGS } `find ./src/ -iname "*.h" -or -iname "*.cpp" ` )