Skip to content

Commit fccfbdc

Browse files
committed
cmake port: small adjustments and final commit
1 parent 76e1459 commit fccfbdc

File tree

1 file changed

+28
-17
lines changed

1 file changed

+28
-17
lines changed

CMakeLists.txt

+28-17
Original file line numberDiff line numberDiff line change
@@ -27,38 +27,45 @@ project (xiphos
2727
VERSION "4.1.0"
2828
LANGUAGES C CXX)
2929

30-
# set Xiphos website
30+
31+
# set commonly used Xiphos variables:
32+
# Xiphos website
3133
set (XIPHOS_WEBSITE "http://xiphos.org")
32-
# set Xiphos issues report website
34+
35+
# Xiphos issues report website
3336
set (XIPHOS_BUG_REPORT "https://github.com/crosswire/xiphos/issues")
34-
# set Xiphos release date, (we use 'ChangeLog' time value)
35-
file(TIMESTAMP ${PROJECT_SOURCE_DIR}/ChangeLog
36-
XIPHOS_RELEASE_DATE "%b %Y" UTC)
3737

38+
# Xiphos release date, (read from 'ChangeLog')
39+
# read last entry in ChangeLog
40+
file(STRINGS ${PROJECT_SOURCE_DIR}/ChangeLog
41+
ChangeLog_lastentry REGEX "^20[0-9][0-9]-[0-9][0-9]" LIMIT_COUNT 1)
42+
# get year
43+
string(SUBSTRING ${ChangeLog_lastentry} 0 4 ChangeLog_year)
44+
# get month's number
45+
string(SUBSTRING ${ChangeLog_lastentry} 5 2 ChangeLog_month)
46+
# transform month's number into month's name
47+
list(APPEND month_names "XXX;Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec")
48+
list(GET month_names ${ChangeLog_month} ChangeLog_month)
49+
# generate release date string
50+
string(CONFIGURE "@ChangeLog_month@ @ChangeLog_year@" XIPHOS_RELEASE_DATE)
3851

39-
# tell cmake where its modules can be found in our project directory
40-
list (APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
41-
list (APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules)
4252

4353
# make sure it's an out-of-stream build
4454
file(TO_CMAKE_PATH "${PROJECT_BINARY_DIR}/CMakeLists.txt" LOC_PATH)
4555
if(EXISTS "${LOC_PATH}")
4656
message(FATAL_ERROR "You cannot build in the source directory (or any directory with a CMakeLists.txt file). Please make an out-of-stream build subdirectory.")
4757
endif()
4858

59+
60+
# tell cmake where its modules can be found in our project directory
61+
list (APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
62+
list (APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules)
63+
4964
# set install directory variables as defined by the GNU Coding Standards.
5065
# e.g. CMAKE_INSTALL_DATAROOTDIR; CMAKE_INSTALL_FULL_BINDIR;
5166
# CMAKE_INSTALL_FULL_DOCDIR...
5267
include (GNUInstallDirs)
5368

54-
# cross-compiling for Windows
55-
if (CMAKE_CROSSCOMPILING AND WIN32)
56-
message(STATUS "Cross-Compiling for Windows")
57-
# Configure pkg-config for cross-compilation
58-
set(ENV{PKG_CONFIG_PATH} ${CMAKE_FIND_ROOT_PATH}/lib/pkgconfig)
59-
endif(CMAKE_CROSSCOMPILING AND WIN32)
60-
61-
6269
# set CMAKE options that the user can optionally select ON or OFF.
6370
include (XiphosOptions)
6471

@@ -82,13 +89,17 @@ add_subdirectory(src/main)
8289
add_subdirectory(src/webkit)
8390
add_subdirectory(src/xiphos_html)
8491
add_subdirectory(src/gtk)
92+
93+
# build xiphos-nav
8594
add_subdirectory(src/examples)
95+
96+
# build other stuff
8697
add_subdirectory(pixmaps)
8798
add_subdirectory(ui)
8899
add_subdirectory(po)
89100
add_subdirectory(desktop)
90-
add_subdirectory(mhelp)
91101
add_subdirectory(doc)
102+
add_subdirectory(mhelp)
92103

93104
# create packages
94105
add_subdirectory(cpack)

0 commit comments

Comments
 (0)