|
1 | 1 | # This usage of CMake requires at least version 2.4 (checks are made to determine what to use when certain versions lack functions) |
2 | | -cmake_minimum_required(VERSION 2.4 FATAL_ERROR) |
3 | | -if(COMMAND cmake_policy) |
4 | | - cmake_policy(SET CMP0003 NEW) |
5 | | - if(POLICY CMP0026) |
6 | | - cmake_policy(SET CMP0026 OLD) |
7 | | - endif(POLICY CMP0026) |
8 | | - if(POLICY CMP0007) |
9 | | - cmake_policy(SET CMP0007 OLD) |
10 | | - endif(POLICY CMP0007) |
11 | | -endif(COMMAND cmake_policy) |
| 2 | +cmake_minimum_required(VERSION 2.4...3.20 FATAL_ERROR) |
12 | 3 |
|
13 | 4 | # Set the project as C++ primarily, but have C enabled for the checks required later |
14 | 5 | project(Anope CXX) |
@@ -422,7 +413,6 @@ read_from_file(${Anope_SOURCE_DIR}/src/version.sh "^VERSION_" VERSIONS) |
422 | 413 | # Iterate through the strings found |
423 | 414 | foreach(VERSION_STR ${VERSIONS}) |
424 | 415 | string(REGEX REPLACE "^VERSION_([A-Z]+)=\"?([^\"]*)\"?$" "\\1;\\2" VERSION_OUT ${VERSION_STR}) |
425 | | - # Depends on CMP0007 OLD |
426 | 416 | list(LENGTH VERSION_OUT VERSION_LEN) |
427 | 417 | list(GET VERSION_OUT 0 VERSION_TYPE) |
428 | 418 | if(${VERSION_LEN} GREATER 1) |
@@ -479,16 +469,8 @@ if(${Anope_SOURCE_DIR} STREQUAL ${Anope_BINARY_DIR}) |
479 | 469 | endif(MSVC) |
480 | 470 | endif(${Anope_SOURCE_DIR} STREQUAL ${Anope_BINARY_DIR}) |
481 | 471 |
|
482 | | -# Go into the following directories and run their CMakeLists.txt as well |
483 | | -add_subdirectory(data) |
484 | | -add_subdirectory(docs) |
485 | | -add_subdirectory(language) |
486 | | -add_subdirectory(src) |
487 | | -add_subdirectory(modules) |
488 | | -add_subdirectory(include) |
489 | | - |
490 | 472 | # Get the filename of the Anope binary, to use later |
491 | | -get_target_property(SERVICES_BINARY ${PROGRAM_NAME} LOCATION) |
| 473 | +set(SERVICES_BINARY "$<TARGET_FILE:${PROGRAM_NAME}>") |
492 | 474 | get_filename_component(SERVICES_BINARY ${SERVICES_BINARY} NAME) |
493 | 475 |
|
494 | 476 | # At install time, create the following additional directories |
@@ -556,3 +538,12 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") |
556 | 538 | set(CPACK_MONOLITHIC_INSTALL TRUE) |
557 | 539 | include(CPack) |
558 | 540 | endif(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") |
| 541 | + |
| 542 | +# Go into the following directories and run their CMakeLists.txt as well |
| 543 | +add_subdirectory(data) |
| 544 | +add_subdirectory(docs) |
| 545 | +add_subdirectory(language) |
| 546 | +add_subdirectory(src) |
| 547 | +add_subdirectory(modules) |
| 548 | +add_subdirectory(include) |
| 549 | + |
0 commit comments