|
|
@ -22,22 +22,39 @@ ENDMACRO(NL_GEN_PC)
|
|
|
|
###
|
|
|
|
###
|
|
|
|
MACRO(NL_GEN_REVISION_H)
|
|
|
|
MACRO(NL_GEN_REVISION_H)
|
|
|
|
IF(EXISTS ${CMAKE_SOURCE_DIR}/revision.h.in)
|
|
|
|
IF(EXISTS ${CMAKE_SOURCE_DIR}/revision.h.in)
|
|
|
|
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR})
|
|
|
|
SET(TOOL_FOUND OFF)
|
|
|
|
ADD_DEFINITIONS(-DHAVE_REVISION_H)
|
|
|
|
|
|
|
|
SET(HAVE_REVISION_H ON)
|
|
|
|
IF(EXISTS "${CMAKE_SOURCE_DIR}/../.svn/")
|
|
|
|
|
|
|
|
FIND_PACKAGE(Subversion)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IF(SUBVERSION_FOUND)
|
|
|
|
|
|
|
|
SET(TOOL_FOUND ON)
|
|
|
|
|
|
|
|
ENDIF(SUBVERSION_FOUND)
|
|
|
|
|
|
|
|
ENDIF(EXISTS "${CMAKE_SOURCE_DIR}/../.svn/")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IF(EXISTS "${CMAKE_SOURCE_DIR}/../.hg/")
|
|
|
|
|
|
|
|
FIND_PACKAGE(Mercurial)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IF(MERCURIAL_FOUND)
|
|
|
|
|
|
|
|
SET(TOOL_FOUND ON)
|
|
|
|
|
|
|
|
ENDIF(MERCURIAL_FOUND)
|
|
|
|
|
|
|
|
ENDIF(EXISTS "${CMAKE_SOURCE_DIR}/../.hg/")
|
|
|
|
|
|
|
|
|
|
|
|
# if already generated
|
|
|
|
# if already generated
|
|
|
|
IF(EXISTS ${CMAKE_SOURCE_DIR}/revision.h)
|
|
|
|
IF(EXISTS ${CMAKE_SOURCE_DIR}/revision.h)
|
|
|
|
# copy it
|
|
|
|
# copy it
|
|
|
|
MESSAGE(STATUS "Copying provided revision.h...")
|
|
|
|
MESSAGE(STATUS "Copying provided revision.h...")
|
|
|
|
FILE(COPY ${CMAKE_SOURCE_DIR}/revision.h DESTINATION ${CMAKE_BINARY_DIR})
|
|
|
|
FILE(COPY ${CMAKE_SOURCE_DIR}/revision.h DESTINATION ${CMAKE_BINARY_DIR})
|
|
|
|
ELSE(EXISTS ${CMAKE_SOURCE_DIR}/revision.h)
|
|
|
|
SET(HAVE_REVISION_H ON)
|
|
|
|
|
|
|
|
ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/revision.h)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IF(TOOL_FOUND)
|
|
|
|
# a custom target that is always built
|
|
|
|
# a custom target that is always built
|
|
|
|
ADD_CUSTOM_TARGET(revision ALL
|
|
|
|
ADD_CUSTOM_TARGET(revision ALL)
|
|
|
|
DEPENDS ${CMAKE_BINARY_DIR}/revision.h)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# creates revision.h using cmake script
|
|
|
|
# creates revision.h using cmake script
|
|
|
|
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_BINARY_DIR}/revision.h
|
|
|
|
ADD_CUSTOM_COMMAND(TARGET revision
|
|
|
|
|
|
|
|
PRE_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND}
|
|
|
|
COMMAND ${CMAKE_COMMAND}
|
|
|
|
-DSOURCE_DIR=${CMAKE_SOURCE_DIR}
|
|
|
|
-DSOURCE_DIR=${CMAKE_SOURCE_DIR}
|
|
|
|
-DROOT_DIR=${CMAKE_SOURCE_DIR}/..
|
|
|
|
-DROOT_DIR=${CMAKE_SOURCE_DIR}/..
|
|
|
@ -47,7 +64,13 @@ MACRO(NL_GEN_REVISION_H)
|
|
|
|
SET_SOURCE_FILES_PROPERTIES(${CMAKE_BINARY_DIR}/revision.h
|
|
|
|
SET_SOURCE_FILES_PROPERTIES(${CMAKE_BINARY_DIR}/revision.h
|
|
|
|
PROPERTIES GENERATED TRUE
|
|
|
|
PROPERTIES GENERATED TRUE
|
|
|
|
HEADER_FILE_ONLY TRUE)
|
|
|
|
HEADER_FILE_ONLY TRUE)
|
|
|
|
ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/revision.h)
|
|
|
|
SET(HAVE_REVISION_H ON)
|
|
|
|
|
|
|
|
ENDIF(TOOL_FOUND)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IF(HAVE_REVISION_H)
|
|
|
|
|
|
|
|
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR})
|
|
|
|
|
|
|
|
ADD_DEFINITIONS(-DHAVE_REVISION_H)
|
|
|
|
|
|
|
|
ENDIF(HAVE_REVISION_H)
|
|
|
|
ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/revision.h.in)
|
|
|
|
ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/revision.h.in)
|
|
|
|
ENDMACRO(NL_GEN_REVISION_H)
|
|
|
|
ENDMACRO(NL_GEN_REVISION_H)
|
|
|
|
|
|
|
|
|
|
|
@ -922,6 +945,10 @@ MACRO(SETUP_EXTERNAL)
|
|
|
|
IF(WIN32)
|
|
|
|
IF(WIN32)
|
|
|
|
FIND_PACKAGE(External REQUIRED)
|
|
|
|
FIND_PACKAGE(External REQUIRED)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IF(NOT VC_DIR)
|
|
|
|
|
|
|
|
SET(VC_DIR $ENV{VC_DIR})
|
|
|
|
|
|
|
|
ENDIF(NOT VC_DIR)
|
|
|
|
|
|
|
|
|
|
|
|
IF(MSVC10)
|
|
|
|
IF(MSVC10)
|
|
|
|
IF(NOT MSVC10_REDIST_DIR)
|
|
|
|
IF(NOT MSVC10_REDIST_DIR)
|
|
|
|
# If you have VC++ 2010 Express, put x64/Microsoft.VC100.CRT/*.dll in ${EXTERNAL_PATH}/redist
|
|
|
|
# If you have VC++ 2010 Express, put x64/Microsoft.VC100.CRT/*.dll in ${EXTERNAL_PATH}/redist
|
|
|
|