Website Meta Language / src / CMakeLists.txt

# see - http://www.cmake.org/Wiki/CMake_FAQ#Is_there_an_option_to_produce_more_.27verbose.27_compiling.3F
# SET(CMAKE_VERBOSE_MAKEFILE ON)

SET(VERSION "2.2.1")

CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

IF (NOT CMAKE_INSTALL_PREFIX)
    MESSAGE (FATAL_ERROR "CMAKE_INSTALL_PREFIX must be defined. Specify it with -DCMAKE_INSTALL_PREFIX=...")
ENDIF (NOT CMAKE_INSTALL_PREFIX)

IF (NOT LIB_INSTALL_DIR)
    MESSAGE (FATAL_ERROR "LIB_INSTALL_DIR must be defined. Specify it with -DLIB_INSTALL_DIR=...")
ENDIF (NOT LIB_INSTALL_DIR)

SET (MYPREFIX "${CMAKE_INSTALL_PREFIX}")
STRING(LENGTH "${MYPREFIX}" MYPREFIX_LEN)
STRING(SUBSTRING "${LIB_INSTALL_DIR}" 0 "${MYPREFIX_LEN}" LIB_MYPREFIX)

IF ("${LIB_MYPREFIX}" STREQUAL "${MYPREFIX}")
    MATH (EXPR START_FROM "${MYPREFIX_LEN} + 1")
    STRING(SUBSTRING "${LIB_INSTALL_DIR}" "${START_FROM}" -1 WML_LIB_DIR_BASE)
    # MESSAGE(FATAL_ERROR "WDBASe = ${WML_LIB_DIR_BASE} == ")
ELSE ("${LIB_MYPREFIX}" STREQUAL "${MYPREFIX}")
    SET (WML_LIB_DIR_BASE "lib")
ENDIF ("${LIB_MYPREFIX}" STREQUAL "${MYPREFIX}")

SET (WML_LIB_DIR "${WML_LIB_DIR_BASE}/wml")
SET (WML_DATA_DIR "${WML_LIB_DIR}/data")
SET (WML_LIBEXE_DIR "${WML_LIB_DIR}/exec/")

INCLUDE ("Common.cmake")

# This is the equivalent to perform a "make dist"/"make distdir" etc.
SET(CPACK_PACKAGE_NAME "wml")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Website Meta Language")
SET(CPACK_PACKAGE_VENDOR "Shlomi Fish")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")

# Process and extract the version number.
# FILE( READ "ver.txt" VERSION)

CHOMP (VERSION)

STRING (REGEX MATCHALL "([0-9]+)" VERSION_DIGITS "${VERSION}")

LIST(GET VERSION_DIGITS 0 CPACK_PACKAGE_VERSION_MAJOR)
LIST(GET VERSION_DIGITS 1 CPACK_PACKAGE_VERSION_MINOR)
LIST(GET VERSION_DIGITS 2 CPACK_PACKAGE_VERSION_PATCH)

SET(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_DESCRIPTION_SUMMARY} ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")

SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")

SET (base_with_ver "${CPACK_PACKAGE_NAME}-[0-9]+\\\\.[0-9]+\\\\.[0-9]+")

SET(CPACK_SOURCE_IGNORE_FILES
    "/build/"
    "/_CPack_Packages/"
    "/CMakeFiles/"
    "/.deps/"
    "^${base_with_ver}(-Source|-Linux)?/"
    "${base_with_ver}.tar\\\\.(gz|bz2|Z|lzma|xz)$"
    "\\\\.o$"
    "~$"
    "\\\\.so(\\\\.[0-9]+)*$"
    "/\\\\.svn/"
    "\\\\.(pdf|fo)$"
    "/t/t/.*\\\\.exe$"
    "/t/Presets"
    "/CMakeCache\\\\.txt$"
    "/Makefile$"
    "/tags$"
    "/([0-9]+)\\\\.board$"
    "/config\\\\.h$"
    "ids-whitelist\\\\.txt"
)

IF(WIN32 AND NOT UNIX)
    # There is a bug in NSI that does not handle full unix paths properly. Make
    # sure there is at least one set of four (4) backlasshes.
    # SET(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}\\\\dondorf-king.bmp")
    SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\wml.exe")
    SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\thewml.org")
    SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\thewml.org")
    SET(CPACK_NSIS_DISPLAY_NAME "Website Meta Language")
    SET(CPACK_NSIS_CONTACT "shlomif@cpan.org")
    SET(CPACK_NSIS_MODIFY_PATH ON)
    # Setting for NSIS :
    SET(CPACK_NSIS_MUI_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\wml.ico")
    SET(CPACK_NSIS_MUI_UNIICON ${CPACK_NSIS_MUI_ICON})
    SET(CPACK_PACKAGE_ICON ${CPACK_NSIS_MUI_ICON})
    SET(CPACK_NSIS_MODIFY_PATH "ON")
ELSE(WIN32 AND NOT UNIX)
    # SET(CPACK_STRIP_FILES "")
    # SET(CPACK_SOURCE_STRIP_FILES "")
ENDIF(WIN32 AND NOT UNIX)

SET(CPACK_PACKAGE_EXECUTABLES
    "wml" "Website Meta Language Frontend"
)

INCLUDE (CPack)

SUBDIRS (
    wml_aux
    wml_backend
    wml_common
    wml_docs
    wml_frontend
    wml_test
    wml_include
    wml_misc
)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.