3 # Copyright (C) 2008 Werner Smekal
5 # create demo executables
8 # =======================================================================
9 # source file names and c flags
10 # =======================================================================
43 # we need to add some definitions for win 32
45 if(WIN32 AND NOT CYGWIN)
46 set(DEMO_C_FLAGS "-D__WIN32__")
47 endif(WIN32 AND NOT CYGWIN)
49 # link the examples to the shared library otherwise to the static
51 set(_LIBHARU_LIB ${LIBHARU_NAME})
52 if(WIN32 AND NOT CYGWIN)
53 set(DEMO_C_FLAGS "${DEMO_C_FLAGS} -DHPDF_DLL")
54 endif(WIN32 AND NOT CYGWIN)
56 set(_LIBHARU_LIB ${LIBHARU_NAME_STATIC})
59 # =======================================================================
61 # =======================================================================
62 foreach(demo ${demos_NAMES})
63 add_executable(${demo} ${demo}.c)
64 target_link_libraries(${demo} ${_LIBHARU_LIB})
66 set_target_properties(${demo} PROPERTIES COMPILE_FLAGS ${DEMO_C_FLAGS})
70 # some demos need grid_sheet.c compiled in
71 foreach(demo ${demos_with_grid_NAMES})
72 add_executable(${demo} ${demo}.c grid_sheet.c)
73 target_link_libraries(${demo} ${_LIBHARU_LIB})
75 set_target_properties(${demo} PROPERTIES COMPILE_FLAGS ${DEMO_C_FLAGS})
79 # the grid_sheet demo needs extra defines
80 add_executable(grid_sheet grid_sheet.c)
81 target_link_libraries(grid_sheet ${_LIBHARU_LIB})
82 set_target_properties(grid_sheet PROPERTIES COMPILE_FLAGS "${DEMO_C_FLAGS} -DSTAND_ALONE")
84 # =======================================================================
85 # install demo source, demo executables and other files
86 # =======================================================================
88 TARGETS ${demos_NAMES} ${demos_with_grid_NAMES} grid_sheet
91 foreach(demo ${demos_NAMES} ${demos_with_grid_NAMES} grid_sheet)
92 install(FILES ${demo}.c DESTINATION demo)
97 DIRECTORY images mbtext pngsuite rawimage ttfont type1
100 endif(LIBHARU_EXAMPLES)