|
8 | 8 | #
|
9 | 9 |
|
10 | 10 | cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR)
|
11 |
| -# XXX This can be potentially done in future, but there still exist |
12 |
| -# some dependent project using cmake 2.8 - this can't be done this way. |
13 |
| -#cmake_minimum_required (VERSION 3.0.2 FATAL_ERROR) |
14 |
| -#project(SRT VERSION "1.4.2") |
15 |
| -project(SRT C CXX) |
| 11 | +set (SRT_VERSION 1.4.2) |
16 | 12 |
|
17 | 13 | set (CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/scripts")
|
18 |
| -include(haiUtil) |
| 14 | +include(haiUtil) # needed for set_version_variables |
| 15 | +# CMake version 3.0 introduced the VERSION option of the project() command |
| 16 | +# to specify a project version as well as the name. |
| 17 | +if(${CMAKE_VERSION} VERSION_LESS "3.0.0") |
| 18 | + project(SRT C CXX) |
| 19 | + # Sets SRT_VERSION_MAJOR, SRT_VERSION_MINOR, SRT_VERSION_PATCH |
| 20 | + set_version_variables(SRT_VERSION ${SRT_VERSION}) |
| 21 | +else() |
| 22 | + cmake_policy(SET CMP0048 NEW) |
| 23 | + # Also sets SRT_VERSION_MAJOR, SRT_VERSION_MINOR, SRT_VERSION_PATCH |
| 24 | + project(SRT VERSION ${SRT_VERSION} LANGUAGES C CXX) |
| 25 | +endif() |
| 26 | + |
19 | 27 | include(FindPkgConfig)
|
20 | 28 | # XXX See 'if (MINGW)' condition below, may need fixing.
|
21 | 29 | include(FindThreads)
|
@@ -43,9 +51,6 @@ if (NOT DEFINED CMAKE_INSTALL_LIBDIR)
|
43 | 51 | include(GNUInstallDirs)
|
44 | 52 | endif()
|
45 | 53 |
|
46 |
| -set (SRT_VERSION 1.4.2) |
47 |
| -set_version_variables(SRT_VERSION ${SRT_VERSION}) |
48 |
| - |
49 | 54 | # The CMAKE_BUILD_TYPE seems not to be always set, weird.
|
50 | 55 | if (NOT DEFINED ENABLE_DEBUG)
|
51 | 56 |
|
@@ -775,8 +780,6 @@ MafReadDir(srtcore filelist.maf
|
775 | 780 | PRIVATE_HEADERS HEADERS_srt_private
|
776 | 781 | )
|
777 | 782 |
|
778 |
| -message(STATUS "SRT Sources: ${SOURCES_srt}") |
779 |
| - |
780 | 783 | # Auto generated version file and add it to the HEADERS_srt list.
|
781 | 784 | if(DEFINED ENV{APPVEYOR_BUILD_NUMBER})
|
782 | 785 | set(SRT_VERSION_BUILD ON)
|
@@ -1199,8 +1202,6 @@ if (ENABLE_UNITTESTS AND ENABLE_CXX11)
|
1199 | 1202 | MafReadDir(test filelist.maf
|
1200 | 1203 | SOURCES SOURCES_unittests
|
1201 | 1204 | )
|
1202 |
| - |
1203 |
| - message(STATUS "Unit test sources: ${SOURCES_unittests}") |
1204 | 1205 |
|
1205 | 1206 | srt_add_program(test-srt ${SOURCES_unittests})
|
1206 | 1207 | srt_make_application(test-srt)
|
|
0 commit comments