Fixed problem in DeviceSettings::strParam, returned wrong string
[avr-sim.git] / src / CMakeLists.txt
blob8049f8f05e60d31e400a20fbccf968d02c60a7c8
1 project(avr-sim)
3 if( AVRSIM_SCRIPTING )
4         find_package(Lua)
5         macro_log_feature(LUA_FOUND "LUA" "lua library" "http://" FALSE "" "")
6 endif()
8 find_package(Bfd)
9 macro_log_feature(BFD_FOUND "Bfd" "Bfd library" "http://" FALSE "" "")
11 # Display results, terminate if anything required is missing
12 MACRO_DISPLAY_FEATURE_LOG()
14 if( LUA_FOUND AND AVRSIM_SCRIPTING )
15         set( HAVE_LUA 1 )
16 endif()
18 if( BFD_FOUND )
19         set( HAVE_LIBBFD 1 )
20 endif()
22 configure_file(
23         ${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
24         ${CMAKE_CURRENT_BINARY_DIR}/config.h
27 set(LIBRARIES
28         ${XML2_LIBRARIES}
29         ${BFD_LIBRARIES}
30         ${LUA_LIBRARIES}
33 include_directories(
34         ${CMAKE_CURRENT_BINARY_DIR}
35         ${LUA_INCLUDE_DIRS}
36         ${BFD_INCLUDE_DIRS}
39 if( LUA_FOUND AND AVRSIM_SCRIPTING )
40         set( scripting
41                 script/VM
42                 script/Table
43                 script/RestoreStack
44                 script/Scriptable
45                 ScriptableAnalyzer
46                 ScriptEngine
47            )
48 endif()
50 add_library( avrsim
51         ${AVRSIM_LIB_TYPE}
53         ADC
54         Analyzer
55         BfdProgram
56         Bus
57         Core
58         DebugInterface
59         Decoder
60         Device
61         DeviceSettings
62         Eeprom
63         Exception
64         Flash
65         Format
66         GdbServer
67         HardwareFactory
68         HexProgram
69         Instructions
70         InstructionsTrace
71         Memory
72         MMU
73         Pin
74         Port
75         Program
76         Registers
77         SimulationClock
78         Spi
79         Stack
80         Timer16
81         Timer8
82         TimerInterrupts
83         TraceAnalyzer
84         Trace
85         Usart
86         VerboseInfo
87         ${scripting}
90 target_link_libraries(avrsim ${LIBRARIES})
91 set_target_properties(avrsim PROPERTIES VERSION ${AVRSIM_VERSION} SOVERSION ${AVRSIM_APIVERSION})
92 set_target_properties(avrsim PROPERTIES DEFINE_SYMBOL "AVRSIM_EXPORTS")
94 if(AVRSIM_INSTALL_HEADERS)
95         FILE(GLOB files
96                 "${CMAKE_CURRENT_SOURCE_DIR}/*.h"
97                 "${CMAKE_CURRENT_SOURCE_DIR}/*.inl")
98         install(FILES ${files} DESTINATION include/avr-sim)
99 endif(AVRSIM_INSTALL_HEADERS)
101 install(TARGETS avrsim
102                 RUNTIME DESTINATION bin
103                 LIBRARY DESTINATION lib
104                 ARCHIVE DESTINATION lib)
106 if( AVRSIM_BUILD_APP )
107         add_executable(avr-sim avr-sim.cpp)
108         target_link_libraries(avr-sim avrsim)
109         install(TARGETS avr-sim
110                    RUNTIME DESTINATION bin)
111 endif( AVRSIM_BUILD_APP )