~cern-kicad/kicad/kicad-pns-tom

« back to all changes in this revision

Viewing changes to bitmaps_png/CMakeLists.txt

  • Committer: Maciej Suminski
  • Date: 2013-08-02 13:57:24 UTC
  • mfrom: (4024.1.238 kicad)
  • mto: This revision was merged to the branch mainline in revision 4221.
  • Revision ID: maciej.suminski@cern.ch-20130802135724-gix6orezshkukodv
Upstream merge.

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
#
44
44
# 1) inkscape - command line mode is used, must be on your PATH
45
45
# 2) pngcrush - this program must be on your PATH
46
 
# 3) Under Windows only:
47
 
#           dos2unix - to convert End Of Lines to unix EOL (CRLF to LF)
48
 
#           this program must be on your PATH
49
46
#
50
47
 
51
48
# lower case is used for local variables, uppercase for global variables
71
68
        "Set to true if you are a PNG maintainer and have the required tools given in the bitmaps_png/CMakeLists.txt file (default OFF)."
72
69
        OFF)
73
70
 
74
 
 
75
71
# Used Only to maintain PNG files (and therefore to recreate .cpp files)
76
72
# The png2cpp creates files with native End of Line format.
77
 
# To avoid mixed EOF formats in these .cpp files, it is good to
78
 
# convert them in Unix EOL format (LF)
79
 
# Under Windows, the well known dos2unix.exe does the conversion
80
 
# It is installed with MinGW and MSYS.
81
 
# It is very easy to install (just an executable to copy in a known path) if it is missing
82
 
 
83
 
if( WIN32 )
84
 
    set( CONVERT_EOL true )
85
 
    set( eol2unix_converter dos2unix )
86
 
else()
87
 
    set( CONVERT_EOL false )
88
 
endif( WIN32 )
89
73
 
90
74
include_directories(BEFORE ${INC_BEFORE})
91
75
include_directories(
431
415
    pad
432
416
    pad_dimensions
433
417
    pads_mask_layers
 
418
    pagelayout_load
 
419
    pagelayout_load_default
 
420
    pagelayout_new
 
421
    pagelayout_recent
 
422
    pagelayout_normal_view_mode
 
423
    pagelayout_special_view_mode
434
424
    palette
435
425
    part_properties
436
426
    paste
555
545
    icon_pcbcalculator
556
546
    libedit_icon
557
547
    viewlibs_icon
 
548
    icon_pagelayout_editor
558
549
    )
559
550
 
560
551
 
596
587
 
597
588
# Function png2cpp
598
589
# converts a single *.png to *.cpp
599
 
if( CONVERT_EOL )
600
 
function( png2cpp inputFile outFile )
601
 
    add_custom_command(
602
 
        OUTPUT  ${outFile}
603
 
 
604
 
        COMMAND rm -f ${outFile}.tmp
605
 
        COMMAND ${CMAKE_COMMAND} -DinputFile=${inputFile} -DoutCppFile=${outFile}
606
 
            -P ${CMAKE_MODULE_PATH}/PNG2cpp.cmake
607
 
 
608
 
        DEPENDS ${inputFile} ${CMAKE_MODULE_PATH}/PNG2cpp.cmake
609
 
 
610
 
        POST_BUILD
611
 
        COMMAND ${eol2unix_EXECUTABLE} ${outFile}
612
 
 
613
 
        COMMENT "Creating (with unix eol) ${outFile}"
614
 
    )
615
 
endfunction()
616
 
 
617
 
else( CONVERT_EOL )
618
590
function( png2cpp inputFile outFile )
619
591
    add_custom_command(
620
592
        OUTPUT  ${outFile}
627
599
        )
628
600
endfunction()
629
601
 
630
 
endif(CONVERT_EOL)
631
 
 
632
602
 
633
603
# Function bitmap_dir
634
604
# converts all the basenames in bmapList found in hardcoded 'sources' dir