|
1 | | -From adaf7690b34ade92e3cfb0af812ec8c534381b12 Mon Sep 17 00:00:00 2001 |
| 1 | +From ec40a559327d80f3333c17a1f9e9c516bb073753 Mon Sep 17 00:00:00 2001 |
2 | 2 | From: qianlongxu < [email protected]> |
3 | | -Date: Tue, 14 Jan 2025 17:53:31 +0800 |
| 3 | +Date: Thu, 4 Dec 2025 10:11:52 +0800 |
4 | 4 | Subject: [PATCH] skip binary and shared lib and jpeg |
5 | 5 |
|
6 | 6 | --- |
7 | | - CMakeLists.txt | 17 +++++++++++++++-- |
8 | | - 1 file changed, 15 insertions(+), 2 deletions(-) |
| 7 | + CMakeLists.txt | 11 ++++++++++- |
| 8 | + 1 file changed, 10 insertions(+), 1 deletion(-) |
9 | 9 |
|
10 | 10 | diff --git a/CMakeLists.txt b/CMakeLists.txt |
11 | | -index 636531e..47b9759 100644 |
| 11 | +index 9abfa74..898a6be 100644 |
12 | 12 | --- a/CMakeLists.txt |
13 | 13 | +++ b/CMakeLists.txt |
14 | 14 | @@ -5,6 +5,7 @@ |
15 | 15 | PROJECT ( YUV C CXX ) # "C" is required even for C++ projects |
16 | | - CMAKE_MINIMUM_REQUIRED( VERSION 2.8 ) |
17 | | - OPTION( TEST "Built unit tests" OFF ) |
| 16 | + CMAKE_MINIMUM_REQUIRED( VERSION 2.8.12 ) |
| 17 | + OPTION( UNIT_TEST "Built unit tests" OFF ) |
18 | 18 | +OPTION( BINARY "Built binary" OFF ) |
19 | 19 |
|
20 | 20 | SET ( ly_base_dir ${PROJECT_SOURCE_DIR} ) |
21 | 21 | SET ( ly_src_dir ${ly_base_dir}/source ) |
22 | | -@@ -25,22 +26,26 @@ INCLUDE_DIRECTORIES( BEFORE ${ly_inc_dir} ) |
| 22 | +@@ -29,6 +30,7 @@ endif() |
23 | 23 | # this creates the static library (.a) |
24 | 24 | ADD_LIBRARY ( ${ly_lib_static} STATIC ${ly_source_files} ) |
25 | 25 |
|
26 | 26 | +if(BUILD_SHARED_LIBS) |
27 | 27 | # this creates the shared library (.so) |
28 | 28 | ADD_LIBRARY ( ${ly_lib_shared} SHARED ${ly_source_files} ) |
29 | | -+ |
30 | 29 | SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES OUTPUT_NAME "${ly_lib_name}" ) |
31 | | - SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES PREFIX "lib" ) |
| 30 | +@@ -36,7 +38,9 @@ SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES PREFIX "lib" ) |
| 31 | + if(WIN32) |
| 32 | + SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES IMPORT_PREFIX "lib" ) |
| 33 | + endif() |
32 | 34 | +endif() |
33 | 35 |
|
34 | | - # this creates the conversion tool |
35 | 36 | +if(BINARY) |
36 | | - ADD_EXECUTABLE ( yuvconvert ${ly_base_dir}/util/yuvconvert.cc ) |
37 | | - TARGET_LINK_LIBRARIES ( yuvconvert ${ly_lib_static} ) |
38 | | - |
39 | | -- |
40 | | - INCLUDE ( FindJPEG ) |
41 | | - if (JPEG_FOUND) |
42 | | - include_directories( ${JPEG_INCLUDE_DIR} ) |
43 | | - target_link_libraries( yuvconvert ${JPEG_LIBRARY} ) |
| 37 | + # this creates the cpuid tool |
| 38 | + ADD_EXECUTABLE ( cpuid ${ly_base_dir}/util/cpuid.c ) |
| 39 | + TARGET_LINK_LIBRARIES ( cpuid ${ly_lib_static} ) |
| 40 | +@@ -55,6 +59,7 @@ if (JPEG_FOUND) |
| 41 | + target_link_libraries( ${ly_lib_shared} ${JPEG_LIBRARY} ) |
44 | 42 | add_definitions( -DHAVE_JPEG ) |
45 | 43 | endif() |
46 | 44 | +endif() |
47 | 45 |
|
48 | | - if(TEST) |
| 46 | + if(UNIT_TEST) |
49 | 47 | find_library(GTEST_LIBRARY gtest) |
50 | | -@@ -75,9 +80,17 @@ endif() |
| 48 | +@@ -97,10 +102,14 @@ if(UNIT_TEST) |
| 49 | + endif() |
51 | 50 |
|
52 | 51 |
|
53 | | - # install the conversion tool, .so, .a, and all the header files |
54 | 52 | +if(BINARY) |
55 | | -+message("The BINARY option is enabled.") |
56 | | - INSTALL ( PROGRAMS ${CMAKE_BINARY_DIR}/yuvconvert DESTINATION bin ) |
57 | | --INSTALL ( TARGETS ${ly_lib_static} DESTINATION lib ) |
| 53 | + # install the conversion tool, .so, .a, and all the header files |
| 54 | +-INSTALL ( PROGRAMS ${CMAKE_BINARY_DIR}/yuvconvert DESTINATION bin ) |
| 55 | ++INSTALL ( PROGRAMS ${CMAKE_BINARY_DIR}/yuvconvert DESTINATION bin ) |
58 | 56 | +endif() |
59 | | -+ |
| 57 | + INSTALL ( TARGETS ${ly_lib_static} DESTINATION lib ) |
60 | 58 | +if(BUILD_SHARED_LIBS) |
61 | | -+message("The BUILD_SHARED_LIBS option is enabled.") |
62 | 59 | INSTALL ( TARGETS ${ly_lib_shared} LIBRARY DESTINATION lib RUNTIME DESTINATION bin ) |
63 | 60 | +endif() |
64 | | -+ |
65 | | -+INSTALL ( TARGETS ${ly_lib_static} DESTINATION lib ) |
66 | 61 | INSTALL ( DIRECTORY ${PROJECT_SOURCE_DIR}/include/ DESTINATION include ) |
67 | 62 |
|
68 | 63 | # create the .deb and .rpm packages using cpack |
69 | 64 | -- |
70 | | -2.39.5 (Apple Git-154) |
| 65 | +2.50.1 (Apple Git-155) |
71 | 66 |
|
0 commit comments