cmake verbosity/documentation/cleanup/formatting
authorkoda
Sun, 09 Dec 2012 18:00:01 +0100
changeset 8283 af97cdbb7713
parent 8281 a1577759bf62
child 8284 a874d00df4a4
cmake verbosity/documentation/cleanup/formatting
CMakeLists.txt
QTfrontend/CMakeLists.txt
cmake_modules/FindFFMPEG.cmake
cmake_modules/FindFreepascal.cmake
hedgewars/CMakeLists.txt
hedgewars/uPhysFSLayer.pas
misc/physfs/CMakeLists.txt
share/CMakeLists.txt
--- a/CMakeLists.txt	Sun Dec 09 16:13:06 2012 +0100
+++ b/CMakeLists.txt	Sun Dec 09 18:00:01 2012 +0100
@@ -194,7 +194,16 @@
     endif()
 endif()
 
-set(pascal_flags ${fpflags_parsed} "-vm4079,4080,4081" "-B" "-FE${PROJECT_BINARY_DIR}/bin" "-Cs2000000" "-vewnq" "-dDEBUGFILE" ${pascal_flags})
+set(pascal_flags ${fpflags_parsed}              # user flags
+                 "-vm4079,4080,4081"            # fpc output format
+                 "-B"                           # compile all units
+                 "-FE${PROJECT_BINARY_DIR}/bin" # fpc output directory
+                 "-Fl${PROJECT_BINARY_DIR}/bin" # fpc linking directory
+                 "-Cs2000000"                   # stack size
+                 "-vewnq"                       # fpc output verbosity
+                 "-dDEBUGFILE"                  # macro for engine output
+                 ${pascal_flags}                # adding to list
+                 )
 set(haskell_flags "-O2" ${ghflags_parsed} ${haskell_flags})
 
 #get BUILD_TYPE and enable/disable optimisation
@@ -257,12 +266,16 @@
 endif()
 
 
+#physfs library (static on unix, dll on win32)
+add_subdirectory(misc/physfs)
+if(NOT WIN32)
+    set(pascal_flags "-k${LIBRARY_OUTPUT_PATH}/libphysfs.a" ${pascal_flags})
+endif()
+
+
 #main engine
 add_subdirectory(hedgewars)
 
-#physfs library
-add_subdirectory(misc/physfs)
-
 #Android related build scripts
 if(ANDROID)
     #run cmake -DANDROID=1 to enable this
--- a/QTfrontend/CMakeLists.txt	Sun Dec 09 16:13:06 2012 +0100
+++ b/QTfrontend/CMakeLists.txt	Sun Dec 09 18:00:01 2012 +0100
@@ -95,9 +95,9 @@
 if(MINGW)
     # resource compilation for mingw
     add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/hedgewars_rc.o
-    COMMAND windres -I ${CMAKE_CURRENT_SOURCE_DIR}
-    -i ${CMAKE_CURRENT_SOURCE_DIR}/hedgewars.rc
-    -o ${CMAKE_CURRENT_BINARY_DIR}/hedgewars_rc.o)
+                       COMMAND windres -I ${CMAKE_CURRENT_SOURCE_DIR}
+                               -i ${CMAKE_CURRENT_SOURCE_DIR}/hedgewars.rc
+                               -o ${CMAKE_CURRENT_BINARY_DIR}/hedgewars_rc.o)
     set(hwfr_src ${hwfr_src} ${CMAKE_CURRENT_BINARY_DIR}/hedgewars_rc.o)
 else(MINGW)
     set(hwfr_src ${hwfr_src} hedgewars.rc)
@@ -204,9 +204,7 @@
 endif()
 
 
-if (CROSSAPPLE)
-
-else()
+if (NOT CROSSAPPLE)
     target_link_libraries(hedgewars ${HW_LINK_LIBS})
 endif()
 
--- a/cmake_modules/FindFFMPEG.cmake	Sun Dec 09 16:13:06 2012 +0100
+++ b/cmake_modules/FindFFMPEG.cmake	Sun Dec 09 18:00:01 2012 +0100
@@ -20,13 +20,19 @@
   # in cache already
   set(FFMPEG_FOUND TRUE)
 else (FFMPEG_LIBRARIES AND FFMPEG_INCLUDE_DIR)
