aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorla-ninpre <leobrekalini@gmail.com>2021-09-10 17:08:07 +0000
committerla-ninpre <leobrekalini@gmail.com>2021-09-10 17:08:07 +0000
commit2d542a6c14625efa1b2c6249972bd36e117e3fa8 (patch)
treeadff9bb9a2a159caec94f2f7e375e79ee0abe5aa /CMakeLists.txt
parent00981834d98546471e30441979a36dac52a76ecd (diff)
downloadnimisewi_c-2d542a6c14625efa1b2c6249972bd36e117e3fa8.tar.gz
nimisewi_c-2d542a6c14625efa1b2c6249972bd36e117e3fa8.zip
added compiler info to nimisewiv0.3.1
also removed error checks from nimisewi, nimisewi.cgi and nimisewi_gemini.cgi because this error check has to happen inside nimi_sewi() and not in those programs. FossilOrigin-Name: 2fd4c9495753569c904132ee83cd5f14662389c69399c27f289e0e3ae35aa0cb
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt25
1 files changed, 24 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6ae0628..417d85a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,16 +1,33 @@
cmake_minimum_required(VERSION 3.10)
+# project specification
+
project(nimisewi
- VERSION 0.3.0
+ VERSION 0.3.1
DESCRIPTION "small program that generates random toki pona noun phrase"
HOMEPAGE_URL "https://fsl.aaoth.xyz/nimisewi.c/home")
+# get compiler name and version
+
+execute_process(COMMAND ${CMAKE_C_COMPILER} "--version"
+ OUTPUT_VARIABLE _PROJECT_C_COMPILER_VERSION)
+string(REGEX REPLACE "\n" ";"
+ PROJECT_C_COMPILER_VERSION ${_PROJECT_C_COMPILER_VERSION})
+list(APPEND PROJECT_C_COMPILER_STRING ${PROJECT_C_COMPILER_VERSION})
+list(POP_FRONT PROJECT_C_COMPILER_STRING PROJECT_C_COMPILER_VERSION)
+
+# configuration header
+
configure_file(config.h.in config.h)
+# main executable
+
add_executable(nimisewi main.c nimisewi.c
${PROJECT_BINARY_DIR}/nimitoki.c)
target_include_directories(nimisewi PUBLIC "${PROJECT_BINARY_DIR}")
+# supplementary executable
+
add_executable(makenimitoki makenimitoki.c)
target_include_directories(makenimitoki PUBLIC "${PROJECT_BINARY_DIR}")
@@ -20,10 +37,14 @@ add_custom_command(
COMMAND makenimitoki ${PROJECT_SOURCE_DIR}/nimitoki.txt
DEPENDS makenimitoki)
+# includes
+
include(CheckIncludeFile)
include(CheckSymbolExists)
include(CheckCSourceCompiles)
+# warning message
+
set(WARNING_STATIC_BUILD "static build won't work here")
# check libraries
@@ -179,6 +200,8 @@ if(BUILD_GEMINI_CGI)
DESTINATION $<TARGET_PROPERTY:nimisewi_gemini.cgi,GEMINI_CGI_INSTALL_DIR>)
endif()
+# packaging
+
include(InstallRequiredSystemLibraries)
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
set(CPACK_PROJECT_VERSION_MAJOR ${nimisewi_VERSION_MAJOR})