I have totally 5 targets. one of them is static library. other 4 are executables.
I don't want the library to be build for every time. so i just want to compile the library keep it in a particular location so that other executables can refer this library. i understood that we can do this by using install
command.
But if i use install
command, it is compiling all the targets. how to only compile one target and intall it into a location ?
add_compile_definitions(CMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY true)
install(TARGETS mylib DESTINATION lib)