diff --git a/CMakeLists.txt b/CMakeLists.txt index 090d77d0f..98491a90b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -465,6 +465,13 @@ endif() sfml_export_targets() +# configure extras by default when building SFML directly, otherwise hide them +sfml_set_option(SFML_CONFIGURE_EXTRAS ${PROJECT_IS_TOP_LEVEL} BOOL "TRUE to configure extras, FALSE to ignore them") + +if(NOT SFML_CONFIGURE_EXTRAS) + return() +endif() + set(CPACK_PACKAGE_NAME_SUMMARY "Simple and Fast Multimedia Library") set(CPACK_PACKAGE_VENDOR "SFML Team") set(CPACK_PACKAGE_FILE_NAME "SFML-${PROJECT_VERSION}-${CMAKE_CXX_COMPILER_ID}-${CMAKE_CXX_COMPILER_VERSION}-${CMAKE_BUILD_TYPE}") @@ -485,13 +492,6 @@ set(CPACK_NSIS_INSTALLER_MUI_ICON_CODE "!define MUI_WELCOMEFINISHPAGE_BITMAP \\\ include(CPack) -# configure extras by default when building SFML directly, otherwise hide them -sfml_set_option(SFML_CONFIGURE_EXTRAS ${PROJECT_IS_TOP_LEVEL} BOOL "TRUE to configure extras, FALSE to ignore them") - -if(NOT SFML_CONFIGURE_EXTRAS) - return() -endif() - # add an option for building the API documentation sfml_set_option(SFML_BUILD_DOC FALSE BOOL "TRUE to generate the API documentation, FALSE to ignore it") if(SFML_BUILD_DOC)