I'm trying to install a project to /home/tom/usr/local instead of the standard /usr/local. I have tried the following:
$ mkdir build && cd build $ cmake -DCMAKE_INSTALL_PREFIX:PATH=/home/tom .. At this point, I have a CMakeCache.txt file that contains the correct path. I have a cmake_install.cmake with the lines: if(NOT DEFINED CMAKE_INSTALL_PREFIX) set(CMAKE_INSTALL_PREFIX "foo") endif() Where "foo" is found in the project's CMakeLists.txt as a default install prefix via `set(CMAKE_INSTALL_PREFIX ${CMAKE_PROJECT_NAME})`. Unfortunately, when I run `make install`, the project is still being installed to `build/foo/`. My apparently incorrect understanding is that passing the value on the command line initially would override whatever was set() in the project's CMakeLists.txt, but that isn't the case. Since I'm actually installing this project using ExternalProject_Add(), how can I override the set() in the project's CMakeLists.txt, if not by using the extra argument during the CONFIGURE step? -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake