find_package(BISON REQUIRED)
find_package(FLEX REQUIRED)
+# Convenient values for CMake configuration
+# =========================================
+set(BINARY_INSTALL_DIR bin)
+set(LIBRARY_INSTALL_DIR lib)
+set(HEADER_INSTALL_DIR include/graphviz)
+set(MAN_INSTALL_DIR share/man/man3)
+# TODO: Find a way to check for groff and ps2pdf for manpage pdf generation
+# set(MAN_PDF_INSTALL_DIR share/graphviz/doc/pdf)
+
+
+# Packaging information
+# =====================
+set(CPACK_GENERATOR ZIP)
+
+include(CPack)
+
add_subdirectory(lib)
cd build;
cmake ..;
cmake --build . --config $env:configuration;
+ if($env:configuration -eq "Release") {
+ cpack;
+ }
}
if ($env:build_system -eq "msys2" -Or $env:compiler -eq "cygwin") {
echo "Error: 'cmake --build .' failed." >&2
exit 1
fi
+
+if cpack ; then
+ echo "'cpack' succesfull."
+else
+ echo "Error: 'cpack' failed." >&2
+ exit 1
+fi
+
+if make install ; then
+ echo "'make install' succesfull."
+else
+ echo "Error: 'make install' failed." >&2
+ exit 1
+fi
# Link definition file for Windows
cdt.def
)
+
+# Installation location of library files
+install(
+ TARGETS cdt
+ RUNTIME DESTINATION ${BINARY_INSTALL_DIR}
+ LIBRARY DESTINATION ${LIBRARY_INSTALL_DIR}
+ ARCHIVE DESTINATION ${LIBRARY_INSTALL_DIR}
+)
+
+# Installation location of header files
+install(
+ FILES cdt.h
+ DESTINATION ${HEADER_INSTALL_DIR}
+)
+
+# Installation location of man page
+install(
+ FILES cdt.3
+ DESTINATION ${MAN_INSTALL_DIR}
+)