@@ -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
@@ -264,11 +299,12 @@ else()
264
299
265
300
# filesystem support for c++14
266
301
if (COMPILER_SUPPORTS_CXX14 )
267
- add_definitions (-std=c++14 )
302
+ set (CMAKE_CXX_STANDARD 14 )
303
+ #add_definitions(-std=c++14)
268
304
link_libraries (stdc++fs )
269
305
else ()
270
306
if (CMP_HOST_LINUX )
271
- add_definitions ( -std=c++ 11 )
307
+ set ( CMAKE_CXX_STANDARD 11 )
272
308
endif ()
273
309
endif ()
274
310
@@ -431,14 +467,18 @@ if (CMP_HOST_WINDOWS)
431
467
432
468
# Unit tests
433
469
if (OPTION_BUILD_APPS_CMP_UNITTESTS )
434
- message ("Build cmp unittests setup" )
435
- add_subdirectory (cmp_unittests )
470
+ message ("Build cmp unittests setup" )
471
+ add_subdirectory (cmp_unittests )
436
472
endif ()
437
473
438
474
# CLI + GUI Automation testing
439
475
if (OPTION_BUILD_INTERNAL_CMP_TEST )
440
- message ("Build cmp test setup" )
441
- add_subdirectory (compressonator_internal/applications/cmp_test )
476
+ if (EXISTS ${PROJECT_SOURCE_DIR} /compressonator_internal/applications/cmp_test )
477
+ message ("Building CMP Test" )
478
+ add_subdirectory (compressonator_internal/applications/cmp_test )
479
+ else ()
480
+ message ("Skipping CMP Test build because the directory could not be found" )
481
+ endif ()
442
482
endif ()
443
483
444
484
endif ()
@@ -467,13 +507,15 @@ if (CMP_HOST_WINDOWS)
467
507
PATTERN "media" EXCLUDE
468
508
)
469
509
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
- )
510
+ if (OPTION_CMP_QT )
511
+ install (
512
+ DIRECTORY ${QT_LIB_DIR} /plugins/imageformats DESTINATION plugins
513
+ FILES_MATCHING
514
+ PATTERN "qjpeg.dll"
515
+ PATTERN "qtga.dll"
516
+ PATTERN "qtiff.dll"
517
+ )
518
+ endif ()
477
519
478
520
install (
479
521
DIRECTORY ${WINDOWS_BIN_PREFIX} /plugins/compute DESTINATION "plugins/"
@@ -488,20 +530,25 @@ if (CMP_HOST_WINDOWS)
488
530
install (FILES ${WINDOWS_BIN_PREFIX} /texture.frag.spv ${WINDOWS_BIN_PREFIX} /texture.vert.spv DESTINATION "." )
489
531
490
532
elseif (CMP_HOST_LINUX )
491
- install (DIRECTORY ${QT_LIB_DIR} /plugins/imageformats DESTINATION plugins )
533
+ if (OPTION_CMP_QT )
534
+ install (DIRECTORY ${QT_LIB_DIR} /plugins/imageformats DESTINATION plugins )
535
+ endif ()
536
+
492
537
install (PROGRAMS scripts/compressonatorcli DESTINATION "." )
493
538
494
539
# Qt
495
540
496
- set (QT_INSTALL_LIBS libQt5Core libQt5Gui libicui18n libicuuc libicudata )
541
+ if (OPTION_CMP_QT )
542
+ set (QT_INSTALL_LIBS libQt5Core )
497
543
498
- foreach (QT_INSTALL_LIB ${QT_INSTALL_LIBS} )
499
- file (GLOB QT_LIB_VARIATIONS ${QT_LIB_DIR} /lib/${QT_INSTALL_LIB}.so* )
544
+ foreach (QT_INSTALL_LIB ${QT_INSTALL_LIBS} )
545
+ file (GLOB QT_LIB_VARIATIONS ${QT_LIB_DIR} /lib/${QT_INSTALL_LIB}.so* )
500
546
501
- foreach (QT_LIB_VARIATION ${QT_LIB_VARIATIONS} )
502
- install (FILES ${QT_LIB_VARIATION} DESTINATION qt )
547
+ foreach (QT_LIB_VARIATION ${QT_LIB_VARIATIONS} )
548
+ install (FILES ${QT_LIB_VARIATION} DESTINATION qt )
549
+ endforeach ()
503
550
endforeach ()
504
- endforeach ()
551
+ endif ()
505
552
506
553
# OpenCV, TBB, and extra
507
554
@@ -551,4 +598,4 @@ set(CPACK_DEBIAN_PACKAGE_MAINTAINER "AMD")
551
598
set (CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://gpuopen.com/compressonator/" )
552
599
set (CPACK_DEBIAN_FILE_NAME DEB-DEFAULT )
553
600
554
- include (CPack )
601
+ include (CPack )
0 commit comments