This is done like this: install(TARGETS Dep Writing the DepConfig.cmake fileĮvery CMake project that is meant to be used by other CMake projects should “export” its targets. In your case, you want to find a lib that you compiled yourself, so you want to use the Config mode. Usually, Module mode is used when you try to search for a system library or utility, and Config mode when you try to search a library that you built. By default it points to C:/Program Files (x86)/$ directory. The CMAKE_INSTALL_PREFIX cache variable tells CMake where to install your project. I’m not sure why the install commands from the external project can’t “transfer” over to the main project. I think this would probably work but it seems a bit hokey. Do I need to add additional install commands in the main project on each target of the external project?.The binary from the external project ends up in the directory build\extern-prefix\src\extern-build\install and still does not get included in the NSIS installer or the CPack directory in the main project.
CMAKE INSTALL PREFIX OPENCV CODE
With a code block like this: ExternalProject_Add( Just out of curiosity I tried forwarding this on to the external project thinking that maybe it would magically cause the external project’s install statements to be treated the same as install statements in the main project, but that didn’t seem to happen. I notice that CMAKE_INSTALL_PREFIX is “C:/Program Files (x86)/Tutorial” in the main project, which doesn’t make much sense to me.
CMAKE INSTALL PREFIX OPENCV WINDOWS
ExternalProject_Add is not set up to cause the main project to run the External Project’s install step.
Here’s my theories as to what’s happening: The executable file does not appear to be copied to anywhere the main project would know about, either. Unfortunately the executable file from the External Project is not getting packaged in by CPack. The ExternalProject_Add command in my main project’s script looks like this: # main project's ExternalProject_Add command # Literally "SomeDestination", I don't know what directory to put here. In a sample project I have created an External Project that also uses CMake as its install system, it has an install command that looks like this: # External project's install command The default install step builds the install target of the external project The external project’s install rules are not part of the main project’s install rules, so if anything from the external project should be installed as part of the main build, these need to be specified in the main build as additional install() commands. The documentation for ExternalProject mentions this: I am looking to have CMake clone and build a git repository as an ExternalProject, then package in the resulting binary files with the main project.