Changes in CMakeLists.txt [1000:404b98971e1f:998:7fdaa05a69a1] in lemon-main
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
CMakeLists.txt
r1000 r998 13 13 ELSE() 14 14 EXECUTE_PROCESS( 15 COMMAND 16 hg log -r. --template "{latesttag}" 15 COMMAND ${PYTHON_EXECUTABLE} ./scripts/chg-len.py 17 16 WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} 18 OUTPUT_VARIABLE HG_REVISION_ TAG17 OUTPUT_VARIABLE HG_REVISION_PATH 19 18 ERROR_QUIET 20 19 OUTPUT_STRIP_TRAILING_WHITESPACE 21 20 ) 22 21 EXECUTE_PROCESS( 23 COMMAND 24 hg log -r. --template "{latesttagdistance}" 22 COMMAND hg id -i 25 23 WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} 26 OUTPUT_VARIABLE HG_REVISION _DIST24 OUTPUT_VARIABLE HG_REVISION 27 25 ERROR_QUIET 28 26 OUTPUT_STRIP_TRAILING_WHITESPACE 29 27 ) 30 EXECUTE_PROCESS( 31 COMMAND 32 hg log -r. --template "{node|short}" 33 WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} 34 OUTPUT_VARIABLE HG_REVISION_ID 35 ERROR_QUIET 36 OUTPUT_STRIP_TRAILING_WHITESPACE 37 ) 38 39 IF(HG_REVISION_TAG STREQUAL "") 28 IF(HG_REVISION STREQUAL "") 40 29 SET(HG_REVISION_ID "hg-tip") 41 30 ELSE() 42 IF(HG_REVISION_TAG STREQUAL "null") 43 SET(HG_REVISION_TAG "trunk") 44 ELSEIF(HG_REVISION_TAG MATCHES "^r") 45 STRING(SUBSTRING ${HG_REVISION_TAG} 1 -1 HG_REVISION_TAG) 46 ENDIF() 47 IF(HG_REVISION_DIST STREQUAL "0") 48 SET(HG_REVISION ${HG_REVISION_TAG}) 31 IF(HG_REVISION_PATH STREQUAL "") 32 SET(HG_REVISION_ID ${HG_REVISION}) 49 33 ELSE() 50 SET(HG_REVISION 51 "${HG_REVISION_TAG}+${HG_REVISION_DIST}-${HG_REVISION_ID}") 34 SET(HG_REVISION_ID ${HG_REVISION_PATH}.${HG_REVISION}) 52 35 ENDIF() 53 36 ENDIF() 54 55 SET(LEMON_VERSION ${HG_REVISION} CACHE STRING "LEMON version string.") 37 SET(LEMON_VERSION ${HG_REVISION_ID} CACHE STRING "LEMON version string.") 56 38 ENDIF() 57 39 … … 133 115 SET(LEMON_HAVE_LONG_LONG ${HAVE_LONG_LONG}) 134 116 135 INCLUDE(FindThreads) 136 137 IF(NOT LEMON_THREADING) 138 IF(CMAKE_USE_PTHREADS_INIT) 139 SET(LEMON_THREADING "Pthread") 140 ELSEIF(CMAKE_USE_WIN32_THREADS_INIT) 141 SET(LEMON_THREADING "Win32") 142 ELSE() 143 SET(LEMON_THREADING "None") 144 ENDIF() 145 ENDIF() 146 147 SET( LEMON_THREADING "${LEMON_THREADING}" CACHE STRING 148 "Choose the threading library, options are: Pthread Win32 None." 149 FORCE ) 150 151 IF(LEMON_THREADING STREQUAL "Pthread") 152 SET(LEMON_USE_PTHREAD TRUE) 153 ELSEIF(LEMON_THREADING STREQUAL "Win32") 154 SET(LEMON_USE_WIN32_THREADS TRUE) 155 ENDIF() 117 INCLUDE(FindPythonInterp) 156 118 157 119 ENABLE_TESTING() … … 165 127 ADD_SUBDIRECTORY(lemon) 166 128 IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR}) 167 ADD_SUBDIRECTORY(contrib)168 129 ADD_SUBDIRECTORY(demo) 169 130 ADD_SUBDIRECTORY(tools) … … 189 150 ENDIF() 190 151 191 CONFIGURE_FILE(192 ${PROJECT_SOURCE_DIR}/cmake/version.cmake.in193 ${PROJECT_BINARY_DIR}/cmake/version.cmake194 @ONLY195 )196 197 SET(ARCHIVE_BASE_NAME ${CMAKE_PROJECT_NAME})198 STRING(TOLOWER ${ARCHIVE_BASE_NAME} ARCHIVE_BASE_NAME)199 SET(ARCHIVE_NAME ${ARCHIVE_BASE_NAME}-${PROJECT_VERSION})200 ADD_CUSTOM_TARGET(dist201 COMMAND cmake -E remove_directory ${ARCHIVE_NAME}202 COMMAND hg archive ${ARCHIVE_NAME}203 COMMAND cmake -E copy cmake/version.cmake ${ARCHIVE_NAME}/cmake/version.cmake204 COMMAND tar -czf ${ARCHIVE_BASE_NAME}-nodoc-${PROJECT_VERSION}.tar.gz ${ARCHIVE_NAME}205 COMMAND zip -r ${ARCHIVE_BASE_NAME}-nodoc-${PROJECT_VERSION}.zip ${ARCHIVE_NAME}206 COMMAND cmake -E copy_directory doc/html ${ARCHIVE_NAME}/doc/html207 COMMAND tar -czf ${ARCHIVE_NAME}.tar.gz ${ARCHIVE_NAME}208 COMMAND zip -r ${ARCHIVE_NAME}.zip ${ARCHIVE_NAME}209 COMMAND cmake -E copy_directory doc/html ${ARCHIVE_BASE_NAME}-doc-${PROJECT_VERSION}210 COMMAND tar -czf ${ARCHIVE_BASE_NAME}-doc-${PROJECT_VERSION}.tar.gz ${ARCHIVE_BASE_NAME}-doc-${PROJECT_VERSION}211 COMMAND zip -r ${ARCHIVE_BASE_NAME}-doc-${PROJECT_VERSION}.zip ${ARCHIVE_BASE_NAME}-doc-${PROJECT_VERSION}212 COMMAND cmake -E remove_directory ${ARCHIVE_NAME}213 COMMAND cmake -E remove_directory ${ARCHIVE_BASE_NAME}-doc-${PROJECT_VERSION}214 DEPENDS html215 WORKING_DIRECTORY ${PROJECT_BINARY_DIR})216 217 # CPACK config (Basically for NSIS)218 152 IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR}) 219 153 SET(CPACK_PACKAGE_NAME ${PROJECT_NAME})
Note: See TracChangeset
for help on using the changeset viewer.