I used ExternalProject_Add
to add multiple libraries to my project but I cannot set location of output of these libs. ExternalProject_Add
has a BINARY_DIR
parameter which setting it to desired location does not work as I expect. Also I set INSTALL_DIR
but anything changed.
ExternalProject_Add (${name}
SOURCE_DIR "${${name}_SOURCE_DIR}"
BINARY_DIR "${${name}_BINARY_DIR}"
CMAKE_ARGS "-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}"
"-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}"
"-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
INSTALL_COMMAND ""
)
PS:
1) I need to collect all libs in the project/bin/libs
folder in order to use other programs (suppose project
is the main folder which has CMakeLists.txt
contained ExternalProject_Add
. Also libs are in the path project/lib/third party/libA
through libf
and project/lib/MyLibs/lib1
through lib3
).
2) Q: What can do if we need to copy libs (like libA.dll
and lib1.dll
) to multiple destinations (like project/../external_application_A
and project/../external_application_B
) using project/CMakeLists.txt
?
3) I used alexander-huszagh macros from this link (last answer).