diff --git a/CMakeLists.txt b/CMakeLists.txt index 34a1aacd3..e80f35eb0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -88,7 +88,7 @@ option(EMIL_BUILD_TESTS "Enable building the tests" ${EMIL_DEFAULTOPT}) option(EMIL_BUILD_EXAMPLES "Enable building the examples" ${EMIL_DEFAULTOPT}) option(EMIL_ENABLE_FUZZING "Enable building the fuzzing targets" Off) option(EMIL_ENABLE_DOCKER_TOOLS "Enable shift-left tools (e.g. linters, formatters) that are run using Docker" On) -option(EMIL_GENERATE_PACKAGE_CONFIG "Enable generation of package configuration and install files" ${EMIL_HOST_BUILD}) +option(EMIL_BUILD_ECHO_COMPILERS "Build and install the Protobuf ECHO compilers" ${EMIL_DEFAULTOPT}) # Enable or disable optional features. option(EMIL_INCLUDE_MBEDTLS "Include MbedTLS as part of EmIL" On) @@ -148,18 +148,12 @@ if (EMIL_STANDALONE) emil_folderize_all_targets() endif() -if (EMIL_GENERATE_PACKAGE_CONFIG) +if (EMIL_BUILD_ECHO_COMPILERS) function(generate_export_targets name) - # Generate and install export file install(EXPORT emil${name}Targets FILE emil${name}Targets.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/emil ) - - # Generate the export targets for the build tree - export(EXPORT emil${name}Targets - FILE "${CMAKE_CURRENT_BINARY_DIR}/cmake/emil${name}Targets.cmake" - ) endfunction() foreach(target IN ITEMS Protobuf) @@ -184,20 +178,20 @@ if (EMIL_GENERATE_PACKAGE_CONFIG) "${CMAKE_CURRENT_BINARY_DIR}/cmake/${PROJECT_NAME}ConfigVersion.cmake" DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} ) - - set(CPACK_GENERATOR "ZIP;TGZ") - set(CPACK_SOURCE_IGNORE_FILES ".vs/;.git/;build/") - set(CPACK_PACKAGE_NAME "${PROJECT_NAME}") - set(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}") - set(CPACK_PACKAGE_VENDOR "Koninklijke Philips N.V") - set(CPACK_PACKAGE_DESCRIPTION "${PROJECT_DESCRIPTION}") - set(CPACK_DEBIAN_PACKAGE_NAME "${CPACK_PACKAGE_NAME}") - set(CPACK_RPM_PACKAGE_NAME "${CPACK_PACKAGE_NAME}") - set(CPACK_PACKAGE_HOMEPAGE_URL "${PROJECT_HOMEPAGE_URL}") - set(CPACK_PACKAGE_MAINTAINER "${CPACK_PACKAGE_VENDOR}") - set(CPACK_DEBIAN_PACKAGE_MAINTAINER "${CPACK_PACKAGE_VENDOR}") - set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.md") - set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.md") - - include(CPack) endif() + +set(CPACK_GENERATOR "ZIP;TGZ") +set(CPACK_SOURCE_IGNORE_FILES ".vs/;.git/;build/") +set(CPACK_PACKAGE_NAME "${PROJECT_NAME}") +set(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}") +set(CPACK_PACKAGE_VENDOR "Koninklijke Philips N.V") +set(CPACK_PACKAGE_DESCRIPTION "${PROJECT_DESCRIPTION}") +set(CPACK_DEBIAN_PACKAGE_NAME "${CPACK_PACKAGE_NAME}") +set(CPACK_RPM_PACKAGE_NAME "${CPACK_PACKAGE_NAME}") +set(CPACK_PACKAGE_HOMEPAGE_URL "${PROJECT_HOMEPAGE_URL}") +set(CPACK_PACKAGE_MAINTAINER "${CPACK_PACKAGE_VENDOR}") +set(CPACK_DEBIAN_PACKAGE_MAINTAINER "${CPACK_PACKAGE_VENDOR}") +set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.md") +set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.md") + +include(CPack) diff --git a/protobuf/protoc_echo_plugin/CMakeLists.txt b/protobuf/protoc_echo_plugin/CMakeLists.txt index c9f8b14e7..19fce22c6 100644 --- a/protobuf/protoc_echo_plugin/CMakeLists.txt +++ b/protobuf/protoc_echo_plugin/CMakeLists.txt @@ -26,8 +26,8 @@ if (EMIL_HOST_BUILD) if (NOT CMAKE_CROSSCOMPILING) add_executable(protobuf.protoc_echo_plugin) - emil_build_for(protobuf.protoc_echo_plugin BOOL EMIL_STANDALONE) - install(TARGETS protobuf.protoc_echo_plugin EXPORT emilProtobufTargets DESTINATION bin) + emil_build_for(protobuf.protoc_echo_plugin BOOL EMIL_BUILD_ECHO_COMPILERS) + emil_install(protobuf.protoc_echo_plugin EXPORT emilProtobufTargets DESTINATION bin) target_link_libraries(protobuf.protoc_echo_plugin PUBLIC protobuf.protoc_echo_plugin_lib diff --git a/protobuf/protoc_echo_plugin_csharp/CMakeLists.txt b/protobuf/protoc_echo_plugin_csharp/CMakeLists.txt index e4a223263..8e6ae63c8 100644 --- a/protobuf/protoc_echo_plugin_csharp/CMakeLists.txt +++ b/protobuf/protoc_echo_plugin_csharp/CMakeLists.txt @@ -1,7 +1,7 @@ if (EMIL_HOST_BUILD AND NOT CMAKE_CROSSCOMPILING) add_executable(protobuf.protoc_echo_plugin_csharp) - emil_build_for(protobuf.protoc_echo_plugin_csharp BOOL EMIL_STANDALONE) - install(TARGETS protobuf.protoc_echo_plugin_csharp EXPORT emilProtobufTargets DESTINATION bin) + emil_build_for(protobuf.protoc_echo_plugin_csharp BOOL EMIL_BUILD_ECHO_COMPILERS) + emil_install(protobuf.protoc_echo_plugin_csharp EXPORT emilProtobufTargets DESTINATION bin) target_link_libraries(protobuf.protoc_echo_plugin_csharp PUBLIC protobuf.protoc_echo_plugin_lib diff --git a/protobuf/protoc_echo_plugin_java/CMakeLists.txt b/protobuf/protoc_echo_plugin_java/CMakeLists.txt index 4e8182fc4..3d1ef6b4a 100644 --- a/protobuf/protoc_echo_plugin_java/CMakeLists.txt +++ b/protobuf/protoc_echo_plugin_java/CMakeLists.txt @@ -1,7 +1,7 @@ if (EMIL_HOST_BUILD AND NOT CMAKE_CROSSCOMPILING) add_executable(protobuf.protoc_echo_plugin_java) - emil_build_for(protobuf.protoc_echo_plugin_java BOOL EMIL_STANDALONE) - install(TARGETS protobuf.protoc_echo_plugin_java EXPORT emilProtobufTargets DESTINATION bin) + emil_build_for(protobuf.protoc_echo_plugin_java BOOL EMIL_BUILD_ECHO_COMPILERS) + emil_install(protobuf.protoc_echo_plugin_java EXPORT emilProtobufTargets DESTINATION bin) target_link_libraries(protobuf.protoc_echo_plugin_java PUBLIC protobuf.protoc_echo_plugin_lib diff --git a/services/echo_console/CMakeLists.txt b/services/echo_console/CMakeLists.txt index 843ecf8ef..43ba34bb1 100644 --- a/services/echo_console/CMakeLists.txt +++ b/services/echo_console/CMakeLists.txt @@ -1,6 +1,6 @@ if (EMIL_HOST_BUILD) add_executable(services.echo_console ${EMIL_EXCLUDE_FROM_ALL}) - emil_install(services.echo_console EXPORT emilProtobufTargets DESTINATION bin) + emil_install(services.echo_console DESTINATION bin) target_link_libraries(services.echo_console PUBLIC args