iot-edge-v1 icon indicating copy to clipboard operation
iot-edge-v1 copied to clipboard

"cmake --build . --target install" always install to /usr/local

Open Kevin0626 opened this issue 7 years ago • 6 comments

Hi, The issue is following issue 225: https://github.com/Azure/azure-iot-gateway-sdk/issues/225

We found following commands always install the gateway files into /usr/local cd build cmake --build . --target install

We need to install to some our defined folder, or the local "install-deps" folder. Any advice how to do that?

Thanks..

Kevin0626 avatar Apr 28 '17 14:04 Kevin0626

Hello @Kevin0626 , the default cmake install prefix is /usr/local. It can be set to a different value adding the following option to the command line: -DCMAKE_INSTALL_PREFIX:PATH=<new path>

I'm pretty sure this is the only option you need, but there might be others that affect what you want. Please let me know if that works.

darobs avatar Apr 28 '17 15:04 darobs

Closing due to inactivity. Please reopen if the issue persists. Thanks!

myagley avatar May 15 '17 15:05 myagley

@darobs CMAKE_INSTALL_PREFIX in tools/build.sh has no impact on dependencies. Deps still continue to go to /usr/local

kiranpradeep avatar Jul 03 '17 08:07 kiranpradeep

I replied, then I realized it's not working like I expected. The build is supposed to propagate the CMAKE_INSTALL_PREFIX to the dependencies, but if it's not, then that's a bug.

darobs avatar Jul 03 '17 16:07 darobs

" -DCMAKE_INSTALL_PREFIX:PATH=" was not working for me. I just took a workaround:

    cd $azure_root/build
#cmake $toolchain_def -DCMAKE_INSTALL_PREFIX:PATH=$install_path --build .
make DESTDIR=$install_path install

Kevin0626 avatar Jul 04 '17 05:07 Kevin0626

@Kevin0626 are you still interested in investigating this? If so we'll need more detailed repro steps, otherwise I'll close this out.

In some of your comments you mention our build script tools/build.sh but in others you talk about using cmake directly on the command line, so I'm not sure what you're trying to do. Also, the commented-out command from your last comment is confusing to me:

cmake $toolchain_def -DCMAKE_INSTALL_PREFIX:PATH=$install_path --build .

You generally run CMake twice; the first command generates the project files (makefiles, visual studio project files, or whatever), and the second command actually builds the projects. But this command has elements of both, so I'd expect it to fail.

damonbarry avatar Apr 10 '18 01:04 damonbarry