150 | | # pkg-config (use the CPack information) |
151 | | # FIND_PACKAGE(PkgConfig) |
152 | | # if(PKG_CONFIG_EXECUTABLE) |
153 | | # set(PC_SHORT_NAME "${BUILDSYS_CPACK_NAME}") |
154 | | # set(PC_LONG_NAME "${BUILDSYS_CPACK_NAME}") |
155 | | # set(PC_LIBRARY_NAME "${LIBNIFALCON_CPP}") |
156 | | # set(PC_DESCRIPTION "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}") |
157 | | # set(PC_VERSION "${LIBNIFALCON_MAJOR_VERSION}.${LIBNIFALCON_MINOR_VERSION}.${LIBNIFALCON_BUILD_VERSION}") |
158 | | |
159 | | # if(LIBUSB_1_FOUND) |
160 | | # set(PC_REQUIRES "${PC_REQUIRES}libusb-1.0 ") |
161 | | # set(PC_LINK_FLAGS "${PC_LINK_FLAGS}-lnifalcon_comm_libusb ") |
162 | | # endif(LIBUSB_1_FOUND) |
163 | | |
164 | | # set(PC_LINK_FLAGS "${lib${PC_LIBRARY_NAME}_LINK_FLAGS} ${PC_LINK_FLAGS}") |
165 | | # set(PC_LINK_FLAGS "-l${PC_LIBRARY_NAME} ${PC_LINK_FLAGS}") |
166 | | # set(PC_COMPILE_FLAGS "${lib${PC_LIBRARY_NAME}_COMPILE_FLAGS}") |
167 | | # set(PC_CONFIGURED_FILE |
168 | | # ${CMAKE_BINARY_DIR}/libnifalcon.pc |
169 | | # ) |
170 | | # MESSAGE("-- Generating ${PC_CONFIGURED_FILE}") |
171 | | # configure_file( |
172 | | # ${CMAKE_SOURCE_DIR}/libnifalcon.pc.cmake |
173 | | # ${PC_CONFIGURED_FILE} |
174 | | # @ONLY |
175 | | # ) |
176 | | # set(PKG_CONFIG_DIR "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig") |
177 | | # install(FILES ${PC_CONFIGURED_FILE} DESTINATION ${PKG_CONFIG_DIR}) |
178 | | # endif(PKG_CONFIG_EXECUTABLE) |
| 156 | #pkg-config (use the CPack information) |
| 157 | FIND_PACKAGE(PkgConfig) |
| 158 | if(PKG_CONFIG_EXECUTABLE) |
| 159 | set(PC_SHORT_NAME "${BUILDSYS_CPACK_NAME}") |
| 160 | set(PC_LONG_NAME "${BUILDSYS_CPACK_NAME}") |
| 161 | set(PC_LIBRARY_NAME "${LIBNIFALCON_CPP}") |
| 162 | set(PC_DESCRIPTION "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}") |
| 163 | set(PC_VERSION "${LIBNIFALCON_MAJOR_VERSION}.${LIBNIFALCON_MINOR_VERSION}.${LIBNIFALCON_BUILD_VERSION}") |
| 164 | |
| 165 | if(LIBUSB_1_FOUND) |
| 166 | set(PC_REQUIRES "${PC_REQUIRES}libusb-1.0 ") |
| 167 | set(PC_LINK_FLAGS "${PC_LINK_FLAGS}-lnifalcon_comm_libusb ") |
| 168 | endif(LIBUSB_1_FOUND) |
| 169 | |
| 170 | set(PC_LINK_FLAGS "${lib${PC_LIBRARY_NAME}_LINK_FLAGS} ${PC_LINK_FLAGS}") |
| 171 | set(PC_LINK_FLAGS "-l${PC_LIBRARY_NAME} ${PC_LINK_FLAGS}") |
| 172 | set(PC_COMPILE_FLAGS "${lib${PC_LIBRARY_NAME}_COMPILE_FLAGS}") |
| 173 | set(PC_CONFIGURED_FILE |
| 174 | ${CMAKE_BINARY_DIR}/libnifalcon.pc |
| 175 | ) |
| 176 | MESSAGE("-- Generating ${PC_CONFIGURED_FILE}") |
| 177 | configure_file( |
| 178 | ${CMAKE_SOURCE_DIR}/libnifalcon.pc.cmake |
| 179 | ${PC_CONFIGURED_FILE} |
| 180 | @ONLY |
| 181 | ) |
| 182 | set(PKG_CONFIG_DIR "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig") |
| 183 | install(FILES ${PC_CONFIGURED_FILE} DESTINATION ${PKG_CONFIG_DIR}) |
| 184 | endif(PKG_CONFIG_EXECUTABLE) |