some CMake cleanup webgl
authorkoda
Tue, 13 Nov 2012 22:24:30 +0100
branchwebgl
changeset 8044 796f2653f21d
parent 8041 ecb446b9b7d6
child 8047 25a4daa6473c
some CMake cleanup
CMakeLists.txt
gameServer/CMakeLists.txt
hedgewars/CMakeLists.txt
misc/liblua/CMakeLists.txt
misc/libopenalbridge/CMakeLists.txt
project_files/hwc/CMakeLists.txt
share/CMakeLists.txt
tools/pas2c/CMakeLists.txt
--- a/CMakeLists.txt	Tue Nov 13 13:57:29 2012 -0500
+++ b/CMakeLists.txt	Tue Nov 13 22:24:30 2012 +0100
@@ -8,8 +8,7 @@
         CMAKE_POLICY(SET ${policy} NEW)
     ENDIF()
 ENDFOREACH()
-set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules)
-
+set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake_modules)
 
 #detect Mercurial revision (if present)
 set(version_suffix "-dev") #UNSET THIS VARIABLE AT RELEASE TIME
--- a/gameServer/CMakeLists.txt	Tue Nov 13 13:57:29 2012 -0500
+++ b/gameServer/CMakeLists.txt	Tue Nov 13 22:24:30 2012 +0100
@@ -23,11 +23,11 @@
     hedgewars-server.hs
     )
 
