@@ -27,7 +27,7 @@ endif(NOT GTEST_FOUND)
27
27
#########################################################
28
28
# FIND GLUT
29
29
#########################################################
30
- find_package (GLUT REQUIRED )
30
+ find_package (GLUT )
31
31
include_directories (${GLUT_INCLUDE_DIRS} )
32
32
link_directories (${GLUT_LIBRARY_DIRS} )
33
33
add_definitions (${GLUT_DEFINITIONS} )
@@ -59,14 +59,28 @@ if(APPLE)
59
59
endif ()
60
60
61
61
62
+ #########################################################
63
+ # Make relative paths absolute (needed later on)
64
+ #########################################################
65
+
66
+ foreach (p LIB BIN INCLUDE CMAKE )
67
+ set (var INSTALL_${p}_DIR )
68
+ if (NOT IS_ABSOLUTE "${${var} }" )
69
+ set (${var} "${CMAKE_INSTALL_PREFIX} /${${var} }" )
70
+ endif ()
71
+ endforeach ()
72
+
73
+
74
+
75
+
62
76
file (GLOB_RECURSE BTHeadLibrary include /*.h )
63
77
64
78
set (BTSrcLibrary
65
79
src/action_node.cpp
66
80
src/behavior_tree.cpp
67
81
src/condition_node.cpp
68
82
src/control_node.cpp
69
- src/draw.cpp
83
+ # src/draw.cpp
70
84
src/exceptions.cpp
71
85
src/leaf_node.cpp
72
86
src/tick_engine.cpp
@@ -105,27 +119,59 @@ target_link_libraries(btpp_example ${OPENGL_LIBRARIES} ${GLUT_LIBRARY} ${X11_LI
105
119
######################################################
106
120
# COMPILING LIBRARY
107
121
######################################################
108
- add_library (BTpp STATIC ${BTSrcLibrary} ${BTHeadLibrary} )
109
- target_link_libraries (BTpp ${OPENGL_LIBRARIES} ${GLUT_LIBRARY} ${X11_LIBRARIES} )
122
+ add_library (BTppLib STATIC ${BTSrcLibrary} ${BTHeadLibrary} )
123
+ target_link_libraries (BTppLib ${OPENGL_LIBRARIES} ${GLUT_LIBRARY} ${X11_LIBRARIES} )
110
124
111
125
######################################################
112
- # INSTALLATION OF LIBRARY AND EXECUTABLE TO /usr/local
126
+ # INSTALLATION OF LIBRARY AND EXECUTABLE
113
127
######################################################
114
- install (TARGETS BTpp
115
- EXPORT btpp-targets
116
- DESTINATION lib/BTpp
117
- )
118
128
119
- export (PACKAGE BTpp )
120
129
121
- install (EXPORT btpp-targets DESTINATION lib/BTpp )
122
130
123
- install (FILES btpp-config.cmake DESTINATION lib/BTpp )
124
- #set(btpp_INCLUDE_DIRS /usr/local/include/BTpp)
125
- #set(btpp_LIBRARY /usr/local/lib/BTpp/libbtpp.a)
126
- #message("the value of btpp_INCLUDE_DIRS: " ${btpp_INCLUDE_DIRS})
127
- #message("the value of btpp_LIBRARY: " ${btpp_LIBRARY})
131
+ # Add all targets to the build-tree export set
132
+ export (TARGETS BTppLib
133
+ FILE "${PROJECT_BINARY_DIR} /BTppTargets.cmake" )
134
+
135
+ # Export the package for use from the build-tree
136
+ # (this registers the build-tree with a global CMake-registry)
137
+ export (PACKAGE BTpp )
128
138
129
139
140
+ install (TARGETS BTppLib
141
+ # IMPORTANT: Add the foo library to the "export-set"
142
+ EXPORT BTppTargets
143
+ ARCHIVE DESTINATION "${PROJECT_BINARY_DIR} /arc"
144
+ RUNTIME DESTINATION "${PROJECT_BINARY_DIR} /bin" COMPONENT ${PROJECT_SOURCE_DIR} /bin
145
+ LIBRARY DESTINATION "${PROJECT_BINARY_DIR} /lib" COMPONENT ${PROJECT_SOURCE_DIR} /shlib
146
+ PUBLIC_HEADER DESTINATION "${INSTALL_INCLUDE_DIR} /BTpp"
147
+ COMPONENT dev )
148
+
149
+
150
+ # Create the FooBarConfig.cmake and FooBarConfigVersion files
151
+ file (RELATIVE_PATH REL_INCLUDE_DIR "${INSTALL_CMAKE_DIR} "
152
+ "${INSTALL_INCLUDE_DIR} " )
153
+ # ... for the build tree
154
+
155
+
156
+ set (CONF_INCLUDE_DIRS "${PROJECT_SOURCE_DIR} /include" "${PROJECT_BINARY_DIR} " )
157
+ configure_file (conf/BTppConfig.cmake.in
158
+ "${PROJECT_BINARY_DIR} /BTppConfig.cmake" @ONLY )
159
+ # ... for the install tree
160
+ set (CONF_INCLUDE_DIRS "\$ {BTpp_CMAKE_DIR}/${REL_INCLUDE_DIR} " )
161
+ configure_file (conf/BTppConfig.cmake.in
162
+ "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY} /BTppConfig.cmake" @ONLY )
163
+ # ... for both
164
+ configure_file (conf/BTppConfigVersion.cmake.in
165
+ "${PROJECT_BINARY_DIR} /BTppConfigVersion.cmake" @ONLY )
166
+
167
+ # Install the YARPBTCoreConfig.cmake and YARPBTCoreConfigVersion.cmake
168
+ install (FILES
169
+ "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY} /BTppConfig.cmake"
170
+ "${PROJECT_BINARY_DIR} /BTppConfigVersion.cmake"
171
+ DESTINATION "${INSTALL_CMAKE_DIR} " COMPONENT dev )
172
+
173
+ # Install the export set for use with the install-tree
174
+ install (EXPORT BTppTargets DESTINATION
175
+ "${INSTALL_CMAKE_DIR} " COMPONENT dev )
130
176
131
177
0 commit comments