CMakeLists.txt 3.2 KB
Newer Older
1
add_definitions(-DGERBVIEW)
2

Jerry Jacobs's avatar
Jerry Jacobs committed
3 4 5
###
# Includes
###
6 7 8 9 10 11 12 13 14 15 16

include_directories(BEFORE ${INC_BEFORE})
include_directories(
    ../pcbnew
    dialogs
    ../3d-viewer
    ../polygon
    ${INC_AFTER}
    )


Jerry Jacobs's avatar
Jerry Jacobs committed
17 18 19
###
# Sources
###
20

21 22 23
set(DIALOGS_SRCS
    dialogs/gerbview_dialog_display_options_frame_base.cpp
    dialogs/gerbview_dialog_display_options_frame.cpp
24
    dialogs/dialog_layers_select_to_pcb_base.cpp
25 26
    dialogs/dialog_print_using_printer.cpp
    dialogs/dialog_print_using_printer_base.cpp
27 28 29
    dialogs/dialog_select_one_pcb_layer.cpp
    dialogs/dialog_show_page_borders.cpp
    dialogs/dialog_show_page_borders_base.cpp
30 31
    )

f3nix's avatar
f3nix committed
32
set(GERBVIEW_SRCS
f3nix's avatar
f3nix committed
33
    block.cpp
34
    class_am_param.cpp
35
    class_aperture_macro.cpp
36
    class_DCodeSelectionbox.cpp
37
    class_gbr_screen.cpp
38
    class_gbr_layout.cpp
39 40
    class_GERBER.cpp
    class_gerber_draw_item.cpp
charras's avatar
charras committed
41
    class_gerbview_layer_widget.cpp
42
    class_gbr_layer_box_selector.cpp
f3nix's avatar
f3nix committed
43 44
    controle.cpp
    dcode.cpp
45
    draw_gerber_screen.cpp
46
    events_called_functions.cpp
47
    excellon_read_drill_file.cpp
f3nix's avatar
f3nix committed
48 49 50
    export_to_pcbnew.cpp
    files.cpp
    gerbview.cpp
51 52
    gerbview_config.cpp
    gerbview_frame.cpp
f3nix's avatar
f3nix committed
53 54 55
    hotkeys.cpp
    initpcb.cpp
    locate.cpp
56
    menubar.cpp
57
    onleftclick.cpp
f3nix's avatar
f3nix committed
58 59 60
    onrightclick.cpp
    pcbplot.cpp
    readgerb.cpp
61
    rs274_read_XY_and_IJ_coordinates.cpp
f3nix's avatar
f3nix committed
62 63 64
    rs274d.cpp
    rs274x.cpp
    select_layers_to_pcb.cpp
65 66
    toolbars_gerber.cpp
    )
67

Jerry Jacobs's avatar
Jerry Jacobs committed
68
###
69
# We need some extra sources from common and pcbnew
Jerry Jacobs's avatar
Jerry Jacobs committed
70
###
f3nix's avatar
f3nix committed
71
set(GERBVIEW_EXTRA_SRCS
72
    ../common/base_screen.cpp
73
    ../common/base_units.cpp
74 75
    ../common/class_layer_box_selector.cpp
    ../common/class_page_info.cpp
charras's avatar
charras committed
76
    ../pcbnew/layer_widget.cpp
77
    ../pcbnew/printout_controler.cpp
78
)
79

Jerry Jacobs's avatar
Jerry Jacobs committed
80 81 82
###
# Windows resource file
###
f3nix's avatar
f3nix committed
83 84
if(WIN32)
    if(MINGW)
f3nix's avatar
f3nix committed
85
        # GERBVIEW_RESOURCES variable is set by the macro.
f3nix's avatar
f3nix committed
86
        mingw_resource_compiler(gerbview)
f3nix's avatar
f3nix committed
87 88 89 90
    else(MINGW)
        set(GERBVIEW_RESOURCES gerbview.rc)
    endif(MINGW)
endif(WIN32)
f3nix's avatar
f3nix committed
91

Jerry Jacobs's avatar
Jerry Jacobs committed
92 93 94
###
# Apple resource files
###
f3nix's avatar
f3nix committed
95
if(APPLE)
96
    set(GERBVIEW_RESOURCES gerbview.icns gerbview_doc.icns)
kintel's avatar
kintel committed
97
    set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/gerbview.icns"
f3nix's avatar
f3nix committed
98
                                PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
99 100
    set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/gerbview_doc.icns"
                                PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
kintel's avatar
kintel committed
101 102
    set(MACOSX_BUNDLE_ICON_FILE gerbview.icns)
    set(MACOSX_BUNDLE_GUI_IDENTIFIER org.kicad-eda.gerbview)
f3nix's avatar
f3nix committed
103
endif(APPLE)
104

Jerry Jacobs's avatar
Jerry Jacobs committed
105 106 107 108 109
###
# Create the gerbview executable
###
add_executable(gerbview WIN32 MACOSX_BUNDLE
               ${GERBVIEW_SRCS}
110
               ${DIALOGS_SRCS}
111
               ${GERBVIEW_EXTRA_SRCS}
Jerry Jacobs's avatar
Jerry Jacobs committed
112
               ${GERBVIEW_RESOURCES})
113

Jerry Jacobs's avatar
Jerry Jacobs committed
114 115 116
###
# Set properties for APPLE on gerbview target
###
117
if(APPLE)
Jerry Jacobs's avatar
Jerry Jacobs committed
118
    set_target_properties(gerbview PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist)
119 120
endif(APPLE)

Jerry Jacobs's avatar
Jerry Jacobs committed
121 122 123
###
# Link executable target gerbview with correct libraries
###
124
target_link_libraries(gerbview common polygon bitmaps kbool
Jerry Jacobs's avatar
Jerry Jacobs committed
125 126 127
                      ${OPENGL_LIBRARIES}
                      ${wxWidgets_LIBRARIES}
                      ${GDI_PLUS_LIBRARIES})
128

Jerry Jacobs's avatar
Jerry Jacobs committed
129 130 131 132
###
# Add gerbview as install target
###
install(TARGETS gerbview
133
        DESTINATION ${KICAD_BIN}
kintel's avatar
kintel committed
134
        COMPONENT binary)