First steps to support out-of-source build
authorunc0rr
Sat, 02 Feb 2008 15:20:41 +0000
changeset 781 4101f0f1c0b9
parent 780 f45b0e513dfd
child 782 e2d2b84aa776
First steps to support out-of-source build
QTfrontend/CMakeLists.txt
hedgewars/CMakeLists.txt
--- a/QTfrontend/CMakeLists.txt	Fri Feb 01 16:39:37 2008 +0000
+++ b/QTfrontend/CMakeLists.txt	Sat Feb 02 15:20:41 2008 +0000
@@ -32,12 +32,12 @@
 endif(WIN32 AND NOT UNIX)
 
 configure_file(${hedgewars_SOURCE_DIR}/QTfrontend/hwconsts.cpp.in 
-	${hedgewars_SOURCE_DIR}/QTfrontend/hwconsts.cpp)
+	${CMAKE_CURRENT_BINARY_DIR}/hwconsts.cpp)
 
-set(hwfr_src 
+set(hwfr_src
 	game.cpp
 	main.cpp
-	hwform.cpp 
+	hwform.cpp
 	team.cpp
 	teamselect.cpp
 	teamselhelper.cpp
@@ -68,7 +68,7 @@
 	binds.cpp
 	SDLs.cpp
 	playrecordpage.cpp
-	hwconsts.cpp
+	${CMAKE_CURRENT_BINARY_DIR}/hwconsts.cpp
 	selectWeapon.cpp
         itemNum.cpp
 	input_ip.cpp
@@ -157,7 +157,7 @@
 		)
 endif(WIN32 AND NOT UNIX)
 
-target_link_libraries(hedgewars 
+target_link_libraries(hedgewars
 	${HW_LINK_LIBS})
 
 install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/hedgewars${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION bin)
--- a/hedgewars/CMakeLists.txt	Fri Feb 01 16:39:37 2008 +0000
+++ b/hedgewars/CMakeLists.txt	Sat Feb 02 15:20:41 2008 +0000
@@ -1,5 +1,5 @@
 configure_file(${hedgewars_SOURCE_DIR}/hedgewars/proto.inc.in 
-	${hedgewars_SOURCE_DIR}/hedgewars/proto.inc) 
+	${CMAKE_CURRENT_BINARY_DIR}/proto.inc)
 
 set(fpc_tryexe fpc)
 set(hwengine_project "hwengine.dpr")
@@ -39,7 +39,7 @@
 	SinTable.inc
 	options.inc
 	playlist.inc
-	proto.inc
+	${CMAKE_CURRENT_BINARY_DIR}/proto.inc
 	tunsetborder.inc
 	)
 
@@ -50,9 +50,9 @@
 endif (fpc_executable)
 
 set (noexecstack_flags "-k-z" "-knoexecstack")
-FILE(WRITE ${EXECUTABLE_OUTPUT_PATH}/checkstack.pas "begin end.")
+file(WRITE ${EXECUTABLE_OUTPUT_PATH}/checkstack.pas "begin end.")
 
-EXEC_PROGRAM(${fpc_executable} ${EXECUTABLE_OUTPUT_PATH}
+exec_program(${fpc_executable} ${EXECUTABLE_OUTPUT_PATH}
 		ARGS ${noexecstack_flags} checkstack.pas
 		OUTPUT_VARIABLE noout
 		RETURN_VALUE testnoexecstack)
@@ -80,12 +80,12 @@
 endif (NOT pascal_compiler)
 
 add_custom_command(OUTPUT "${EXECUTABLE_OUTPUT_PATH}/hwengine${CMAKE_EXECUTABLE_SUFFIX}"
-                  COMMAND "${pascal_compiler}" 
-                  ARGS ${pascal_compiler_flags}
-                  MAIN_DEPENDENCY ${hwengine_project}
-                  DEPENDS ${engine_sources}
-                  )
-                   
+		COMMAND "${pascal_compiler}"
+		ARGS ${pascal_compiler_flags}
+		MAIN_DEPENDENCY ${hwengine_project}
+		DEPENDS ${engine_sources}
+		)
+
 add_custom_target(hwengine ALL DEPENDS "${EXECUTABLE_OUTPUT_PATH}/hwengine${CMAKE_EXECUTABLE_SUFFIX}")
 
 install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/hwengine${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION bin)