@@ -25,7 +25,7 @@ if (NOT CMP_VERSION_MAJOR)
25
25
endif ()
26
26
27
27
if (NOT CMP_VERSION_MINOR)
28
- set (CMP_VERSION_MINOR 4 )
28
+ set (CMP_VERSION_MINOR 5 )
29
29
endif ()
30
30
31
31
if (NOT CMP_VERSION_BUILD_NUMBER)
@@ -41,6 +41,35 @@ message("Building Compressonator version ${PROJECT_VERSION_MAJOR}.${PROJECT_VERS
41
41
include (cmake/helperfunctions.cmake)
42
42
43
43
44
+ # ------------------------------
45
+ # Common compiler options
46
+ # ------------------------------
47
+
48
+ if (CMP_HOST_WINDOWS)
49
+ add_compile_options (/W4 /wd4201)
50
+ # add_compile_options(/W4 /WX /wd4201)
51
+ elseif (CMP_HOST_LINUX)
52
+ add_compile_options (-Wall)
53
+ # add_compile_options(-Wall -Werror)
54
+ endif ()
55
+
56
+ # ------------------------------------
57
+ # Visual Studio project folder names
58
+ # ------------------------------------
59
+
60
+ set (PROJECT_FOLDER_SDK "SDK" )
61
+ set (PROJECT_FOLDER_SDK_LIBS "${PROJECT_FOLDER_SDK} /Libraries" )
62
+ set (PROJECT_FOLDER_SDK_EXTERNAL "${PROJECT_FOLDER_SDK} /External Libraries" )
63
+ set (PROJECT_FOLDER_SDK_PLUGIN_DYNAMIC "${PROJECT_FOLDER_SDK} /Plugins/Dynamic" )
64
+ set (PROJECT_FOLDER_SDK_PLUGIN_STATIC "${PROJECT_FOLDER_SDK} /Plugins/Static" )
65
+ set (PROJECT_FOLDER_SDK_EXAMPLES "${PROJECT_FOLDER_SDK} /Examples" )
66
+
67
+ set (PROJECT_FOLDER_APPS "Applications" )
68
+ set (PROJECT_FOLDER_APPS_LIBS "${PROJECT_FOLDER_APPS} /Libraries" )
69
+ set (PROJECT_FOLDER_APPS_EXTERNAL "${PROJECT_FOLDER_APPS} /External Libraries" )
70
+ set (PROJECT_FOLDER_APPS_PLUGIN_DYNAMIC "${PROJECT_FOLDER_APPS} /Plugins/Dynamic" )
71
+ set (PROJECT_FOLDER_APPS_PLUGIN_STATIC "${PROJECT_FOLDER_APPS} /Plugins/Static" )
72
+
44
73
#----------------------------------------
45
74
# Check compiler feature support levels
46
75
# For Apple (Mac) default to C++11
63
92
set (COMPILER_SUPPORTS_CXX11 ON )
64
93
endif ()
65
94
66
-
67
95
#---------------------------------------------------------------------------------
68
96
# Provide default values for each build option
69
97
#
@@ -76,10 +104,10 @@ endif()
76
104
#---------------------------------------------------------------------------------
77
105
option (OPTION_ENABLE_ALL_APPS "Enable all apps" ON ) # TODO rename to OPTION_BUILD_ALL
78
106
option (OPTION_BUILD_CMP_SDK "Build Compressonator SDK" OFF )
79
- option (OPTION_BUILD_APPS_CMP_CLI "Build Application: CLI" OFF )
80
- option (OPTION_BUILD_APPS_CMP_GUI "Build Application: GUI" OFF )
81
- option (OPTION_BUILD_APPS_CMP_UNITTESTS "Build Application: UnitTests" OFF )
82
- option (OPTION_BUILD_APPS_CMP_EXAMPLES "Build Application: Examples" OFF )
107
+ option (OPTION_BUILD_APPS_CMP_CLI "Build Compressonator CLI" OFF )
108
+ option (OPTION_BUILD_APPS_CMP_GUI "Build Compressonator GUI" OFF )
109
+ option (OPTION_BUILD_APPS_CMP_UNITTESTS "Build Compressontor UnitTests" OFF )
110
+ option (OPTION_BUILD_APPS_CMP_EXAMPLES "Build Compressontor Examples" OFF )
83
111
84
112
#--------------------------------------------------------------------------
85
113
# Enable or Disable Specific Build Apps
@@ -90,9 +118,14 @@ if (OPTION_ENABLE_ALL_APPS)
90
118
set (OPTION_BUILD_APPS_CMP_GUI ON )
91
119
set (OPTION_BUILD_APPS_CMP_UNITTESTS ON )
92
120
set (OPTION_BUILD_APPS_CMP_EXAMPLES ON )
121
+ else ()
122
+ option (OPTION_BUILD_APPS_CMP_CLI OFF )
123
+ option (OPTION_BUILD_APPS_CMP_GUI OFF )
124
+ option (OPTION_BUILD_CMP_SDK OFF )
125
+ option (OPTION_BUILD_APPS_CMP_UNITTESTS OFF )
126
+ option (OPTION_BUILD_APPS_CMP_EXAMPLES OFF )
93
127
endif ()
94
128
95
-
96
129
# Minimum Lib Dependencies for CLI, GUI, and SDK (GUI has additional lib requirements added later in this cmake)
97
130
if (OPTION_BUILD_APPS_CMP_CLI OR OPTION_BUILD_APPS_CMP_GUI)
98
131
set (LIB_BUILD_COMPRESSONATOR_SDK ON )
@@ -112,16 +145,20 @@ elseif (OPTION_BUILD_CMP_SDK)
112
145
set (LIB_BUILD_GPUDECODE ON )
113
146
endif ()
114
147
148
+ if (OPTION_BUILD_APPS_CMP_VISION)
149
+ set (LIB_BUILD_COMPRESSONATOR_SDK ON )
150
+ set (LIB_BUILD_FRAMEWORK_SDK ON )
151
+ endif ()
152
+
115
153
# The following options that have been removed
116
154
set (LIB_BUILD_MESHCOMPRESSOR OFF )
117
155
118
156
set (PROJECT_EXTERNAL_LIBDIR ${PROJECT_SOURCE_DIR} /../common/lib/ext )
119
157
120
-
121
158
# ----------------------------------------------------------------------------
122
159
# GPUOpen Source Code build options : These options are been revised for v4.2
123
160
# ----------------------------------------------------------------------------
124
- # OPTION DESCRIPTION DEFAULT REQUIREMENT
161
+ # OPTION DESCRIPTION REQUESTED VALUE REQUIREMENT
125
162
cmp_option(OPTION_BUILD_KTX2 "Build CLI KTX2 Support" ON CMAKE_VERSION VERSION_GREATER "3.14.0" )
126
163
cmp_option(OPTION_BUILD_EXR "Build CLI EXR Support" ON CMP_HOST_WINDOWS OR CMP_HOST_LINUX)
127
164
cmp_option(OPTION_BUILD_GUI "Build the GUI Application" ON CMP_HOST_WINDOWS OR OPTION_BUILD_APPS_CMP_GUI)
@@ -134,14 +171,13 @@ cmp_option(OPTION_CMP_GTC "Use GTC Codec" OFF TRUE
134
171
cmp_option(OPTION_BUILD_BROTLIG "Use Brotli-G Codec for CLI" ON CMP_HOST_WINDOWS)
135
172
cmp_option(OPTION_BUILD_BROTLIG_GUI "Use Brotli-G Codec for GUI" OFF TRUE ) # In development for v4.4
136
173
# Internal testing application
137
- option (OPTION_BUILD_INTERNAL_CMP_TEST "Build Internal Application: cmp_test" OFF )
174
+ option (OPTION_BUILD_INTERNAL_CMP_TEST "Build Internal Application: cmp_test" ON )
138
175
# No longer supported
139
176
cmp_option(OPTION_BUILD_ASTC "Build ASTC Support" OFF FALSE )
140
177
cmp_option(OPTION_BUILD_DRACO "Build CLI Draco Support" OFF FALSE )
141
178
# this needs to be removed
142
179
cmp_option(NO_LEGACY_BEHAVIOR "Disables any legacy behavior (before CMake migration)" ON TRUE )
143
180
144
-
145
181
# -----------------------------------------------------------------------------------
146
182
# Code build definitions and features: These options are been revised for v4.2
147
183
# -----------------------------------------------------------------------------------
@@ -175,7 +211,6 @@ add_compile_definitions(
175
211
#USE_CMP_TRANSCODE # Future release:: Transcode BASIS/GTC to other compressed formats
176
212
177
213
# Possible future releases features
178
- #ARGB_32_SUPPORT # Enables 32bit Float channel formats
179
214
#SUPPORT_ETC_ALPHA # for ATC_RGB output enable A
180
215
#SHOW_PROCESS_MEMORY # display available CPU process memory
181
216
#USE_BCN_IMAGE_DEBUG # Enables Combobox in Image View for low level BCn based block compression in debug mode
@@ -431,14 +466,18 @@ if (CMP_HOST_WINDOWS)
431
466
432
467
# Unit tests
433
468
if (OPTION_BUILD_APPS_CMP_UNITTESTS)
434
- message ("Build cmp unittests setup" )
435
- add_subdirectory (cmp_unittests)
469
+ message ("Build cmp unittests setup" )
470
+ add_subdirectory (cmp_unittests)
436
471
endif ()
437
472
438
473
# CLI + GUI Automation testing
439
474
if (OPTION_BUILD_INTERNAL_CMP_TEST)
440
- message ("Build cmp test setup" )
441
- add_subdirectory (compressonator_internal/applications/cmp_test)
475
+ if (EXISTS ${PROJECT_SOURCE_DIR} /compressonator_internal/applications/cmp_test)
476
+ message ("Building CMP Test" )
477
+ add_subdirectory (compressonator_internal/applications/cmp_test)
478
+ else ()
479
+ message ("Skipping CMP Test build because the directory could not be found" )
480
+ endif ()
442
481
endif ()
443
482
444
483
endif ()
@@ -467,13 +506,15 @@ if (CMP_HOST_WINDOWS)
467
506
PATTERN "media" EXCLUDE
468
507
)
469
508
470
- install (
471
- DIRECTORY ${QT_LIB_DIR} /plugins/imageformats DESTINATION plugins
472
- FILES_MATCHING
473
- PATTERN "qjpeg.dll"
474
- PATTERN "qtga.dll"
475
- PATTERN "qtiff.dll"
476
- )
509
+ if (OPTION_CMP_QT)
510
+ install (
511
+ DIRECTORY ${QT_LIB_DIR} /plugins/imageformats DESTINATION plugins
512
+ FILES_MATCHING
513
+ PATTERN "qjpeg.dll"
514
+ PATTERN "qtga.dll"
515
+ PATTERN "qtiff.dll"
516
+ )
517
+ endif ()
477
518
478
519
install (
479
520
DIRECTORY ${WINDOWS_BIN_PREFIX} /plugins/compute DESTINATION "plugins/"
@@ -488,20 +529,25 @@ if (CMP_HOST_WINDOWS)
488
529
install (FILES ${WINDOWS_BIN_PREFIX} /texture.frag.spv ${WINDOWS_BIN_PREFIX} /texture.vert.spv DESTINATION "." )
489
530
490
531
elseif (CMP_HOST_LINUX)
491
- install (DIRECTORY ${QT_LIB_DIR} /plugins/imageformats DESTINATION plugins)
532
+ if (OPTION_CMP_QT)
533
+ install (DIRECTORY ${QT_LIB_DIR} /plugins/imageformats DESTINATION plugins)
534
+ endif ()
535
+
492
536
install (PROGRAMS scripts/compressonatorcli DESTINATION "." )
493
537
494
538
# Qt
495
539
496
- set (QT_INSTALL_LIBS libQt5Core libQt5Gui libicui18n libicuuc libicudata)
540
+ if (OPTION_CMP_QT)
541
+ set (QT_INSTALL_LIBS libQt5Core)
497
542
498
- foreach (QT_INSTALL_LIB ${QT_INSTALL_LIBS} )
499
- file (GLOB QT_LIB_VARIATIONS ${QT_LIB_DIR} /lib/${QT_INSTALL_LIB} .so*)
543
+ foreach (QT_INSTALL_LIB ${QT_INSTALL_LIBS} )
544
+ file (GLOB QT_LIB_VARIATIONS ${QT_LIB_DIR} /lib/${QT_INSTALL_LIB} .so*)
500
545
501
- foreach (QT_LIB_VARIATION ${QT_LIB_VARIATIONS} )
502
- install (FILES ${QT_LIB_VARIATION} DESTINATION qt)
546
+ foreach (QT_LIB_VARIATION ${QT_LIB_VARIATIONS} )
547
+ install (FILES ${QT_LIB_VARIATION} DESTINATION qt)
548
+ endforeach ()
503
549
endforeach ()
504
- endforeach ()
550
+ endif ()
505
551
506
552
# OpenCV, TBB, and extra
507
553
@@ -551,4 +597,4 @@ set(CPACK_DEBIAN_PACKAGE_MAINTAINER "AMD")
551
597
set (CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://gpuopen.com/compressonator/" )
552
598
set (CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)
553
599
554
- include (CPack)
600
+ include (CPack)
0 commit comments