-set(hwserv_main ${hedgewars_SOURCE_DIR}/gameServer/hedgewars-server.hs)
+set(hwserv_main ${CMAKE_SOURCE_DIR}/gameServer/hedgewars-server.hs)
 
 set(ghc_flags
     --make ${hwserv_main}
-    -i${hedgewars_SOURCE_DIR}/gameServer
+    -i${CMAKE_CURRENT_SOURCE_DIR}
     -o ${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}
     -odir ${CMAKE_CURRENT_BINARY_DIR}
     -hidir ${CMAKE_CURRENT_BINARY_DIR}
--- a/hedgewars/CMakeLists.txt	Tue Nov 13 13:57:29 2012 -0500
+++ b/hedgewars/CMakeLists.txt	Tue Nov 13 22:24:30 2012 +0100
@@ -6,10 +6,10 @@
 
 include(${CMAKE_MODULE_PATH}/FindSDL_Extras.cmake)
 
-configure_file(${hedgewars_SOURCE_DIR}/hedgewars/config.inc.in ${CMAKE_CURRENT_BINARY_DIR}/config.inc)
+configure_file(${CMAKE_SOURCE_DIR}/hedgewars/config.inc.in ${CMAKE_CURRENT_BINARY_DIR}/config.inc)
 
 #SOURCE AND PROGRAMS SECTION
-set(hwengine_project ${hedgewars_SOURCE_DIR}/hedgewars/hwengine.pas)
+set(hwengine_project ${CMAKE_SOURCE_DIR}/hedgewars/hwengine.pas)
 set(engine_output_name "hwengine")
 
 set(engine_sources
@@ -82,7 +82,7 @@
 
 if(LIBENGINE)
     message(STATUS "Engine will be built as library (experimental)")
-    set(hwengine_project ${hedgewars_SOURCE_DIR}/hedgewars/hwLibrary.pas)
+    set(hwengine_project ${CMAKE_SOURCE_DIR}/hedgewars/hwLibrary.pas)
     set(pascal_flags "-dHWLIBRARY" ${pascal_flags})
 
     # create position independent code, only required for x68_64 builds, similar to -fPIC
@@ -201,7 +201,7 @@
     else()
         set(SAFE_BUILD_TOOL ${CMAKE_BUILD_TOOL})
     endif()
-    add_custom_target(ENGINECLEAN COMMAND ${SAFE_BUILD_TOOL} "clean" "${PROJECT_BINARY_DIR}" "${hedgewars_SOURCE_DIR}/hedgewars")
+    add_custom_target(ENGINECLEAN COMMAND ${SAFE_BUILD_TOOL} "clean" "${PROJECT_BINARY_DIR}" "${CMAKE_SOURCE_DIR}/hedgewars")
 endif()
 
 
--- a/misc/liblua/CMakeLists.txt	Tue Nov 13 13:57:29 2012 -0500
+++ b/misc/liblua/CMakeLists.txt	Tue Nov 13 22:24:30 2012 +0100
@@ -1,5 +1,7 @@
 #this file is included only when system Lua library is not found
 
+#TODO: when NOPASCAL=1 it should use clang here too
+
 file(GLOB lua_src *.c *.h)
 
 if(WIN32)
--- a/misc/libopenalbridge/CMakeLists.txt	Tue Nov 13 13:57:29 2012 -0500
+++ b/misc/libopenalbridge/CMakeLists.txt	Tue Nov 13 22:24:30 2012 +0100
@@ -37,6 +37,6 @@
 endif(WIN32)
 
 #type make openalbridge_test to get a small executable test
-add_executable(openalbridge_test "${hedgewars_SOURCE_DIR}/misc/libopenalbridge/tester.c")
+add_executable(openalbridge_test "${CMAKE_SOURCE_DIR}/misc/libopenalbridge/tester.c")
 target_link_libraries(openalbridge_test openalbridge ${OPENAL_LIBRARY} ${OGGVORBIS_LIBRARIES})
 
--- a/project_files/hwc/CMakeLists.txt	Tue Nov 13 13:57:29 2012 -0500
+++ b/project_files/hwc/CMakeLists.txt	Tue Nov 13 22:24:30 2012 +0100
@@ -32,22 +32,22 @@
 
 #compile our rtl implementation
 include_directories("${GLEW_INCLUDE_PATH}")
-include_directories(rtl)
+include_directories("${CMAKE_CURRENT_SOURCE_DIR}/rtl")
 add_subdirectory(rtl)
 
 
-configure_file(${hedgewars_SOURCE_DIR}/hedgewars/config.inc.in ${CMAKE_CURRENT_BINARY_DIR}/config.inc)
+configure_file(${CMAKE_SOURCE_DIR}/hedgewars/config.inc.in ${CMAKE_CURRENT_BINARY_DIR}/config.inc)
 
 #get the list of pas files that are going to be converted and compiled
-file(GLOB engine_sources_pas "${hedgewars_SOURCE_DIR}/hedgewars/*.pas")
+file(GLOB engine_sources_pas "${CMAKE_SOURCE_DIR}/hedgewars/*.pas")
 #TODO: temporary until cmake can configure itself accordingly
-list(REMOVE_ITEM engine_sources_pas "${hedgewars_SOURCE_DIR}/hedgewars/uWeb.pas")
-list(REMOVE_ITEM engine_sources_pas "${hedgewars_SOURCE_DIR}/hedgewars/uVideoRec.pas")
-list(REMOVE_ITEM engine_sources_pas "${hedgewars_SOURCE_DIR}/hedgewars/uTouch.pas")
-list(REMOVE_ITEM engine_sources_pas "${hedgewars_SOURCE_DIR}/hedgewars/PNGh.pas")
-list(REMOVE_ITEM engine_sources_pas "${hedgewars_SOURCE_DIR}/hedgewars/pas2cSystem.pas")
-list(REMOVE_ITEM engine_sources_pas "${hedgewars_SOURCE_DIR}/hedgewars/pas2cRedo.pas")
-list(REMOVE_ITEM engine_sources_pas "${hedgewars_SOURCE_DIR}/hedgewars/hwLibrary.pas")
+list(REMOVE_ITEM engine_sources_pas "${CMAKE_SOURCE_DIR}/hedgewars/uWeb.pas")
+list(REMOVE_ITEM engine_sources_pas "${CMAKE_SOURCE_DIR}/hedgewars/uVideoRec.pas")
+list(REMOVE_ITEM engine_sources_pas "${CMAKE_SOURCE_DIR}/hedgewars/uTouch.pas")
+list(REMOVE_ITEM engine_sources_pas "${CMAKE_SOURCE_DIR}/hedgewars/PNGh.pas")
+list(REMOVE_ITEM engine_sources_pas "${CMAKE_SOURCE_DIR}/hedgewars/pas2cSystem.pas")
+list(REMOVE_ITEM engine_sources_pas "${CMAKE_SOURCE_DIR}/hedgewars/pas2cRedo.pas")
+list(REMOVE_ITEM engine_sources_pas "${CMAKE_SOURCE_DIR}/hedgewars/hwLibrary.pas")
 
 foreach(sourcefile ${engine_sources_pas})
     get_filename_component(sourcename ${sourcefile} NAME_WE) #drops .pas
@@ -58,7 +58,7 @@
 add_custom_command(OUTPUT ${engine_sources}
         COMMAND "${EXECUTABLE_OUTPUT_PATH}/pas2c${CMAKE_EXECUTABLE_SUFFIX}"
         ARGS -n "hwengine"
-             -i "${hedgewars_SOURCE_DIR}/hedgewars"
+             -i "${CMAKE_SOURCE_DIR}/hedgewars"
              -o "${CMAKE_CURRENT_BINARY_DIR}"
              -a "${CMAKE_CURRENT_BINARY_DIR}"
         DEPENDS pas2c
--- a/share/CMakeLists.txt	Tue Nov 13 13:57:29 2012 -0500
+++ b/share/CMakeLists.txt	Tue Nov 13 22:24:30 2012 +0100
@@ -3,9 +3,9 @@
 IF(APPLE OR CROSSAPPLE)
 	#needed for CFBundleVersion and CFBundleShortVersionString
 	FIND_PROGRAM(HGCOMMAND hg)
-	IF (HGCOMMAND AND (EXISTS ${hedgewars_SOURCE_DIR}/.hg))
+	IF (HGCOMMAND AND (EXISTS ${CMAKE_SOURCE_DIR}/.hg))
 		exec_program(${HGCOMMAND}
-			     ARGS identify -n ${hedgewars_SOURCE_DIR}
+			     ARGS identify -n ${CMAKE_SOURCE_DIR}
 			     OUTPUT_VARIABLE version_suffix
 			     )
 		STRING(REGEX REPLACE "([0-9]+)(.*)" "\\1" version_suffix ${version_suffix})
@@ -14,14 +14,14 @@
 		set (HEDGEWARS_REVISION ${HEDGEWARS_VERSION})
 	ENDIF ()
 
-	configure_file(${hedgewars_SOURCE_DIR}/share/Info.plist.in 
+	configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in
 		${CMAKE_CURRENT_BINARY_DIR}/Info.plist)
 	install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/Info.plist"
 		DESTINATION ../)
-	install(PROGRAMS "${hedgewars_SOURCE_DIR}/share/Icon.icns"
+	install(PROGRAMS "${CMAKE_CURRENT_SOURCE_DIR}/Icon.icns"
 		DESTINATION ../Resources/)
-	install(PROGRAMS "${hedgewars_SOURCE_DIR}/share/hwico.icns"
+	install(PROGRAMS "${CMAKE_CURRENT_SOURCE_DIR}/share/hwico.icns"
 		DESTINATION ../Resources/)
-	install(PROGRAMS "${hedgewars_SOURCE_DIR}/share/dsa_pub.pem"
+	install(PROGRAMS "${CMAKE_CURRENT_SOURCE_DIR}/share/dsa_pub.pem"
 		DESTINATION ../Resources/)
 ENDIF(APPLE OR CROSSAPPLE)
--- a/tools/pas2c/CMakeLists.txt	Tue Nov 13 13:57:29 2012 -0500
+++ b/tools/pas2c/CMakeLists.txt	Tue Nov 13 22:24:30 2012 +0100
@@ -4,14 +4,14 @@
         PascalParser.hs
         PascalPreprocessor.hs
         PascalUnitSyntaxTree.hs
-        pas2c.hs
+        Pas2C.hs
     )
 
-set(pas2c_main ${hedgewars_SOURCE_DIR}/tools/pas2c/Main.hs)
+set(pas2c_main ${CMAKE_SOURCE_DIR}/tools/pas2c/Main.hs)
 
 set(ghc_flags
         --make ${pas2c_main}
-        -i${hedgewars_SOURCE_DIR}/tools/pas2c/
+        -i${CMAKE_SOURCE_DIR}/tools/pas2c/
         -o ${EXECUTABLE_OUTPUT_PATH}/pas2c${CMAKE_EXECUTABLE_SUFFIX}
         -odir ${CMAKE_CURRENT_BINARY_DIR}
         -hidir ${CMAKE_CURRENT_BINARY_DIR}