]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - CMakeLists.txt
Initial python support
[xonotic/netradiant.git] / CMakeLists.txt
index 03d97f64c1ba3439bfb05e3ec14a2751d67537a1..cb56420e90a9f38a671af482a10d6f0c247ba987 100644 (file)
@@ -4,6 +4,8 @@ project(NetRadiant C CXX)
 
 option(BUILD_RADIANT "Build the GUI" ON)
 option(BUILD_CRUNCH "Build Crunch image support" OFF)
+option(EMBED_PYTHON "Embed python" ON)
+option(USE_WERROR "Build with -Werror -pedantic-errors" OFF)
 
 if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
     set(CMAKE_INSTALL_PREFIX "${PROJECT_SOURCE_DIR}/install" CACHE PATH "..." FORCE)
@@ -64,7 +66,8 @@ endif ()
 # Flags
 #-----------------------------------------------------------------------
 
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -fno-rtti")
+# TODO: check why these CXX flags were set
+# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -fno-rtti")
 macro(addflags_c args)
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${args}")
 endmacro()
@@ -80,7 +83,7 @@ if (NOT WIN32)
     addflags("-fvisibility=hidden")
 endif ()
 
-if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
+if (USE_WERROR)
     addflags("-Werror")
     addflags("-pedantic-errors")
 endif ()
@@ -144,6 +147,9 @@ else ()
             -DPOSIX=1
     )
 endif ()
+if (EMBED_PYTHON)
+    add_definitions(-D_EMBED_PYTHON)
+endif ()
 
 if (XWINDOWS)
     find_package(X11 REQUIRED)