diff options
author | flaviojs <flaviojs@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-06-29 12:26:51 +0000 |
---|---|---|
committer | flaviojs <flaviojs@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-06-29 12:26:51 +0000 |
commit | dd73c6ea546a8828653cdce38a52f575cbdd3b96 (patch) | |
tree | 7c388def15aaf5e09e73f563ffa39c72d7c28c2f /src/common/CMakeLists.txt | |
parent | a9492cf82f696af37f3258e19d7767f705708e63 (diff) | |
download | hercules-dd73c6ea546a8828653cdce38a52f575cbdd3b96.tar.gz hercules-dd73c6ea546a8828653cdce38a52f575cbdd3b96.tar.bz2 hercules-dd73c6ea546a8828653cdce38a52f575cbdd3b96.tar.xz hercules-dd73c6ea546a8828653cdce38a52f575cbdd3b96.zip |
* Added experimental support for CMake. (for now: basic build, no extras, only tested with VS10 and cygwin)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14872 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/common/CMakeLists.txt')
-rw-r--r-- | src/common/CMakeLists.txt | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt new file mode 100644 index 000000000..7a4443abc --- /dev/null +++ b/src/common/CMakeLists.txt @@ -0,0 +1,40 @@ + +set( COMMON_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}" + CACHE PATH "common include directories" ) +set( COMMON_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}" + CACHE PATH "common source directory" ) +mark_as_advanced( COMMON_INCLUDE_DIRS ) +mark_as_advanced( COMMON_SOURCE_DIR ) + + +# +# Find svnversion +# +message( STATUS "Detecting svnversion" ) +find_program( SVNVERSION_EXECUTABLE svnversion ) +mark_as_advanced( SVNVERSION_EXECUTABLE ) +message( STATUS "Detecting svnversion - done" ) + + +# +# Create svnversion.h +# +message( STATUS "Creating svnversion.h" ) +if( SVNVERSION_EXECUTABLE ) + execute_process( COMMAND ${SVNVERSION_EXECUTABLE} ${PROJECT_SOURCE_DIR} + OUTPUT_VARIABLE SVNVERSION + OUTPUT_STRIP_TRAILING_WHITESPACE ) +endif() +if( SVNVERSION ) + file( WRITE ${CMAKE_CURRENT_BINARY_DIR}/svnversion.h + "#ifndef SVNVERSION\n#define SVNVERSION ${SVNVERSION}\n#endif\n" ) +else() + file( WRITE ${CMAKE_CURRENT_BINARY_DIR}/svnversion.h "" ) +endif() +set( GLOBAL_INCLUDE_DIRS "${GLOBAL_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR}" CACHE INTERNAL "" ) +set( SVNVERSION ${SVNVERSION} + CACHE STRING "SVN version of the source code" ) +if( INSTALL_BUILD_DATA ) + install( FILES ${CMAKE_CURRENT_BINARY_DIR}/svnversion.h DESTINATION ${CMAKE_INSTALL_PREFIX}/src/common ) +endif() +message( STATUS "Creating svnversion.h - done" ) |