Skip to content

Commit 6f7add6

Browse files
andreidanila1bindea-cristian
authored andcommitted
packages/cmake: Fix enable_all_packages functionality.
Signed-off-by: andreidanila1 <[email protected]>
1 parent 49c3a2a commit 6f7add6

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

cmake/Modules/PackageUtils.cmake

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ function(add_subdirectories_with_options base_dir output_dir prefix)
2424
file(GLOB CHILDREN RELATIVE ${base_dir} ${base_dir}/*)
2525

2626
foreach(child ${CHILDREN})
27+
message("")
2728
if(IS_DIRECTORY ${base_dir}/${child})
2829
string(TOUPPER ${child} CHILD_UPPER)
2930
set(ENABLE_CHILD_VAR "${prefix}_${CHILD_UPPER}")
@@ -50,6 +51,7 @@ function(add_subdirectories_with_options base_dir output_dir prefix)
5051
endif()
5152
else()
5253
message(STATUS "Skipping: ${child}")
54+
message(STATUS "To enable this package use -D${ENABLE_CHILD_VAR}=ON")
5355
endif()
5456
endif()
5557
endforeach()
@@ -61,9 +63,8 @@ function(enable_all base_dir enable prefix)
6163
if(IS_DIRECTORY ${base_dir}/${child})
6264
string(TOUPPER ${child} CHILD_UPPER)
6365
set(ENABLE_CHILD_VAR "${prefix}_${CHILD_UPPER}")
64-
6566
if(NOT DEFINED ${ENABLE_CHILD_VAR})
66-
set(${ENABLE_CHILD_VAR} ${enable} CACHE BOOL "Enable ${prefix} ${child}")
67+
set(${ENABLE_CHILD_VAR} ${enable} CACHE BOOL "Enable ${prefix} ${child}" FORCE)
6768
endif()
6869
endif()
6970
endforeach()

packages/CMakeLists.txt

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,20 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
3535
endif()
3636
include(PackageUtils)
3737

38-
set(ENABLE_PACKAGE_TEST-PLUGINS OFF)
39-
set(ENABLE_PACKAGE_EXTPROC OFF)
40-
if(DISABLE_ALL_PACKAGES)
38+
if(DISABLE_ALL_PACKAGES MATCHES ON)
4139
enable_all_packages(${CMAKE_CURRENT_SOURCE_DIR} OFF)
4240
message(STATUS "DISABLE_ALL_PACKAGES is set.")
4341
elseif(ENABLE_ALL_PACKAGES MATCHES ON)
4442
enable_all_packages(${CMAKE_CURRENT_SOURCE_DIR} ON)
4543
message(STATUS "ENABLE_ALL_PACKAGES is set.")
4644
endif()
45+
46+
# Default disabled packages
47+
if(NOT DEFINED ENABLE_PACKAGE_TEST-PLUGINS)
48+
set(ENABLE_PACKAGE_TEST-PLUGINS ON CACHE BOOL "Enable test plugins package" FORCE)
49+
endif()
50+
51+
if(NOT DEFINED ENABLE_PACKAGE_EXTPROC)
52+
set(ENABLE_PACKAGE_EXTPROC ON CACHE BOOL "Enable extproc package" FORCE)
53+
endif()
4754
add_packages(${CMAKE_CURRENT_SOURCE_DIR} ${SCOPY_PACKAGE_BUILD_PATH})

0 commit comments

Comments
 (0)