From 8f58e5a3ec0e4a15fc8ae0911cc864f5dbf86c6e Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Fri, 18 Aug 2017 15:56:55 +0200 Subject: build: Revise the build system This revises the build system to have configuration per system component. System settings can now be set using cmake. The standard compliance defines were removed from configuration header and are set in the sources where needed. Also some small code refactors, such as moving the data for shims out of the ipcp structure to the respective shims were performed. --- CMakeLists.txt | 32 +++++++++++--------------------- 1 file changed, 11 insertions(+), 21 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index ba56dc33..d4060d5f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,14 +10,10 @@ git_version_gen() include(GNUInstallDirs) set(PACKAGE_NAME "${CMAKE_PROJECT_NAME}") -set(PACKAGE_DESCRIPTION "The Ouroboros prototype" - CACHE STRING "Package description") -set(PACKAGE_URL "None" - CACHE STRING "Package URL") -set(PACKAGE_BUGREPORT "None" - CACHE STRING "Packaged bug-report email") -set(PACKAGE_VERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}" - CACHE STRING "Package version") +set(PACKAGE_DESCRIPTION "The Ouroboros prototype") +set(PACKAGE_URL "None") +set(PACKAGE_BUGREPORT "None") +set(PACKAGE_VERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}") if (APPLE) set(CMAKE_MACOSX_RPATH 1) @@ -72,15 +68,11 @@ test_and_set_c_compiler_flag_global(-Wunreachable-code) test_and_set_c_compiler_flag_global(-Wdeclaration-after-statement) test_and_set_c_compiler_flag_global(-fmax-errors=5) -configure_file( - "${CMAKE_CURRENT_SOURCE_DIR}/ouroboros.pc.in" - "${CMAKE_CURRENT_BINARY_DIR}/ouroboros.pc" - @ONLY) +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ouroboros.pc.in" + "${CMAKE_CURRENT_BINARY_DIR}/ouroboros.pc" @ONLY) -if (NOT APPLE) - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ouroboros.pc" - DESTINATION "/usr/lib/pkgconfig") -endif () +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ouroboros.pc" + DESTINATION "usr/lib/pkgconfig") enable_testing() add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND}) @@ -88,15 +80,13 @@ add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND}) find_package(ProtobufC REQUIRED) include_directories(${PROTOBUF_C_INCLUDE_DIRS}) -add_subdirectory(src) add_subdirectory(include) +add_subdirectory(src) add_subdirectory(doc) # Uninstall target -configure_file( - "${CMAKE_SOURCE_DIR}/cmake/CmakeUninstall.cmake.in" - "${CMAKE_BINARY_DIR}/cmake/CmakeUninstall.cmake" - IMMEDIATE @ONLY) +configure_file("${CMAKE_SOURCE_DIR}/cmake/CmakeUninstall.cmake.in" + "${CMAKE_BINARY_DIR}/cmake/CmakeUninstall.cmake" IMMEDIATE @ONLY) add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}/cmake/CmakeUninstall.cmake) -- cgit v1.2.3