1 if( NOT LIBPCAP_PRECONFIGURED ) 2 set( LIBPCAP_PRECONFIGURED TRUE ) 3 4 ################################################################### 5 # Parameters 6 ################################################################### 7 8 option (USE_STATIC_RT "Use static Runtime" ON) 9 10 ###################################### 11 # Project setings 12 ###################################### 13 14 add_definitions( -DBUILDING_PCAP ) 15 16 if( MSVC ) 17 add_definitions( -D__STDC__ ) 18 add_definitions( -D_CRT_SECURE_NO_WARNINGS ) 19 add_definitions( "-D_U_=" ) 20 elseif( CMAKE_COMPILER_IS_GNUCXX ) 21 add_definitions( "-D_U_=__attribute__((unused))" ) 22 else(MSVC) 23 add_definitions( "-D_U_=" ) 24 endif( MSVC ) 25 26 if (USE_STATIC_RT) 27 MESSAGE( STATUS "Use STATIC runtime" ) 28 29 if( MSVC ) 30 set (CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /MT") 31 set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MT") 32 set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT") 33 set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd") 34 35 set (CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} /MT") 36 set (CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /MT") 37 set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT") 38 set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd") 39 endif( MSVC ) 40 else (USE_STATIC_RT) 41 MESSAGE( STATUS "Use DYNAMIC runtime" ) 42 43 if( MSVC ) 44 set (CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /MD") 45 set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MD") 46 set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD") 47 set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd") 48 49 set (CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} /MD") 50 set (CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /MD") 51 set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MD") 52 set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MDd") 53 endif( MSVC ) 54 endif (USE_STATIC_RT) 55 endif( NOT LIBPCAP_PRECONFIGURED ) 56