Solve funchook dependency error.
@@ -28,6 +28,8 @@ elseif(APPLE)
set(FUNCHOOK_LIBRARY_INSTALL_SUFFIX "so")
endif()
+set(FUNCHOOK_SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/funchook/src/funchook")
+
if(WIN32)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/download.bat.in ${CMAKE_CURRENT_BINARY_DIR}/download.bat @ONLY)
set(FUNCHOOK_DOWNLOAD_COMMAND ${CMAKE_CURRENT_BINARY_DIR}/download.bat)
@@ -40,10 +42,9 @@ else()
set(FUNCHOOK_INSTALL_DIR "${CMAKE_BINARY_DIR}")
endif()
-set(FUNCHOOK_SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/funchook/src/funchook")
set(FUNCHOOK_INCLUDE_DIR "${FUNCHOOK_SOURCE_DIR}/include")
-set(FUNCHOOK_LIBRARY_DIR "${FUNCHOOK_INSTALL_DIR}/${FUNCHOOK_LIBRARY_PREFIX}funchook.${FUNCHOOK_LIBRARY_SUFFIX}")
-set(FUNCHOOK_LIBRARY_INSTALL_DIR "${FUNCHOOK_INSTALL_DIR}/${FUNCHOOK_LIBRARY_PREFIX}funchook.${FUNCHOOK_LIBRARY_INSTALL_SUFFIX}")
+set(FUNCHOOK_LIBRARY_DIR "${FUNCHOOK_SOURCE_DIR}/${FUNCHOOK_LIBRARY_PREFIX}funchook.${FUNCHOOK_LIBRARY_SUFFIX}")
+set(FUNCHOOK_LIBRARY_INSTALL_DIR "${FUNCHOOK_SOURCE_DIR}/${FUNCHOOK_LIBRARY_PREFIX}funchook.${FUNCHOOK_LIBRARY_INSTALL_SUFFIX}")
ExternalProject_Add(
${target_depends}
@@ -61,13 +62,6 @@ ExternalProject_Add(
LOG_INSTALL ON
)
-# Library
-install(FILES
- ${FUNCHOOK_LIBRARY_INSTALL_DIR}
- DESTINATION ${INSTALL_LIB}
- COMPONENT runtime
-)
-
#
# Library name and options
#
@@ -271,6 +265,13 @@ target_link_libraries(${target}
# Deployment
#
+# Dependency
+install(FILES
+ ${FUNCHOOK_LIBRARY_INSTALL_DIR}
+ DESTINATION ${INSTALL_LIB}
+ COMPONENT runtime
+)
+
# Library
install(TARGETS ${target}
EXPORT "${target}-export" COMPONENT dev
