From: Bastian Dehn Date: Sun, 14 Sep 2025 13:21:43 +0000 (+0200) Subject: move cmake files for lib into src X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=6c9163dc082ccbe2af2227f397c064ddcfad7c2c;p=discspan.git move cmake files for lib into src --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 9cbb069..d93f83e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,7 +29,7 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}/src) message(VERBOSE "Include directory: libs/spandisc/include") include_directories(libs/spandisc/src) message(STATUS "Include subproject spandisc: libs/spandisc") -add_subdirectory(libs/spandisc) +add_subdirectory(libs/spandisc/src) # create target from source file(GLOB SOURCES src/*.c) @@ -84,7 +84,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") set(CPACK_DEBIAN_DISCSPAN_PACKAGE_DEPENDS "discspan") endif() - include(libs/spandisc/CPackConfig.cmake) + include(libs/spandisc/src/CPackConfig.cmake) elseif (${CMAKE_SYSTEM_NAME} MATCHES "Windows") set(CPACK_GENERATOR "ZIP") endif() diff --git a/libs/spandisc/CMakeLists.txt b/libs/spandisc/CMakeLists.txt deleted file mode 100644 index 7b16242..0000000 --- a/libs/spandisc/CMakeLists.txt +++ /dev/null @@ -1,78 +0,0 @@ -cmake_minimum_required(VERSION 3.13.4) - -project(spandisc) - -set(CMAKE_INSTALL_PREFIX "/usr/local" CACHE PATH "Install prefix") -message(STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}") - -set(PROJECT_VERSION_MAJOR 1) -set(PROJECT_VERSION_MINOR 0) -set(PROJECT_VERSION_PATCH 0) -set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") - -option(BUILD_SHARED_LIBS "build shared libs" ON) - -# configure file -message(STATUS "Generating header: src/config_spandisc.h") -configure_file(${CMAKE_CURRENT_LIST_DIR}/src/config_spandisc.h.in - ${CMAKE_CURRENT_BINARY_DIR}/src/config_spandisc.h) -include_directories(${CMAKE_CURRENT_BINARY_DIR}/src) - -# add source files -file(GLOB SOURCES src/*.c) -file(GLOB PUBLIC_HEADER src/*.h) -message(VERBOSE "Include directory: include") -include_directories(include) - -message(STATUS "Option: BUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}") -if(BUILD_SHARED_LIBS) - message(STATUS "Build shared library") - add_library(spandisc SHARED ${SOURCES}) -else() - message(STATUS "Build static library") - add_library(spandisc STATIC ${SOURCES}) -endif() - -# set target -set_target_properties(spandisc PROPERTIES PUBLIC_HEADER "${PUBLIC_HEADER}") -target_link_libraries(spandisc m) - -message(STATUS "Install target spandisc") -message(VERBOSE "With component libspandisc") -message(VERBOSE "With component libspandisc-dev") - -if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") - install(TARGETS spandisc - DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" - COMPONENT libspandisc - PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_PREFIX}/include" - COMPONENT libspandisc-dev) -elseif (${CMAKE_SYSTEM_NAME} MATCHES "Windows") - install(TARGETS spandisc - COMPONENT libspandisc - COMPONENT libspandisc-dev) -endif() - -################################################################################ -# Build deb Packages -# -################################################################################ - -if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") - set(CPACK_GENERATOR "DEB") - set(CPACK_DEB_COMPONENT_INSTALL ON) - set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) - set(CPACK_DEBIAN_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}") - set(CPACK_DEBIAN_PACKAGE_RELEASE "1") - set(CPACK_DEBIAN_ARCHITECTURE "amd64") - set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Bastian Dehn