From 58cae29696c85f66bde9b73072574416397214ab Mon Sep 17 00:00:00 2001 From: Erwin Janssen Date: Tue, 3 Jan 2017 10:31:43 +0100 Subject: [PATCH] Restructure root CMakeLists.txt Improve clairity of the file. Also bumps the version number to 2.41. --- CMakeLists.txt | 62 +++++++++++++++++++++++++------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2200d2037..ea9a32c4f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,15 +1,31 @@ cmake_minimum_required (VERSION 2.8 FATAL_ERROR) +project (Graphviz) + +# Append local CMake module directory +# =================================== list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") -# Required to set build version +# Build dependencies +# ================== find_package(Git REQUIRED) +find_package(BISON REQUIRED) +find_package(FLEX REQUIRED) -# General project information -# =========================== -project (Graphviz) +# 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) +set(TOP_SOURCE_DIR "${CMAKE_SOURCE_DIR}") +set(GRAPHVIZ_LIB_DIR "${CMAKE_CURRENT_SOURCE_DIR}/lib") +# Set Graphviz version +# ==================== set(GRAPHVIZ_VERSION_MAJROR 2) -set(GRAPHVIZ_VERSION_MINOR 39) +set(GRAPHVIZ_VERSION_MINOR 41) # Set GRAPHVIZ_VERSION_BUILD to time of last commit, or to 0 if that fails. execute_process( @@ -28,42 +44,26 @@ endif() message(STATUS "Graphviz version: ${GRAPHVIZ_VERSION_MAJROR}.${GRAPHVIZ_VERSION_MINOR}.${GRAPHVIZ_VERSION_BUILD}") -# Build dependencies -# ================== -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) -set(GRAPHVIZ_LIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib) - # Check avaiable headers, functions and libraries and write the result to config.h # ================================================================================ include(config_checks) include_directories(${CMAKE_CURRENT_BINARY_DIR}) +# Custom target for `make uninstall` +# ================================== +configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" + IMMEDIATE @ONLY) + +add_custom_target(uninstall + COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) + # Packaging information # ===================== set(CPACK_GENERATOR ZIP) - include(CPack) # Specify subdirectories to build # =============================== add_subdirectory(lib) - -# Uninstall target -# ================ -configure_file( - "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" - IMMEDIATE @ONLY) - -add_custom_target(uninstall - COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) -- 2.40.0