commonSetup.cmake 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501
  1. ################################################################################
  2. # Copyright (C) 2011 HPCC Systems.
  3. #
  4. # All rights reserved. This program is free software: you can redistribute it and/or modify
  5. # it under the terms of the GNU Affero General Public License as
  6. # published by the Free Software Foundation, either version 3 of the
  7. # License, or (at your option) any later version.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU Affero General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU Affero General Public License
  15. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. ################################################################################
  17. # File : commonSetup.cmake
  18. #
  19. #########################################################
  20. # Description:
  21. # ------------
  22. # sets up various cmake options.
  23. #########################################################
  24. IF ("${COMMONSETUP_DONE}" STREQUAL "")
  25. SET (COMMONSETUP_DONE 1)
  26. MACRO (MACRO_ENSURE_OUT_OF_SOURCE_BUILD _errorMessage)
  27. STRING(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" insource)
  28. IF (insource)
  29. MESSAGE(FATAL_ERROR "${_errorMessage}")
  30. ENDIF(insource)
  31. ENDMACRO (MACRO_ENSURE_OUT_OF_SOURCE_BUILD)
  32. macro_ensure_out_of_source_build("The LexisNexis Hpcc requires an out of source build.
  33. Please remove the directory ${CMAKE_BINARY_DIR}/CMakeFiles
  34. and the file ${CMAKE_BINARY_DIR}/CMakeCache.txt,
  35. then create a separate build directory and run 'cmake path_to_source [options]' there.")
  36. cmake_policy ( SET CMP0011 NEW )
  37. option(CLIENTTOOLS "Enable the building/inclusion of a Client Tools component." ON)
  38. option(PLATFORM "Enable the building/inclusion of a Platform component." ON)
  39. option(DEVEL "Enable the building/inclusion of a Development component." OFF)
  40. option(CLIENTTOOLS_ONLY "Enable the building of Client Tools only." OFF)
  41. option(USE_BINUTILS "Enable use of binutils to embed workunit info into shared objects" ON)
  42. option(USE_CPPUNIT "Enable unit tests (requires cppunit)" OFF)
  43. option(USE_OPENLDAP "Enable OpenLDAP support (requires OpenLDAP)" ON)
  44. option(USE_ICU "Enable unicode support (requires ICU)" ON)
  45. option(USE_BOOST_REGEX "Configure use of boost regex" ON)
  46. option(Boost_USE_STATIC_LIBS "Use boost_regex static library for RPM BUILD" OFF)
  47. option(USE_OPENSSL "Configure use of OpenSSL" ON)
  48. option(USE_ZLIB "Configure use of zlib" ON)
  49. if (WIN32)
  50. option(USE_LIBARCHIVE "Configure use of libarchive" OFF) # libarchive rather less standard on windows systems
  51. else()
  52. option(USE_LIBARCHIVE "Configure use of libarchive" ON)
  53. endif()
  54. option(USE_NATIVE_LIBRARIES "Search standard OS locations for thirdparty libraries" ON)
  55. option(USE_GIT_DESCRIBE "Use git describe to generate build tag" ON)
  56. option(CHECK_GIT_TAG "Require git tag to match the generated build tag" OFF)
  57. option(USE_XALAN "Configure use of xalan" ON)
  58. option(USE_LIBXSLT "Configure use of libxslt" OFF)
  59. option(MAKE_DOCS "Create documentation at build time." OFF)
  60. option(MAKE_DOCS_ONLY "Create a base build with only docs." OFF)
  61. option(DOCS_DRUPAL "Create Drupal HTML Docs" OFF)
  62. option(DOCS_EPUB "Create EPUB Docs" OFF)
  63. option(DOCS_MOBI "Create Mobi Docs" OFF)
  64. if ( USE_XALAN AND USE_LIBXSLT )
  65. set(USE_XALAN OFF)
  66. endif()
  67. if ( USE_LIBXSLT )
  68. set(USE_LIBXML2 ON)
  69. endif()
  70. if ( USE_XALAN )
  71. set(USE_XERCES ON)
  72. endif()
  73. if ( MAKE_DOCS AND CLIENTTOOLS_ONLY )
  74. set( MAKE_DOCS OFF )
  75. endif()
  76. if ( MAKE_DOCS_ONLY AND NOT CLIENTTOOLS_ONLY )
  77. set( MAKE_DOCS ON )
  78. endif()
  79. if ( CLIENTTOOLS_ONLY )
  80. set(PLATFORM OFF)
  81. set(DEVEL OFF)
  82. endif()
  83. option(PORTALURL "Set url to hpccsystems portal download page")
  84. if ( NOT PORTALURL )
  85. set( PORTALURL "http://hpccsystems.com/download" )
  86. endif()
  87. set(CMAKE_MODULE_PATH "${HPCC_SOURCE_DIR}/cmake_modules/")
  88. ##########################################################
  89. # common compiler/linker flags
  90. if ("${CMAKE_BUILD_TYPE}" STREQUAL "")
  91. set ( CMAKE_BUILD_TYPE "Release" )
  92. elseif (NOT "${CMAKE_BUILD_TYPE}" MATCHES "Debug|Release")
  93. message (FATAL_ERROR "Unknown build type $ENV{CMAKE_BUILD_TYPE}")
  94. endif ()
  95. message ("-- Making ${CMAKE_BUILD_TYPE} system")
  96. if (CMAKE_SIZEOF_VOID_P EQUAL 8)
  97. set ( ARCH64BIT 1 )
  98. else ()
  99. set ( ARCH64BIT 0 )
  100. endif ()
  101. message ("-- 64bit architecture is ${ARCH64BIT}")
  102. set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG -DDEBUG")
  103. set (CMAKE_THREAD_PREFER_PTHREAD 1)
  104. find_package(Threads)
  105. IF (NOT THREADS_FOUND)
  106. message(FATAL_ERROR "No threading support found")
  107. ENDIF()
  108. if (WIN32)
  109. # On windows, the vcproj generator generates both windows and debug build capabilities, and the release mode is appended to the directory later
  110. # This output location matches what our existing windows release scripts expect - might make sense to move out of tree sometime though
  111. set ( EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin" )
  112. set ( LIBRARY_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin" )
  113. # Workaround CMake's odd decision to default windows stack size to 10000000
  114. STRING(REGEX REPLACE "/STACK:[0-9]+" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
  115. SET (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE")
  116. if (${ARCH64BIT} EQUAL 0)
  117. add_definitions(/Zc:wchar_t-)
  118. endif ()
  119. if ("${CMAKE_BUILD_TYPE}" MATCHES "Debug")
  120. add_definitions(/ZI)
  121. endif ()
  122. if ("${GIT_COMMAND}" STREQUAL "")
  123. set ( GIT_COMMAND "git.cmd" )
  124. endif ()
  125. else ()
  126. if (NOT CMAKE_USE_PTHREADS_INIT)
  127. message (FATAL_ERROR "pthreads support not detected")
  128. endif ()
  129. set ( EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/bin" )
  130. set ( LIBRARY_OUTPUT_PATH "${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/libs" )
  131. if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
  132. set (CMAKE_COMPILER_IS_CLANGXX 1)
  133. endif()
  134. if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX)
  135. message ("${CMAKE_CXX_COMPILER_ID}")
  136. SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -frtti -fPIC -fmessage-length=0 -Wformat -Wformat-security -Wformat-nonliteral -pthread")
  137. SET (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -rdynamic")
  138. SET (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -g -fno-default-inline -fno-inline-functions")
  139. endif ()
  140. if (CMAKE_COMPILER_IS_CLANGXX)
  141. SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=logical-op-parentheses -Werror=bool-conversions -Werror=return-type -Werror=comment")
  142. SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=bitwise-op-parentheses -Werror=tautological-compare")
  143. endif()
  144. # All of these are defined in platform.h too, but need to be defned before any system header is included
  145. ADD_DEFINITIONS (-D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64 -D__USE_LARGEFILE64=1 -D__USE_FILE_OFFSET64=1)
  146. if ("${GIT_COMMAND}" STREQUAL "")
  147. set ( GIT_COMMAND "git" )
  148. endif ()
  149. endif ()
  150. macro(HPCC_ADD_LIBRARY target)
  151. add_library(${target} ${ARGN})
  152. endmacro(HPCC_ADD_LIBRARY target)
  153. # This Macro is provided as Public domain from
  154. # http://www.cmake.org/Wiki/CMakeMacroParseArguments
  155. MACRO(PARSE_ARGUMENTS prefix arg_names option_names)
  156. SET(DEFAULT_ARGS)
  157. FOREACH(arg_name ${arg_names})
  158. SET(${prefix}_${arg_name})
  159. ENDFOREACH(arg_name)
  160. FOREACH(option ${option_names})
  161. SET(${prefix}_${option} FALSE)
  162. ENDFOREACH(option)
  163. SET(current_arg_name DEFAULT_ARGS)
  164. SET(current_arg_list)
  165. FOREACH(arg ${ARGN})
  166. SET(larg_names ${arg_names})
  167. LIST(FIND larg_names "${arg}" is_arg_name)
  168. IF (is_arg_name GREATER -1)
  169. SET(${prefix}_${current_arg_name} ${current_arg_list})
  170. SET(current_arg_name ${arg})
  171. SET(current_arg_list)
  172. ELSE (is_arg_name GREATER -1)
  173. SET(loption_names ${option_names})
  174. LIST(FIND loption_names "${arg}" is_option)
  175. IF (is_option GREATER -1)
  176. SET(${prefix}_${arg} TRUE)
  177. ELSE (is_option GREATER -1)
  178. SET(current_arg_list ${current_arg_list} ${arg})
  179. ENDIF (is_option GREATER -1)
  180. ENDIF (is_arg_name GREATER -1)
  181. ENDFOREACH(arg)
  182. SET(${prefix}_${current_arg_name} ${current_arg_list})
  183. ENDMACRO(PARSE_ARGUMENTS)
  184. # This macro allows for disabling a directory based on the value of a variable passed to the macro.
  185. #
  186. # ex. HPCC_ADD_SUBDIRECORY(roxie ${CLIENTTOOLS_ONLY})
  187. #
  188. # This call will disable the roxie dir if -DCLIENTTOOLS_ONLY=ON is set at config time.
  189. #
  190. macro(HPCC_ADD_SUBDIRECTORY)
  191. set(adddir OFF)
  192. PARSE_ARGUMENTS(_HPCC_SUB "" "" ${ARGN})
  193. LIST(GET _HPCC_SUB_DEFAULT_ARGS 0 subdir)
  194. set(flags ${_HPCC_SUB_DEFAULT_ARGS})
  195. LIST(REMOVE_AT flags 0)
  196. LIST(LENGTH flags length)
  197. if(NOT length)
  198. set(adddir ON)
  199. else()
  200. foreach(f ${flags})
  201. if(${f})
  202. set(adddir ON)
  203. endif()
  204. endforeach()
  205. endif()
  206. if ( adddir )
  207. add_subdirectory(${subdir})
  208. endif()
  209. endmacro(HPCC_ADD_SUBDIRECTORY)
  210. set ( SCM_GENERATED_DIR ${CMAKE_BINARY_DIR}/generated )
  211. include_directories (${SCM_GENERATED_DIR})
  212. ##################################################################
  213. # Build tag generation
  214. set(projname ${HPCC_PROJECT})
  215. set(majorver ${HPCC_MAJOR})
  216. set(minorver ${HPCC_MINOR})
  217. set(point ${HPCC_POINT})
  218. if ( "${HPCC_MATURITY}" STREQUAL "release" )
  219. set(stagever "${HPCC_SEQUENCE}")
  220. else()
  221. set(stagever "${HPCC_SEQUENCE}${HPCC_MATURITY}")
  222. endif()
  223. set(version ${majorver}.${minorver}.${point})
  224. IF ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
  225. set( stagever "${stagever}-Debug" )
  226. ENDIF ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
  227. ###########################################################################
  228. if (NOT "${EXTERNALS_DIRECTORY}" STREQUAL "")
  229. message ("-- Using externals directory at ${EXTERNALS_DIRECTORY}")
  230. endif()
  231. IF ( NOT MAKE_DOCS_ONLY )
  232. IF ("${EXTERNALS_DIRECTORY}" STREQUAL "")
  233. SET(bisoncmd "bison")
  234. SET(flexcmd "flex")
  235. ELSE()
  236. IF (WIN32)
  237. SET(bisoncmdprefix "call")
  238. SET(flexcmdprefix "call")
  239. SET(bisoncmd "${EXTERNALS_DIRECTORY}\\bison\\bison.bat")
  240. SET(flexcmd "${EXTERNALS_DIRECTORY}\\bison\\flex.bat")
  241. ELSE ()
  242. SET(bisoncmd "${EXTERNALS_DIRECTORY}/bison/bison")
  243. SET(flexcmd "${EXTERNALS_DIRECTORY}/bison/flex")
  244. ENDIF()
  245. ENDIF()
  246. IF ("${BISON_VERSION}" STREQUAL "")
  247. IF (WIN32)
  248. # cmake bug workaround - it converts path separators fine in add_custom_command but not here
  249. STRING(REPLACE "/" "\\" BISON_exename "${bisoncmd}")
  250. ELSE()
  251. SET(BISON_exename "${bisoncmd}")
  252. ENDIF()
  253. EXECUTE_PROCESS(COMMAND ${BISON_exename} --version
  254. OUTPUT_VARIABLE BISON_version_output
  255. ERROR_VARIABLE BISON_version_error
  256. RESULT_VARIABLE BISON_version_result
  257. OUTPUT_STRIP_TRAILING_WHITESPACE)
  258. STRING(REGEX REPLACE "^[^0-9]*([0-9.]+).*" "\\1" BISON_VERSION "${BISON_version_output}")
  259. ENDIF()
  260. IF ("${FLEX_VERSION}" STREQUAL "")
  261. IF (WIN32)
  262. # cmake bug workaround - it converts path separators fine in add_custom_command but not here
  263. STRING(REPLACE "/" "\\" FLEX_exename "${flexcmd}")
  264. ELSE()
  265. SET(FLEX_exename "${flexcmd}")
  266. ENDIF()
  267. EXECUTE_PROCESS(COMMAND ${FLEX_exename} --version
  268. OUTPUT_VARIABLE FLEX_version_output
  269. ERROR_VARIABLE FLEX_version_error
  270. RESULT_VARIABLE FLEX_version_result
  271. OUTPUT_STRIP_TRAILING_WHITESPACE)
  272. STRING(REGEX REPLACE "^[^0-9]*([0-9.]+).*" "\\1" FLEX_VERSION "${FLEX_version_output}")
  273. ENDIF()
  274. IF ("${BISON_VERSION}" VERSION_LESS "2.4.1")
  275. MESSAGE(FATAL_ERROR "You need bison version 2.4.1 or later to build this project (version ${BISON_VERSION} detected)")
  276. ENDIF()
  277. IF ("${FLEX_VERSION}" VERSION_LESS "2.5.35")
  278. MESSAGE(FATAL_ERROR "You need flex version 2.5.35 or later to build this project (version ${FLEX_VERSION} detected)")
  279. ENDIF()
  280. IF (CMAKE_COMPILER_IS_GNUCXX)
  281. EXECUTE_PROCESS(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GNUCXX_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
  282. IF ("${GNUCXX_VERSION}" VERSION_LESS "4.1.1")
  283. MESSAGE(FATAL_ERROR "You need Gnu c++ version 4.1.1 or later to build this project (version ${GNUCXX_VERSION} detected)")
  284. ENDIF()
  285. ENDIF()
  286. ENDIF()
  287. ###########################################################################
  288. # External library setup - some can be optionally selected based on USE_xxx flags, some are required
  289. IF (MAKE_DOCS)
  290. find_package(XSLTPROC)
  291. IF (XSLTPROC_FOUND)
  292. add_definitions (-D_USE_XSLTPROC)
  293. ELSE()
  294. message(FATAL_ERROR "XSLTPROC requested but package not found")
  295. ENDIF()
  296. find_package(FOP)
  297. IF (FOP_FOUND)
  298. add_definitions (-D_USE_FOP)
  299. ELSE()
  300. message(FATAL_ERROR "FOP requested but package not found")
  301. ENDIF()
  302. ENDIF(MAKE_DOCS)
  303. IF ( NOT MAKE_DOCS_ONLY )
  304. IF (USE_BINUTILS AND NOT WIN32)
  305. find_package(BINUTILS)
  306. IF (BINUTILS_FOUND)
  307. add_definitions (-D_USE_BINUTILS)
  308. ELSE()
  309. message(FATAL_ERROR "BINUTILS requested but package not found")
  310. ENDIF()
  311. ENDIF()
  312. IF (USE_OPENLDAP)
  313. find_package(OPENLDAP)
  314. IF (OPENLDAP_FOUND)
  315. add_definitions (-D_USE_OPENLDAP)
  316. ELSE()
  317. message(FATAL_ERROR "OPENLDAP requested but package not found")
  318. ENDIF()
  319. ELSE()
  320. add_definitions (-D_NO_LDAP)
  321. ENDIF(USE_OPENLDAP)
  322. IF (USE_CPPUNIT)
  323. find_package(CPPUNIT)
  324. IF (CPPUNIT_FOUND)
  325. add_definitions (-D_USE_CPPUNIT)
  326. include_directories(${CPPUNIT_INCLUDE_DIR})
  327. ELSE()
  328. message(FATAL_ERROR "CPPUNIT requested but package not found")
  329. ENDIF()
  330. ENDIF(USE_CPPUNIT)
  331. IF (USE_ICU)
  332. find_package(ICU)
  333. IF (ICU_FOUND)
  334. add_definitions (-D_USE_ICU)
  335. include_directories(${ICU_INCLUDE_DIR})
  336. ELSE()
  337. message(FATAL_ERROR "ICU requested but package not found")
  338. ENDIF()
  339. ENDIF(USE_ICU)
  340. if(USE_XALAN)
  341. find_package(XALAN)
  342. if (XALAN_FOUND)
  343. add_definitions (-D_USE_XALAN)
  344. else()
  345. message(FATAL_ERROR "XALAN requested but package not found")
  346. endif()
  347. endif(USE_XALAN)
  348. if(USE_LIBXSLT)
  349. find_package(LIBXSLT)
  350. if (LIBXSLT_FOUND)
  351. add_definitions (-D_USE_LIBSLT)
  352. else()
  353. message(FATAL_ERROR "LIBXSLT requested but package not found")
  354. endif()
  355. endif(USE_LIBXSLT)
  356. if(USE_XERCES)
  357. find_package(XERCES)
  358. if (XERCES_FOUND)
  359. add_definitions (-D_USE_XERCES)
  360. else()
  361. message(FATAL_ERROR "XERCES requested but package not found")
  362. endif()
  363. endif(USE_XERCES)
  364. if(USE_LIBXML2)
  365. find_package(LIBXML2)
  366. if (LIBXML2_FOUND)
  367. add_definitions (-D_USE_LIBXML2)
  368. else()
  369. message(FATAL_ERROR "LIBXML2 requested but package not found")
  370. endif()
  371. endif(USE_LIBXML2)
  372. if(USE_ZLIB)
  373. find_package(ZLIB)
  374. if (ZLIB_FOUND)
  375. add_definitions (-D_USE_ZLIB)
  376. else()
  377. message(FATAL_ERROR "ZLIB requested but package not found")
  378. endif()
  379. endif(USE_ZLIB)
  380. if(USE_LIBARCHIVE)
  381. find_package(LIBARCHIVE)
  382. if (LIBARCHIVE_FOUND)
  383. add_definitions (-D_USE_LIBARCHIVE)
  384. else()
  385. message(FATAL_ERROR "LIBARCHIVE requested but package not found")
  386. endif()
  387. endif(USE_LIBARCHIVE)
  388. if(USE_BOOST_REGEX)
  389. find_package(BOOST_REGEX)
  390. if (BOOST_REGEX_FOUND)
  391. add_definitions (-D_USE_BOOST_REGEX)
  392. else()
  393. message(FATAL_ERROR "BOOST_REGEX requested but package not found")
  394. endif()
  395. endif(USE_BOOST_REGEX)
  396. if(USE_OPENSSL)
  397. find_package(OPENSSL)
  398. if (OPENSSL_FOUND)
  399. add_definitions (-D_USE_OPENSSL)
  400. include_directories(${OPENSSL_INCLUDE_DIR})
  401. link_directories(${OPENSSL_LIBRARY_DIR})
  402. else()
  403. message(FATAL_ERROR "OPENSSL requested but package not found")
  404. endif()
  405. endif(USE_OPENSSL)
  406. if(USE_MYSQL)
  407. find_package(MYSQL)
  408. if (MYSQL_FOUND)
  409. add_definitions (-D_USE_MYSQL)
  410. else()
  411. message(FATAL_ERROR "MYSQL requested but package not found")
  412. endif()
  413. else()
  414. add_definitions (-D_NO_MYSQL)
  415. endif(USE_MYSQL)
  416. ENDIF()
  417. ###########################################################################
  418. ###
  419. ## The following sets the install directories and names.
  420. ###
  421. set ( OSSDIR "${DIR_NAME}" )
  422. set ( CPACK_INSTALL_PREFIX "${PREFIX}" )
  423. set ( CPACK_PACKAGING_INSTALL_PREFIX "${PREFIX}" )
  424. set ( CMAKE_INSTALL_PREFIX "${PREFIX}" )
  425. SET(CMAKE_SKIP_BUILD_RPATH FALSE)
  426. SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
  427. SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${OSSDIR}/lib")
  428. SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
  429. MACRO (FETCH_GIT_TAG workdir edition result)
  430. execute_process(COMMAND "${GIT_COMMAND}" describe --tags --dirty --abbrev=6 --match ${edition}*
  431. WORKING_DIRECTORY "${workdir}"
  432. OUTPUT_VARIABLE ${result}
  433. ERROR_QUIET
  434. OUTPUT_STRIP_TRAILING_WHITESPACE)
  435. if ("${${result}}" STREQUAL "")
  436. execute_process(COMMAND "${GIT_COMMAND}" describe --always --tags --all --abbrev=6 --dirty --long
  437. WORKING_DIRECTORY "${workdir}"
  438. OUTPUT_VARIABLE ${result}
  439. ERROR_QUIET
  440. OUTPUT_STRIP_TRAILING_WHITESPACE)
  441. endif()
  442. ENDMACRO()
  443. endif ("${COMMONSETUP_DONE}" STREQUAL "")