tangentia

CMakeLists - mod_bw-0.92.txt

Dec 31st, 2025 (edited)
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CMake 2.13 KB | None | 0 0
  1. # Licensed to the Apache Software Foundation (ASF) under one or more
  2. # contributor license agreements.  See the NOTICE file distributed with
  3. # this work for additional information regarding copyright ownership.
  4. # The ASF licenses this file to You under the Apache License, Version 2.0
  5. # (the "License"); you may not use this file except in compliance with
  6. # the License.  You may obtain a copy of the License at
  7. #
  8. #     http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. #
  16. CMAKE_MINIMUM_REQUIRED(VERSION 3.15)
  17.  
  18. PROJECT(mod_bw C)
  19.  
  20. IF(NOT EXISTS ${CMAKE_INSTALL_PREFIX}/lib/libhttpd.lib)
  21.   MESSAGE(FATAL_ERROR "libhttpd.lib was not found in prefix ${CMAKE_INSTALL_PREFIX}")
  22. ENDIF()
  23.  
  24. # Select APR trunk (libapr-2.lib) if it exists in PREFIX/lib; otherwise, select
  25. # APR 1.x + APR-util 1.x
  26. #
  27. IF(EXISTS "${CMAKE_INSTALL_PREFIX}/lib/libapr-2.lib")
  28.   SET(apr_libraries
  29.     ${CMAKE_INSTALL_PREFIX}/lib/libapr-2.lib)
  30. ELSEIF(EXISTS "${CMAKE_INSTALL_PREFIX}/lib/libapr-1.lib")
  31.   SET(apr_libraries
  32.     ${CMAKE_INSTALL_PREFIX}/lib/libapr-1.lib
  33.     ${CMAKE_INSTALL_PREFIX}/lib/libaprutil-1.lib)
  34. ELSE()
  35.   MESSAGE(FATAL_ERROR "APR libraries were not found in prefix ${CMAKE_INSTALL_PREFIX}")
  36. ENDIF()
  37.  
  38. # Extra libraries.
  39. #
  40. SET(extra_libraries winmm.lib)
  41.  
  42. # Miscellaneous options.
  43. #
  44. OPTION(INSTALL_PDB "Install .pdb file (if generated)" OFF)
  45.  
  46. SET(mod_bw_sources
  47.     mod_bw.c
  48. )
  49.  
  50. INCLUDE_DIRECTORIES(${CMAKE_INSTALL_PREFIX}/include)
  51. ADD_LIBRARY(mod_bw SHARED ${mod_bw_sources})
  52.  
  53. SET_TARGET_PROPERTIES(mod_bw PROPERTIES SUFFIX .so)
  54. TARGET_LINK_LIBRARIES(mod_bw ${CMAKE_INSTALL_PREFIX}/lib/libhttpd.lib
  55.   ${apr_libraries} ${extra_libraries})
  56.  
  57. INSTALL(TARGETS mod_bw RUNTIME DESTINATION modules)
  58.  
  59. IF(INSTALL_PDB)
  60.   INSTALL(FILES ${CMAKE_BINARY_DIR}/mod_bw.pdb DESTINATION modules
  61.           CONFIGURATIONS RelWithDebInfo Debug)
  62. ENDIF()
  63.  
Tags: cmake
Add Comment
Please, Sign In to add comment