hedgewars/CMakeLists.txt
changeset 9225 d8d929f92633
parent 9224 bce8cf41d666
child 9227 c02e081ba481
--- a/hedgewars/CMakeLists.txt	Thu Jun 13 22:27:23 2013 +0200
+++ b/hedgewars/CMakeLists.txt	Thu Jun 13 22:50:18 2013 +0200
@@ -81,10 +81,6 @@
     ${CMAKE_CURRENT_BINARY_DIR}/config.inc
     )
 
-if(${BUILD_ENGINE_LIBRARY})
-    message("*** Engine will be built as library (experimental) ***")
-    list(APPEND pascal_flags "-dHWLIBRARY")
-endif()
 
 include(${CMAKE_MODULE_PATH}/utils.cmake)
 
@@ -146,18 +142,16 @@
 if(PNG_FOUND)
     list(REMOVE_AT PNG_LIBRARIES 1) #removing the zlib library path
     get_filename_component(PNG_LIBRARY_DIR ${PNG_LIBRARIES} PATH)
-    list(APPEND pascal_flags "-dPNG_SCREENSHOTS" "-Fl${PNG_LIBRARY_DIR}" "-k-L${PNG_LIBRARY_DIR}")
+    add_flag_append(CMAKE_Pascal_FLAGS -Fl${PNG_LIB_DIR})
 endif()
 
 if(LUA_FOUND AND LUA_SYSTEM)
+    list(APPEND HW_LINK_LIBS lua)
     get_filename_component(LUA_LIBRARY_DIR ${LUA_LIBRARY} PATH)
     get_filename_component(LUA_LIBRARY_NAME ${LUA_LIBRARY} NAME)
     #NAME_WE would strip the .1 (or .2) next to the ".so"
     string(REGEX REPLACE "${CMAKE_SHARED_LIBRARY_PREFIX}(.*)${CMAKE_SHARED_LIBRARY_SUFFIX}" "\\1" LUA_LIBRARY_NAME "${LUA_LIBRARY_NAME}")
-    list(APPEND pascal_flags )
-    list(APPEND pascal_flags "-Fl${LUA_LIBRARY_DIR}"
-                             "-k-L${LUA_LIBRARY_DIR}"
-                             "-XLAlua=${LUA_LIBRARY_NAME}")
+    add_flag_append(CMAKE_Pascal_FLAGS "-Fl${LUA_LIBRARY_DIR} -k-L${LUA_LIBRARY_DIR} -XLAlua=${LUA_LIBRARY_NAME}")
 endif()