]> granicus.if.org Git - graphviz/commitdiff
Restructure root CMakeLists.txt
authorErwin Janssen <erwinjanssen@outlook.com>
Tue, 3 Jan 2017 09:31:43 +0000 (10:31 +0100)
committerErwin Janssen <erwinjanssen@outlook.com>
Thu, 19 Jan 2017 11:53:49 +0000 (12:53 +0100)
Improve clairity of the file. Also bumps the version number to 2.41.

CMakeLists.txt

index 2200d203727cf69166e40247eb6d647f03aee3ee..ea9a32c4f3c8976c02e385a2c55634c282b38cc7 100644 (file)
@@ -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)