summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt21
1 files changed, 20 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f0b57da..aef831d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,7 +3,20 @@ include( CMakeDependentOption )
include( EnumOption )
cmake_minimum_required( VERSION 3.9 )
-project( ReiLua )
+
+# Try to read custom project name from project.info
+set( PROJECT_NAME_VAR "ReiLua" )
+if( EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/project.info" )
+ file( STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/project.info" PROJECT_INFO_LINES )
+ foreach( LINE ${PROJECT_INFO_LINES} )
+ if( LINE MATCHES "^EXECUTABLE_NAME=(.+)$" )
+ set( PROJECT_NAME_VAR "${CMAKE_MATCH_1}" )
+ message( STATUS "Using custom executable name: ${PROJECT_NAME_VAR}" )
+ endif()
+ endforeach()
+endif()
+
+project( ${PROJECT_NAME_VAR} )
# Find Python interpreter (python3 or python)
find_package(Python3 COMPONENTS Interpreter)
@@ -36,6 +49,12 @@ if( NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES )
set_property( CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo" )
endif()
+# Set compiler flags for Release builds
+if( CMAKE_BUILD_TYPE STREQUAL "Release" )
+ add_definitions( -DNDEBUG )
+ message( STATUS "Release build - logging disabled by default" )
+endif()
+
file( GLOB SOURCES src/*.c )
# Always embed logo files for splash screens