--- a/CMakeLists.txt Thu Jun 13 22:55:33 2013 +0200
+++ b/CMakeLists.txt Fri Jun 14 01:01:18 2013 +0200
@@ -108,6 +108,7 @@
"-O2" # optimise for faster code
)
+message(${LIBRARY_OUTPUT_PATH})
#-vm4079,4080,4081
add_flag_append(CMAKE_Pascal_FLAGS "-Cs2000000")
add_flag_append(CMAKE_Pascal_FLAGS_DEBUG "-O- -gv")
@@ -143,7 +144,6 @@
endif()
set(lua_output_name "hwlua")
add_subdirectory(misc/liblua)
- list(APPEND pascal_flags "-XLAlua=${lua_output_name}" "-dLUA_INTERNAL")
endif()
--- a/cmake_modules/CMakePascalInformation.cmake Thu Jun 13 22:55:33 2013 +0200
+++ b/cmake_modules/CMakePascalInformation.cmake Fri Jun 14 01:01:18 2013 +0200
@@ -101,7 +101,7 @@
set(CMAKE_VERBOSE_MAKEFILE FALSE CACHE BOOL "If this value is on, makefiles will be generated without the .SILENT directive, and all commands will be echoed to the console during the make. This is useful for debugging only. With Visual Studio IDE projects all commands are done without /nologo.")
-set(CMAKE_Pascal_FLAGS "$ENV{FPFLAGS} ${CMAKE_Pascal_FLAGS_INIT}" CACHE STRING "Flags for Pascal compiler.")
+set(CMAKE_Pascal_FLAGS "$ENV{FPFLAGS} ${CMAKE_Pascal_FLAGS_INIT} ${CMAKE_Pascal_FLAGS}" CACHE STRING "Flags for Pascal compiler.")
include(CMakeCommonLanguageInclude)
--- a/cmake_modules/utils.cmake Thu Jun 13 22:55:33 2013 +0200
+++ b/cmake_modules/utils.cmake Fri Jun 14 01:01:18 2013 +0200
@@ -37,10 +37,10 @@
macro(add_linker_flag _FLAG)
list(APPEND haskell_flags "-optl" "${_FLAG}")
- add_flag_prepend(CMAKE_Pascal_FLAGS "-k${_FLAG}")
- add_flag_prepend(CMAKE_EXE_LINKER_FLAGS "-Wl,${_FLAG}")
- add_flag_prepend(CMAKE_SHARED_LIBRARY_C_FLAGS "-Wl,${_FLAG}")
- add_flag_prepend(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-Wl,${_FLAG}")
+ add_flag_append(CMAKE_Pascal_FLAGS "-k${_FLAG}")
+ add_flag_append(CMAKE_EXE_LINKER_FLAGS "-Wl,${_FLAG}")
+ add_flag_append(CMAKE_SHARED_LIBRARY_C_FLAGS "-Wl,${_FLAG}")
+ add_flag_append(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-Wl,${_FLAG}")
endmacro(add_linker_flag _FLAG)
#TODO: find_package_or_bundle
--- a/hedgewars/CMakeLists.txt Thu Jun 13 22:55:33 2013 +0200
+++ b/hedgewars/CMakeLists.txt Fri Jun 14 01:01:18 2013 +0200
@@ -142,16 +142,19 @@
if(PNG_FOUND)
list(REMOVE_AT PNG_LIBRARIES 1) #removing the zlib library path
get_filename_component(PNG_LIBRARY_DIR ${PNG_LIBRARIES} PATH)
- add_flag_append(CMAKE_Pascal_FLAGS -Fl${PNG_LIB_DIR})
+ add_flag_append(CMAKE_Pascal_FLAGS -Fl${PNG_LIBRARY_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}")
add_flag_append(CMAKE_Pascal_FLAGS "-Fl${LUA_LIBRARY_DIR} -k-L${LUA_LIBRARY_DIR} -XLAlua=${LUA_LIBRARY_NAME}")
+else()
+ add_definitions(-dLUA_INTERNAL)
+ list(APPEND HW_LINK_LIBS lua)
+ add_flag_append(CMAKE_Pascal_FLAGS "-XLAlua=${lua_output_name}")
endif()