${CMAKE_CURRENT_BINARY_DIR}/bb${BBTK_PACKAGE_NAME}Package.h
@ONLY IMMEDIATE
)
-INSTALL_FILES(
- /include/bb${BBTK_PACKAGE_NAME}
- FILES
- bb${BBTK_PACKAGE_NAME}Package.h)
+INSTALL(
+ FILES bb${BBTK_PACKAGE_NAME}Package.h
+ DESTINATION include/bb${BBTK_PACKAGE_NAME}
+ )
#----------------------------------------------------------------------------
#----------------------------------------------------------------------------
GET_FILENAME_COMPONENT(filename "${xmlfile}" NAME_WE)
- # IF(BBFY_DEPENDENCY)
- # SET(BBFY_DEPENDENCY_STR ${bbfy_EXECUTABLE})
- # ENDIF(BBFY_DEPENDENCY)
+ IF(EXISTS ${BBTK_BBFY})
+ SET(BBFY_DEPENDENCY)
+ ELSE(EXISTS ${BBTK_BBFY})
+ SET(BBFY_DEPENDENCY ${BBTK_BBFY})
+ ENDIF(EXISTS ${BBTK_BBFY})
SET(BBFY_CXX_OUT ${CMAKE_CURRENT_BINARY_DIR}/${filename}.cxx)
COMMAND
${BBTK_BBFY} ${xmlfile} ${CMAKE_CURRENT_BINARY_DIR}/ -q
DEPENDS ${xmlfile}
- # LG : REMOVE AUTOMATIC DEPEDENCY ON bbfy BECAUSE CAUSED ALWAYS REBUILD xml BOXES WHEN bbtk CHANGED HENCE bbfy CHANGED
- ${BBFY_DEPENDENCY_STR}
- #${BBTK_BBFY}
+ ${BBFY_DEPENDENCY}
)
SET_SOURCE_FILES_PROPERTIES(
)
ENDIF(NOT BBTK_PACKAGE_CXX_SOURCES MATCHES "${filename}")
- INSTALL_FILES(/include/bb${BBTK_PACKAGE_NAME} FILES ${filename}.h)
+ INSTALL(
+ FILES ${filename}.h
+ DESTINATION include/bb${BBTK_PACKAGE_NAME})
ENDFOREACH(xmlfile)
#----------------------------------------------------------------------------
#----------------------------------------------------------------------------
# INSTALLS LIBRARY
-# NOW USES THE InstallLibrary.cmake
+FILE(GLOB ${BBTK_PACKAGE_NAME}_HEADERS "*.h")
+INSTALL(
+ FILES ${${BBTK_PACKAGE_NAME}_HEADERS}
+ DESTINATION include/bb${BBTK_PACKAGE_NAME}
+ )
+INSTALL(
+ TARGETS bb${BBTK_PACKAGE_NAME}
+ DESTINATION lib)
+
+# CreateFindPackage
SET( LIBRARY_NAME bb${BBTK_PACKAGE_NAME} )
# SET THE LIB VERSION
SET(${LIBRARY_NAME}_MAJOR_VERSION ${BBTK_PACKAGE_MAJOR_VERSION})
SET(${LIBRARY_NAME}_MINOR_VERSION ${BBTK_PACKAGE_MINOR_VERSION})
SET(${LIBRARY_NAME}_BUILD_VERSION ${BBTK_PACKAGE_BUILD_VERSION})
#
-#SET(INSTALL_LIBRARY_PATH ../cmake)
-# Include the file 'InstallLibrary.cmake' which does the clean install job
-#INCLUDE(${INSTALL_LIBRARY_PATH}/InstallLibrary.cmake)
-
-# OLD VERSION :
-# DEPRECATED SYNTAX BUT WHICH WORKS !!
-INSTALL_FILES(/include/bb${BBTK_PACKAGE_NAME} "\\.h$")
-#INSTALL(FILES "$.h" DESTINATION include/${BBTK_PACKAGE_NAME})
-INSTALL(TARGETS bb${BBTK_PACKAGE_NAME} DESTINATION lib)
-# INSTALL_TARGETS(/lib bb${BBTK_PACKAGE_NAME})
+SET(${LIBRARY_NAME}_INSTALL_FOLDER bb${BBTK_PACKAGE_NAME})
+SET(${LIBRARY_NAME}_LIBRARIES bb${BBTK_PACKAGE_NAME})
+
+FILE(RELATIVE_PATH
+ ${LIBRARY_NAME}_BUILD_TREE_RELATIVE_INCLUDE_PATHS
+ ${PROJECT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
+ )
+
+IF(UNIX)
+ SET(${LIBRARY_NAME}_BUILD_TREE_RELATIVE_LIBRARY_PATHS
+ ${EXECUTABLE_OUTPUT_REL_PATH})
+ELSE(UNIX)
+ SET(${LIBRARY_NAME}_BUILD_TREE_RELATIVE_LIBRARY_PATHS
+ ${EXECUTABLE_OUTPUT_REL_PATH}/Debug
+ ${EXECUTABLE_OUTPUT_REL_PATH}/Release)
+ENDIF(UNIX)
+SET(${LIBRARY_NAME}_INSTALL_TREE_RELATIVE_INCLUDE_PATHS
+ include/bb${BBTK_PACKAGE_NAME})
+SET(${LIBRARY_NAME}_INSTALL_TREE_RELATIVE_LIBRARY_PATHS lib)
+
+# OPTIONAL
+# - Set the version of your library
+# SET YOUR LIB VERSION
+#SET(${LIBRARY_NAME}_MAJOR_VERSION 1)
+#SET(${LIBRARY_NAME}_MINOR_VERSION 0)
+#SET(${LIBRARY_NAME}_BUILD_VERSION 0)
+# REQUIRED BUILD FLAGS
+#SET(${LIBRARY_NAME}_REQUIRED_C_FLAGS "")
+#SET(${LIBRARY_NAME}_REQUIRED_CXX_FLAGS "")
+#SET(${LIBRARY_NAME}_REQUIRED_LINK_FLAGS "")
+# ADDITIONAL CONFIG FILE
+# HERE WE USE ONE TO EXPORT testLib_EXPORTED_VALUE
+#
+SET(${LIBRARY_NAME}_HAS_ADDITIONAL_CONFIG_FILE FALSE)
+#SET(${LIBRARY_NAME}_ADDITIONAL_CONFIG_FILE
+# ${PROJECT_SOURCE_DIR}/kernel/cmake/AdditionalBBTKConfig.cmake.in)
+#SET(${LIBRARY_NAME}_ADDITIONAL_USE_FILE
+# ${PROJECT_SOURCE_DIR}/kernel/cmake/AdditionalUseBBTK.cmake.in)
+#-----------------------------------------------------------------------------
+
+#-----------------------------------------------------------------------------
+# Includes CMakeCreateFindPackage
+INCLUDE(${CMakeCreateFindPackage_DIR}/CMakeCreateFindPackage.cmake)
+CMAKE_CREATE_FIND_PACKAGE(${LIBRARY_NAME})
+#-----------------------------------------------------------------------------
+
#----------------------------------------------------------------------------