Sfoglia il codice sorgente

Macro ctkMacroGetTargetLibraries can now be used out of a target directory

This could be achieved specifying the target directory using a second
parameter.
Jean-Christophe Fillion-Robin 14 anni fa
parent
commit
6ae1e1a9e3
1 ha cambiato i file con 12 aggiunte e 2 eliminazioni
  1. 12 2
      CMake/ctkMacroTargetLibraries.cmake

+ 12 - 2
CMake/ctkMacroTargetLibraries.cmake

@@ -19,12 +19,22 @@
 ###########################################################################
 
 #
+# This macro could be invoked using two different signatures:
+#   ctkMacroGetTargetLibraries(TARGET_LIBS)
+# or 
+#   ctkMacroGetTargetLibraries(TARGET_LIBS "/path/to/ctk_target_dir")
 #
+# Without specifying the second argument, the current folder will be used.
 #
 MACRO(ctkMacroGetTargetLibraries varname)
 
-  SET(filepath ${CMAKE_CURRENT_SOURCE_DIR}/target_libraries.cmake)
-  SET(manifestpath ${CMAKE_CURRENT_SOURCE_DIR}/manifest_headers.cmake)
+  SET(TARGET_DIRECTORY ${ARGV1})
+  IF("${TARGET_DIRECTORY}" STREQUAL "")
+    SET(TARGET_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+  ENDIF()
+
+  SET(filepath ${TARGET_DIRECTORY}/target_libraries.cmake)
+  SET(manifestpath ${TARGET_DIRECTORY}/manifest_headers.cmake)
 
   # Check if "target_libraries.cmake" or "manifest_headers.cmake" file exists
   IF(NOT EXISTS ${filepath} AND NOT EXISTS ${manifestpath})