A smiple cmakelists like this. Without specifying the CMAKE_ARGS
CMAKE_INSTALL_PREFIX this tries to install into c:\program files.
-----
cmake_minimum_required(VERSION 3.6)
include( ExternalProject )
ExternalProject_Add( external
PREFIX ${CMAKE_BINARY_DIR}/tmpout
SOURCE_DIR ${CMAKE_SOURCE_DIR}/extern
INSTALL_DIR ${CMAKE_BINARY_DIR}/output
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/output
)
---- ./extern/cmakelists.txt
cmake_minimum_required(VERSION 3.6)
INSTALL( FILES tmp.bat DESTINATION data )
--------
I was trying to figure out why the install is failing on another project,
it says (using vs 2015 generator)
MSBUILD : error MSB1009: Project file does not exist.
[M:\javascript\vfs\native\build\sack.vcxproj]
Switch: install
in which the rule that runs
C:\tools\unix\cmake\bin\cmake.exe --build . --config Debug --target install
is failling... to work it would have to be INSTALL.
but my simple case isn't causing the same failure
----
Been tinkering with this for a couple hours trying to make the example more
close to the full case, but cannot; if I edit the rule and make the
'--target INSTALL' then it works in the actual case... although the same
thing works fine in the simplified example....
--------
Line 1766 of ExternalProject in latest cmake download
list(APPEND args --target install)
should(could) be
if( MSVC )
list(APPEND args --target INSTALL)
else( MSVC )
list(APPEND args --target install)
endif( MSVC )
which fixes my issue.
--
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