I am attempting to use the generate_export_header function. My library source code is in the src
folder, so CMake generates the export header at src/mylib_export.h
. In order, to use this export header do I just copy it into my library's include
folder to use in the implementation code? Here is a snippet of the CMake code I'm using:
ADD_LIBRARY(${PROJECT_NAME} ${LIB_TYPE} ${SOURCES})
GENERATE_EXPORT_HEADER(${PROJECT_NAME})
FILE(COPY
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}_export.h
DESTINATION
${PROJECT_SOURCE_DIR}/include
)
Is there a more CMake way of doing this?