@@ -25,7 +25,7 @@ if (NOT CMP_VERSION_MAJOR)
2525endif ()
2626
2727if (NOT CMP_VERSION_MINOR)
28- set (CMP_VERSION_MINOR 4 )
28+ set (CMP_VERSION_MINOR 5 )
2929endif ()
3030
3131if (NOT CMP_VERSION_BUILD_NUMBER)
@@ -41,6 +41,35 @@ message("Building Compressonator version ${PROJECT_VERSION_MAJOR}.${PROJECT_VERS
4141include (cmake/helperfunctions.cmake )
4242
4343
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+
4473#----------------------------------------
4574# Check compiler feature support levels
4675# For Apple (Mac) default to C++11
6392 set (COMPILER_SUPPORTS_CXX11 ON )
6493endif ()
6594
66-
6795#---------------------------------------------------------------------------------
6896# Provide default values for each build option
6997#
@@ -76,10 +104,10 @@ endif()
76104#---------------------------------------------------------------------------------
77105option (OPTION_ENABLE_ALL_APPS "Enable all apps" ON ) # TODO rename to OPTION_BUILD_ALL
78106option (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 )
83111
84112#--------------------------------------------------------------------------
85113# Enable or Disable Specific Build Apps
@@ -90,9 +118,14 @@ if (OPTION_ENABLE_ALL_APPS)
90118 set (OPTION_BUILD_APPS_CMP_GUI ON )
91119 set (OPTION_BUILD_APPS_CMP_UNITTESTS ON )
92120 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 )
93127endif ()
94128
95-
96129# Minimum Lib Dependencies for CLI, GUI, and SDK (GUI has additional lib requirements added later in this cmake)
97130if (OPTION_BUILD_APPS_CMP_CLI OR OPTION_BUILD_APPS_CMP_GUI)
98131 set (LIB_BUILD_COMPRESSONATOR_SDK ON )
@@ -112,16 +145,20 @@ elseif (OPTION_BUILD_CMP_SDK)
112145 set (LIB_BUILD_GPUDECODE ON )
113146endif ()
114147
148+ if (OPTION_BUILD_APPS_CMP_VISION)
149+ set (LIB_BUILD_COMPRESSONATOR_SDK ON )
150+ set (LIB_BUILD_FRAMEWORK_SDK ON )
151+ endif ()
152+
115153# The following options that have been removed
116154set (LIB_BUILD_MESHCOMPRESSOR OFF )
117155
118156set (PROJECT_EXTERNAL_LIBDIR ${PROJECT_SOURCE_DIR} /../common/lib/ext)
119157
120-
121158# ----------------------------------------------------------------------------
122159# GPUOpen Source Code build options : These options are been revised for v4.2
123160# ----------------------------------------------------------------------------
124- # OPTION DESCRIPTION DEFAULT REQUIREMENT
161+ # OPTION DESCRIPTION REQUESTED VALUE REQUIREMENT
125162cmp_option (OPTION_BUILD_KTX2 "Build CLI KTX2 Support" ON CMAKE_VERSION VERSION_GREATER "3.14.0" )
126163cmp_option (OPTION_BUILD_EXR "Build CLI EXR Support" ON CMP_HOST_WINDOWS OR CMP_HOST_LINUX )
127164cmp_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
134171cmp_option (OPTION_BUILD_BROTLIG "Use Brotli-G Codec for CLI" ON CMP_HOST_WINDOWS )
135172cmp_option (OPTION_BUILD_BROTLIG_GUI "Use Brotli-G Codec for GUI" OFF TRUE ) # In development for v4.4
136173# 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 )
138175# No longer supported
139176cmp_option (OPTION_BUILD_ASTC "Build ASTC Support" OFF FALSE )
140177cmp_option (OPTION_BUILD_DRACO "Build CLI Draco Support" OFF FALSE )
141178# this needs to be removed
142179cmp_option (NO_LEGACY_BEHAVIOR "Disables any legacy behavior (before CMake migration)" ON TRUE )
143180
144-
145181# -----------------------------------------------------------------------------------
146182# Code build definitions and features: These options are been revised for v4.2
147183# -----------------------------------------------------------------------------------
@@ -175,7 +211,6 @@ add_compile_definitions(
175211 #USE_CMP_TRANSCODE # Future release:: Transcode BASIS/GTC to other compressed formats
176212
177213 # Possible future releases features
178- #ARGB_32_SUPPORT # Enables 32bit Float channel formats
179214 #SUPPORT_ETC_ALPHA # for ATC_RGB output enable A
180215 #SHOW_PROCESS_MEMORY # display available CPU process memory
181216 #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)
431466
432467 # Unit tests
433468 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 )
436471 endif ()
437472
438473 # CLI + GUI Automation testing
439474 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 ()
442481 endif ()
443482
444483endif ()
@@ -467,13 +506,15 @@ if (CMP_HOST_WINDOWS)
467506 PATTERN "media" EXCLUDE
468507 )
469508
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 ()
477518
478519 install (
479520 DIRECTORY ${WINDOWS_BIN_PREFIX} /plugins/compute DESTINATION "plugins/"
@@ -488,20 +529,25 @@ if (CMP_HOST_WINDOWS)
488529 install (FILES ${WINDOWS_BIN_PREFIX} /texture.frag.spv ${WINDOWS_BIN_PREFIX} /texture.vert.spv DESTINATION "." )
489530
490531elseif (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+
492536 install (PROGRAMS scripts/compressonatorcli DESTINATION "." )
493537
494538 # Qt
495539
496- set (QT_INSTALL_LIBS libQt5Core libQt5Gui libicui18n libicuuc libicudata)
540+ if (OPTION_CMP_QT)
541+ set (QT_INSTALL_LIBS libQt5Core)
497542
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* )
500545
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 ()
503549 endforeach ()
504- endforeach ()
550+ endif ()
505551
506552 # OpenCV, TBB, and extra
507553
@@ -551,4 +597,4 @@ set(CPACK_DEBIAN_PACKAGE_MAINTAINER "AMD")
551597set (CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://gpuopen.com/compressonator/" )
552598set (CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)
553599
554- include (CPack )
600+ include (CPack )
0 commit comments