| 1 |
# Distributed under the original FontForge BSD 3-clause license |
| 2 |
|
| 3 |
add_executable(fontforgeexe main.c) |
| 4 |
set_target_properties(fontforgeexe PROPERTIES OUTPUT_NAME "fontforge") |
| 5 |
|
| 6 |
if(ENABLE_GUI) |
| 7 |
target_sources(fontforgeexe PRIVATE |
| 8 |
alignment.c |
| 9 |
anchorsaway.c |
| 10 |
autowidth2dlg.c |
| 11 |
basedlg.c |
| 12 |
bdfinfo.c |
| 13 |
bitmapdlg.cpp |
| 14 |
bitmapview.c |
| 15 |
charinfo.c |
| 16 |
charview_private.h |
| 17 |
charview.c |
| 18 |
clipui.c |
| 19 |
combinations.c |
| 20 |
contextchain.c |
| 21 |
cursors.c |
| 22 |
cvaddpoints.c |
| 23 |
cvdebug.c |
| 24 |
cvdgloss.c |
| 25 |
cvexportdlg.c |
| 26 |
cvfreehand.c |
| 27 |
cvgetinfo.cpp |
| 28 |
cvgridfit.c |
| 29 |
cvhand.c |
| 30 |
cvhints.c |
| 31 |
cvimportdlg.c |
| 32 |
cvknife.c |
| 33 |
cvpalettes.c |
| 34 |
cvpointer.c |
| 35 |
cvruler.c |
| 36 |
cvruler.h |
| 37 |
cvshapes.c |
| 38 |
cvstroke.c |
| 39 |
cvtranstools.c |
| 40 |
deltaui.c |
| 41 |
displayfonts.c |
| 42 |
effectsui.c |
| 43 |
encodingui.c |
| 44 |
fontinfo.c |
| 45 |
fontview.c |
| 46 |
freetypeui.c |
| 47 |
fvfontsdlg.c |
| 48 |
fvmetricsdlg.c |
| 49 |
gotodlg.c |
| 50 |
groupsdlg.c |
| 51 |
histograms.cpp |
| 52 |
images.c |
| 53 |
justifydlg.c |
| 54 |
kernclass.c |
| 55 |
layer2layer.c |
| 56 |
lookupui.c |
| 57 |
macencui.c |
| 58 |
math.c |
| 59 |
metricsview.c |
| 60 |
mmdlg.c |
| 61 |
multidialog.c |
| 62 |
nonlineartransui.c |
| 63 |
openfontdlg.c |
| 64 |
pluginui.cpp |
| 65 |
prefs.c |
| 66 |
problems.cpp |
| 67 |
pythonui.c |
| 68 |
savefontdlg.c |
| 69 |
scriptingdlg.c |
| 70 |
scstylesui.c |
| 71 |
searchview.c |
| 72 |
sftextfield.c |
| 73 |
sftextfieldP.h |
| 74 |
sfundo.c |
| 75 |
sfundo.h |
| 76 |
showatt.c |
| 77 |
simplifydlg.c |
| 78 |
splashimage.c |
| 79 |
startui.c |
| 80 |
statemachine.c |
| 81 |
tilepath.c |
| 82 |
transform.c |
| 83 |
ttfinstrsui.c |
| 84 |
uiutil.c |
| 85 |
usermenu.c |
| 86 |
usermenu.h |
| 87 |
windowmenu.c |
| 88 |
wordlistparser.c |
| 89 |
wordlistparser.h |
| 90 |
) |
| 91 |
|
| 92 |
add_subdirectory(gtk) |
| 93 |
|
| 94 |
if(APPLE) |
| 95 |
target_sources(fontforgeexe PRIVATE macobjective.m) |
| 96 |
target_link_libraries(fontforgeexe |
| 97 |
PRIVATE |
| 98 |
"-framework Cocoa" |
| 99 |
) |
| 100 |
endif() |
| 101 |
|
| 102 |
if(ENABLE_FREETYPE_DEBUGGER) |
| 103 |
target_link_libraries(fontforgeexe PRIVATE Threads::Threads) |
| 104 |
endif() |
| 105 |
|
| 106 |
target_link_libraries(fontforgeexe PRIVATE |
| 107 |
gdraw |
| 108 |
shapers |
| 109 |
ffgtk |
| 110 |
) |
| 111 |
|
| 112 |
# GLIB is only needed for GUI builds |
| 113 |
if(TARGET GLIB::GLIB) |
| 114 |
target_link_libraries(fontforgeexe PRIVATE GLIB::GLIB PkgConfig::GLibMM) |
| 115 |
target_compile_definitions(fontforgeexe PRIVATE HAVE_GLIB=1) |
| 116 |
endif() |
| 117 |
else() |
| 118 |
target_sources(fontforgeexe PRIVATE startnoui.c) |
| 119 |
endif() |
| 120 |
|
| 121 |
if(WIN32) |
| 122 |
string(SUBSTRING ${PROJECT_VERSION} 0 4 FF_RC_YEAR) |
| 123 |
string(SUBSTRING ${PROJECT_VERSION} 4 2 FF_RC_MONTH) |
| 124 |
string(SUBSTRING ${PROJECT_VERSION} 6 2 FF_RC_DAY) |
| 125 |
string(REGEX REPLACE "^0+" "" FF_RC_MONTH "${FF_RC_MONTH}") |
| 126 |
string(REGEX REPLACE "^0+" "" FF_RC_DAY "${FF_RC_DAY}") |
| 127 |
configure_file(fontforge.exe.manifest.in fontforge.exe.manifest @ONLY) |
| 128 |
configure_file(fontforge.rc.in fontforge.rc @ONLY) |
| 129 |
# Only add .rc file - it already includes the manifest via RT_MANIFEST |
| 130 |
target_sources(fontforgeexe PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/fontforge.rc") |
| 131 |
|
| 132 |
# For MSVC, disable automatic manifest embedding since we include it in the .rc file |
| 133 |
if(MSVC) |
| 134 |
target_link_options(fontforgeexe PRIVATE "/MANIFEST:NO") |
| 135 |
endif() |
| 136 |
endif() |
| 137 |
|
| 138 |
if(ENABLE_PYTHON_SCRIPTING_RESULT) |
| 139 |
target_link_libraries(fontforgeexe PRIVATE Python3::Python) |
| 140 |
endif() |
| 141 |
|
| 142 |
target_link_libraries(fontforgeexe PRIVATE fontforge Iconv::Iconv MathLib::MathLib) |
| 143 |
install(TARGETS fontforgeexe RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) |
| 144 |
|
| 145 |
if(UNIX) |
| 146 |
install(CODE " |
| 147 |
foreach(_script fontimage.pe fontlint.pe sfddiff.pe) |
| 148 |
get_filename_component(_output \"\${_script}\" NAME_WE) |
| 149 |
file(READ \"${CMAKE_CURRENT_SOURCE_DIR}/\${_script}\" _input) |
| 150 |
file(WRITE \"${CMAKE_CURRENT_BINARY_DIR}/\${_output}\" \"#!\${CMAKE_INSTALL_PREFIX}/bin/fontforge -lang=ff\\n\${_input}\") |
| 151 |
endforeach() |
| 152 |
" COMPONENT nativescripts) |
| 153 |
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/fontimage" "${CMAKE_CURRENT_BINARY_DIR}/fontlint" "${CMAKE_CURRENT_BINARY_DIR}/sfddiff" |
| 154 |
DESTINATION ${CMAKE_INSTALL_BINDIR} |
| 155 |
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE |
| 156 |
COMPONENT nativescripts |
| 157 |
) |
| 158 |
else() |
| 159 |
install(FILES fontimage.pe fontlint.pe sfddiff.pe DESTINATION ${CMAKE_INSTALL_DATADIR}/fontforge/nativescripts COMPONENT nativescripts) |
| 160 |
endif() |
| 161 |
install(FILES fontforge.1 sfddiff.1 fontlint.1 fontimage.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) |
| 162 |
|
| 163 |
if(ENABLE_GUI) |
| 164 |
add_subdirectory(pixmaps) |
| 165 |
endif() |