+  # silence output option
+  if (FFMPEG_FIND_QUIETLY)
+    set(VERBOSITY "QUIET")
+  else ()
+    set(VERBOSITY "")
+  endif ()
   # use pkg-config to get the directories and then use these values
   # in the FIND_PATH() and FIND_LIBRARY() calls
   find_package(PkgConfig)
   if (PKG_CONFIG_FOUND)
-    pkg_check_modules(_FFMPEG_AVCODEC libavcodec)
-    pkg_check_modules(_FFMPEG_AVFORMAT libavformat)
-    pkg_check_modules(_FFMPEG_AVUTIL libavutil)
+    pkg_check_modules(_FFMPEG_AVCODEC libavcodec ${VERBOSITY})
+    pkg_check_modules(_FFMPEG_AVFORMAT libavformat ${VERBOSITY})
+    pkg_check_modules(_FFMPEG_AVUTIL libavutil ${VERBOSITY})
   endif (PKG_CONFIG_FOUND)
 
   find_path(FFMPEG_AVCODEC_INCLUDE_DIR
--- a/cmake_modules/FindFreepascal.cmake	Sun Dec 09 16:13:06 2012 +0100
+++ b/cmake_modules/FindFreepascal.cmake	Sun Dec 09 18:00:01 2012 +0100
@@ -19,6 +19,7 @@
 endif()
 
 # Check for noexecstack flag support
+message(STATUS "Checking whether linker needs explicit noexecstack")
 set(NOEXECSTACK_FLAGS "-k-z" "-knoexecstack")
 file(WRITE ${EXECUTABLE_OUTPUT_PATH}/checkstack.pas "begin end.")
 
--- a/hedgewars/CMakeLists.txt	Sun Dec 09 16:13:06 2012 +0100
+++ b/hedgewars/CMakeLists.txt	Sun Dec 09 18:00:01 2012 +0100
@@ -143,7 +143,6 @@
 
         set(pascal_flags "-k${SDLMAIN_LIB}" ${pascal_flags})
     endif()
-    set(pascal_flags "-k${LIBRARY_OUTPUT_PATH}/libphysfs.a" ${pascal_flags})
 endif(APPLE)
 
 if(NOT NOPNG)
@@ -200,7 +199,6 @@
     message(STATUS "Video recording disabled by user")
 endif()
 
-set(pascal_flags "-Fl${LIBRARY_OUTPUT_PATH}" ${pascal_flags})
 
 set(fpc_flags ${NOEXECSTACK_FLAGS} ${pascal_flags} ${hwengine_project})
 
--- a/hedgewars/uPhysFSLayer.pas	Sun Dec 09 16:13:06 2012 +0100
+++ b/hedgewars/uPhysFSLayer.pas	Sun Dec 09 18:00:01 2012 +0100
@@ -15,7 +15,6 @@
 {$IFDEF WIN32}
     PhysfsLibName = 'libphysfs';
 {$ELSE}
-    {$LINKLIB ../bin/libphysfs.a}
     PhysfsLibName = 'physfs';
 {$ENDIF}
 
--- a/misc/physfs/CMakeLists.txt	Sun Dec 09 16:13:06 2012 +0100
+++ b/misc/physfs/CMakeLists.txt	Sun Dec 09 18:00:01 2012 +0100
@@ -286,7 +286,7 @@
     SET(PHYSFS_LIB_TARGET physfs)
     SET(PHYSFS_INSTALL_TARGETS ${PHYSFS_INSTALL_TARGETS} ";physfs")
     INSTALL(TARGETS ${PHYSFS_INSTALL_TARGETS}
-            RUNTIME DESTINATION bin)
+            RUNTIME DESTINATION ${LIBRARY_OUTPUT_PATH})
 ENDIF(PHYSFS_BUILD_SHARED)
 
 IF(NOT PHYSFS_BUILD_SHARED AND NOT PHYSFS_BUILD_STATIC)
--- a/share/CMakeLists.txt	Sun Dec 09 16:13:06 2012 +0100
+++ b/share/CMakeLists.txt	Sun Dec 09 18:00:01 2012 +0100
@@ -11,7 +11,8 @@
 
     #silly libav that always brings in VideoDecoderAcceleration, avaible only from 10.6.3
     if(NOT NOVIDEOREC)
-        find_package(FFMPEG QUIET)
+        set(FFMPEG_FIND_QUIETLY true)
+        find_package(FFMPEG)
         if(${FFMPEG_FOUND} AND ${minimum_macosx_version} VERSION_EQUAL "10.6")
             set(minimum_macosx_version "10.6.3")
         endif()