1 cmake_minimum_required(VERSION 2.6)
4 set( AVRSIM_VERSION "1.0" )
5 set( AVRSIM_APIVERSION "1.0" )
7 # Include necessary submodules
9 "${AVRSIM_SOURCE_DIR}/CMake"
10 "${AVRSIM_SOURCE_DIR}/CMake/Utils"
11 "${AVRSIM_SOURCE_DIR}/CMake/Packages"
14 include(MacroLogFeature)
17 # Create debug libraries with _d postfix
18 set(CMAKE_DEBUG_POSTFIX "_d")
21 option(AVRSIM_STATIC "Static build" FALSE)
22 option(AVRSIM_64BIT "64 bit" TRUE)
24 # Set compiler specific build flags
25 if (CMAKE_COMPILER_IS_GNUCXX)
27 set( CMAKE_COMPILER_CPU -mtune=opteron -DCPU=ATHLON )
30 if( CMAKE_BUILD_TYPE STREQUAL "release" )
31 add_definitions( -O3 -DNDEBUG -fomit-frame-pointer -falign-functions=4 -fexpensive-optimizations -fschedule-insns2 -finline-functions -funroll-loops -mfpmath=sse -msse2 -msse -mmmx -frerun-cse-after-loop -frerun-loop-opt -fno-strict-aliasing )
32 endif( CMAKE_BUILD_TYPE STREQUAL "release" )
34 add_definitions( ${CMAKE_COMPILER_CPU} "-W -Wall -pipe -DLINUX -DUNIX -fexceptions -DHAVE_LONGLONG" )
36 set( CMAKE_CXX_FLAGS_DEBUG "-DDEBUG -g2" )
39 # add_definitions(/fp:fast)
40 add_definitions(/D _CRT_SECURE_NO_WARNINGS /EHa)
43 include(ConfigureBuild)
48 # Customize what to build
49 option(AVRSIM_BUILD_APP "Build application" TRUE)
51 # Customize what to install
52 option(AVRSIM_INSTALL_HEADERS "Install header files" TRUE)
55 include_directories( ${AVRSIM_SOURCE_DIR}/src )
56 add_subdirectory( src )
57 set( AVRSIM_LIBRARIES avr-sim )