Skip to content

CMake's BUILD_ONLY Parameter doesn't work when SDK added as ExternalProject_Add #826

Description

@PauGuillamon

What platform/OS are you using?

Ubuntu 14.04

What compiler are you using? what version?

gcc 4.8.4
cmake version 3.8.2

What's your CMake arguments?

set(cmake_args -DCMAKE_INSTALL_PREFIX=${AMAZON_SDK_INSTALLATION_PATH})

include(ExternalProject)
ExternalProject_Add(amazonSdk
	GIT_REPOSITORY "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/aws/aws-sdk-cpp.git"
	GIT_TAG "1.4.15"
	CMAKE_ARGS -DBUILD_ONLY=\\\"s3;email\\\" LOG_CONFIGURE 1 ${cmake_args}
	PREFIX "${AMAZON_SDK_PATH}"
)

Can you provide a TRACE level log? (sanitize any sensitive information)

[ 23%] Performing update step for 'amazonSdk'
[ 29%] Performing configure step for 'amazonSdk'
CMake Error at /home/pguillamon/sample-repo/build/src/3rdPartyDependencies/amazonSdk/src/amazonSdk-stamp/amazonSdk-configure-.cmake:16 (message):
  Command failed: 1

   '/usr/local/bin/cmake' '-DBUILD_ONLY="s3' 'email"' '-GUnix Makefiles' '/home/pguillamon/sample-repo/build/src/3rdPartyDependencies/amazonSdk/src/amazonSdk'

  See also

    /home/pguillamon/sample-repo/build/src/3rdPartyDependencies/amazonSdk/src/amazonSdk-stamp/amazonSdk-configure-*.log


make[2]: *** [src/3rdPartyDependencies/amazonSdk/src/amazonSdk-stamp/amazonSdk-configure] Error 1

Note the parameter -DBUILD_ONLY="s3;email" has been splitted into two parameters: -DBUILD_ONLY="s3 and email". This is because the script amazonSdk-configure-.cmake generated by cmake uses ; (semicolon) as character separator. It is generated as follows:

set(command "/usr/local/bin/cmake;-DBUILD_ONLY=\"email;s3\";-GUnix Makefiles;/home/pguillamon/sample-repo/build/src/3rdPartyDependencies/amazonSdk/src/amazonSdk")
execute_process(
  COMMAND ${command}
...

Activity

  1. singku commented on Mar 19, 2018

    @singku
    Contributor

    Hi due to the internal manner of ExternalProject_Add processing list, could you please update you scripts from -DBUILD_ONLY=\\\"s3;email\\\" to -DBUILD_ONLY='s3|email' or -DBUILD_ONLY=s3|email. AS WELL AS Adding LIST_SEPARATOR "|" to ExternalProject_Add

    So the scripts should look as follow:

    ExternalProject_Add(amazonSdk
    	GIT_REPOSITORY "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/aws/aws-sdk-cpp.git"
    	GIT_TAG "1.4.15"
            LIST_SEPARATOR "|"
    	CMAKE_ARGS -DBUILD_ONLY=s3|email LOG_CONFIGURE 1 ${cmake_args}
    	PREFIX "${AMAZON_SDK_PATH}"
    )
    

    And try again?

  2. PauGuillamon commented on Mar 20, 2018

    @PauGuillamon
    Author

    I didn't see that parameter. It worked perfectly, thanks a lot!

    ExternalProject_Add(${AMAZON_SDK}
        GIT_REPOSITORY "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/aws/aws-sdk-cpp.git"
        GIT_TAG "1.4.15"
        LIST_SEPARATOR "|"
        CMAKE_ARGS -DBUILD_ONLY=s3|email ${cmake_args}
        PREFIX "${AMAZON_SDK}"
    )
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions