|
| 1 | +#***************************************************************** |
| 2 | +# |
| 3 | +# Copyright © 2017-2020 kohnech, lnwhome All rights reserved |
| 4 | +# |
| 5 | +# mpeg2ts - mpeg2ts 3rd-party |
| 6 | +# |
| 7 | +# This file is part of mpeg2ts (Mpeg2 Transport Stream Library). |
| 8 | +# |
| 9 | +# Unless you have obtained mpeg2ts under a different license, |
| 10 | +# this version of mpeg2ts is mpeg2ts|GPL. |
| 11 | +# Mpeg2ts|GPL is free software; you can redistribute it and/or |
| 12 | +# modify it under the terms of the GNU General Public License as |
| 13 | +# published by the Free Software Foundation; either version 2, |
| 14 | +# or (at your option) any later version. |
| 15 | +# |
| 16 | +# Mpeg2ts|GPL is distributed in the hope that it will be useful, |
| 17 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 18 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 19 | +# GNU General Public License for more details. |
| 20 | +# |
| 21 | +# You should have received a copy of the GNU General Public License |
| 22 | +# along with mpeg2ts|GPL; see the file COPYING. If not, write to |
| 23 | +# the Free Software Foundation, 59 Temple Place - Suite 330, |
| 24 | +# Boston, MA 02111-1307, USA. |
| 25 | +# |
| 26 | +#*******************************************************************/ |
1 | 27 | cmake_minimum_required(VERSION 3.0)
|
2 | 28 | project(3rd-party)
|
3 | 29 | set(PLOG_VERSION 1.1.4)
|
@@ -38,87 +64,87 @@ ExternalProject_Add(
|
38 | 64 | #-------------------------------------------------------------
|
39 | 65 | # Taken from https://github.com/google/googletest/tree/master/googletest#incorporating-into-an-existing-cmake-project
|
40 | 66 | #-------------------------------------------------------------
|
41 |
| - |
42 |
| -if(NOT USE_DOCKER) |
43 |
| -message("NOT using Docker! Downloading & configuring google test...") |
44 |
| - |
45 |
| - # Download and unpack googletest at configure time |
46 |
| - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists_googletest.txt.in ${CMAKE_CURRENT_SOURCE_DIR}/googletest-download/CMakeLists.txt) |
47 |
| - execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" . |
48 |
| - RESULT_VARIABLE result |
49 |
| - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/googletest-download ) |
50 |
| - if(result) |
51 |
| - message(FATAL_ERROR "CMake step for googletest failed: ${result}") |
52 |
| - endif() |
53 |
| - execute_process(COMMAND ${CMAKE_COMMAND} --build . |
54 |
| - RESULT_VARIABLE result |
55 |
| - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/googletest-download ) |
56 |
| - if(result) |
57 |
| - message(FATAL_ERROR "Build step for googletest failed: ${result}") |
58 |
| - endif() |
59 |
| - |
60 |
| - # Prevent overriding the parent project's compiler/linker |
61 |
| - # settings on Windows |
62 |
| - set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) |
63 |
| - |
64 |
| - # Add googletest directly to our build. This defines |
65 |
| - # the gtest and gtest_main targets. |
66 |
| - add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/googletest-src |
67 |
| - ${CMAKE_CURRENT_SOURCE_DIR}/googletest-build |
68 |
| - EXCLUDE_FROM_ALL) |
69 |
| - |
70 |
| - # The gtest/gtest_main targets carry header search path |
71 |
| - # dependencies automatically when using CMake 2.8.11 or |
72 |
| - # later. Otherwise we have to add them here ourselves. |
73 |
| - if (CMAKE_VERSION VERSION_LESS 2.8.11) |
74 |
| - include_directories("${gtest_SOURCE_DIR}/include") |
75 |
| - endif() |
76 |
| -endif(NOT USE_DOCKER) |
| 67 | +if(NOT USE_DOCKER AND NOT ENABLE_WEBASSEMBLY) |
| 68 | + message("NOT using Docker! Downloading & configuring google test...") |
| 69 | + |
| 70 | + # Download and unpack googletest at configure time |
| 71 | + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists_googletest.txt.in ${CMAKE_CURRENT_SOURCE_DIR}/googletest-download/CMakeLists.txt) |
| 72 | + execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" . |
| 73 | + RESULT_VARIABLE result |
| 74 | + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/googletest-download |
| 75 | + ) |
| 76 | + if(result) |
| 77 | + message(FATAL_ERROR "CMake step for googletest failed: ${result}") |
| 78 | + endif() |
| 79 | + execute_process(COMMAND ${CMAKE_COMMAND} --build . |
| 80 | + RESULT_VARIABLE result |
| 81 | + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/googletest-download ) |
| 82 | + if(result) |
| 83 | + message(FATAL_ERROR "Build step for googletest failed: ${result}") |
| 84 | + endif() |
| 85 | + |
| 86 | + # Prevent overriding the parent project's compiler/linker |
| 87 | + # settings on Windows |
| 88 | + set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) |
| 89 | + |
| 90 | + # Add googletest directly to our build. This defines |
| 91 | + # the gtest and gtest_main targets. |
| 92 | + add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/googletest-src |
| 93 | + ${CMAKE_CURRENT_SOURCE_DIR}/googletest-build |
| 94 | + EXCLUDE_FROM_ALL) |
| 95 | + |
| 96 | + # The gtest/gtest_main targets carry header search path |
| 97 | + # dependencies automatically when using CMake 2.8.11 or |
| 98 | + # later. Otherwise we have to add them here ourselves. |
| 99 | + if (CMAKE_VERSION VERSION_LESS 2.8.11) |
| 100 | + include_directories("${gtest_SOURCE_DIR}/include") |
| 101 | + endif() |
| 102 | +endif(NOT USE_DOCKER AND NOT ENABLE_WEBASSEMBLY) |
77 | 103 |
|
78 | 104 |
|
79 | 105 | ############ google benchmark
|
80 | 106 |
|
81 | 107 |
|
82 |
| -if(NOT USE_DOCKER) |
83 |
| - message("NOT using Docker! Downloading & configuring google benchmark...") |
84 |
| - |
85 |
| - set(BENCHMARK_ENABLE_GTEST_TESTS OFF CACHE BOOL "Disable GTest") |
86 |
| - # Build release version |
87 |
| - set(DCMAKE_BUILD_TYPE RELEASE) |
88 |
| - # If you want to self-test benchmark lib too, turn me ON |
89 |
| - # |
90 |
| - set(BENCHMARK_ENABLE_TESTING OFF) |
91 |
| - |
92 |
| - # Download and unpack benchmark at configure time |
93 |
| - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists_benchmark.txt.in ${CMAKE_CURRENT_SOURCE_DIR}/benchmark-download/CMakeLists.txt) |
94 |
| - execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" . |
95 |
| - RESULT_VARIABLE result |
96 |
| - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/benchmark-download ) |
97 |
| - if(result) |
98 |
| - message(FATAL_ERROR "CMake step for benchmark failed: ${result}") |
99 |
| - endif() |
100 |
| - execute_process(COMMAND ${CMAKE_COMMAND} --build . |
101 |
| - RESULT_VARIABLE result |
102 |
| - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/benchmark-download ) |
103 |
| - if(result) |
104 |
| - message(FATAL_ERROR "Build step for benchmark failed: ${result}") |
105 |
| - endif() |
106 |
| - |
107 |
| - |
108 |
| - # Prevent overriding the parent project's compiler/linker |
109 |
| - # settings on Windows |
110 |
| - #set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) |
111 |
| - |
112 |
| - # Add benchmark directly to our build. This defines |
113 |
| - # the gtest and gtest_main targets. |
114 |
| - add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/benchmark-src |
115 |
| - ${CMAKE_CURRENT_SOURCE_DIR}/benchmark-build |
116 |
| - EXCLUDE_FROM_ALL) |
117 |
| - |
118 |
| - # The gtest/gtest_main targets carry header search path |
119 |
| - # dependencies automatically when using CMake 2.8.11 or |
120 |
| - # later. Otherwise we have to add them here ourselves. |
121 |
| - if (CMAKE_VERSION VERSION_LESS 2.8.11) |
122 |
| - include_directories("${gtest_SOURCE_DIR}/include") |
123 |
| - endif() |
124 |
| -endif(NOT USE_DOCKER) |
| 108 | +if(NOT USE_DOCKER AND NOT ENABLE_WEBASSEMBLY) |
| 109 | + message("NOT using Docker! Downloading & configuring google benchmark...") |
| 110 | + |
| 111 | + set(BENCHMARK_ENABLE_GTEST_TESTS OFF CACHE BOOL "Disable GTest") |
| 112 | + # Build release version |
| 113 | + set(DCMAKE_BUILD_TYPE RELEASE) |
| 114 | + # If you want to self-test benchmark lib too, turn me ON |
| 115 | + # |
| 116 | + set(BENCHMARK_ENABLE_TESTING OFF) |
| 117 | + |
| 118 | + # Download and unpack benchmark at configure time |
| 119 | + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists_benchmark.txt.in ${CMAKE_CURRENT_SOURCE_DIR}/benchmark-download/CMakeLists.txt) |
| 120 | + execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" . |
| 121 | + RESULT_VARIABLE result |
| 122 | + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/benchmark-download ) |
| 123 | + if(result) |
| 124 | + message(FATAL_ERROR "CMake step for benchmark failed: ${result}") |
| 125 | + endif() |
| 126 | + execute_process(COMMAND ${CMAKE_COMMAND} --build . |
| 127 | + RESULT_VARIABLE result |
| 128 | + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/benchmark-download ) |
| 129 | + if(result) |
| 130 | + message(FATAL_ERROR "Build step for benchmark failed: ${result}") |
| 131 | + endif() |
| 132 | + |
| 133 | + |
| 134 | + # Prevent overriding the parent project's compiler/linker |
| 135 | + # settings on Windows |
| 136 | + #set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) |
| 137 | + |
| 138 | + # Add benchmark directly to our build. This defines |
| 139 | + # the gtest and gtest_main targets. |
| 140 | + add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/benchmark-src |
| 141 | + ${CMAKE_CURRENT_SOURCE_DIR}/benchmark-build |
| 142 | + EXCLUDE_FROM_ALL) |
| 143 | + |
| 144 | + # The gtest/gtest_main targets carry header search path |
| 145 | + # dependencies automatically when using CMake 2.8.11 or |
| 146 | + # later. Otherwise we have to add them here ourselves. |
| 147 | + if (CMAKE_VERSION VERSION_LESS 2.8.11) |
| 148 | + include_directories("${gtest_SOURCE_DIR}/include") |
| 149 | + endif() |
| 150 | +endif(NOT USE_DOCKER AND NOT ENABLE_WEBASSEMBLY) |
0 commit comments