Browse Source

Added comments for `*_exported()` macros.
Added comments to sdlchecks.cmake noting custom changes.

Rokas Kupstys 9 years ago
parent
commit
d5383c069c
2 changed files with 49 additions and 11 deletions
  1. 16 0
      Build/CMake/Modules/AtomicCommon.cmake
  2. 33 11
      Source/ThirdParty/SDL/cmake/sdlchecks.cmake

+ 16 - 0
Build/CMake/Modules/AtomicCommon.cmake

@@ -204,16 +204,32 @@ macro (setup_executable)
 
 
 endmacro ()
 endmacro ()
 
 
+# Followint three `*_exported()` macros are used defining global cmake variables with game engine include directories,
+# link libraries and definitions. These variables are "CACHE INTERNAL" therefore they are visible through entire build
+# system and by projects that add engine using `add_subdirectory()`.
+
+# Macro for including and exporting game engine include directories. Behaves exactly like include_directories(). Adds
+# specified directories to ATOMIC_INCLUDE_DIRS cache variable.
+# Macro arguments:
+#  List of include directories
 macro (include_directories_exported)
 macro (include_directories_exported)
     include_directories(${ARGV})
     include_directories(${ARGV})
     set (ATOMIC_INCLUDE_DIRS ${ATOMIC_INCLUDE_DIRS} ${ARGV} CACHE INTERNAL "Atomic game engine include directories" FORCE)
     set (ATOMIC_INCLUDE_DIRS ${ATOMIC_INCLUDE_DIRS} ${ARGV} CACHE INTERNAL "Atomic game engine include directories" FORCE)
 endmacro ()
 endmacro ()
 
 
+# Macro for adding and exporting game engine definitions. Behaves exactly like add_definitions(). Adds
+# specified definitions to ATOMIC_DEFINITIONS cache variable.
+# Macro arguments:
+#  List of definitions
 macro (add_definitions_exported)
 macro (add_definitions_exported)
     add_definitions(${ARGV})
     add_definitions(${ARGV})
     set (ATOMIC_DEFINITIONS ${ATOMIC_DEFINITIONS} ${ARGV} CACHE INTERNAL "Atomic game engine definitions" FORCE)
     set (ATOMIC_DEFINITIONS ${ATOMIC_DEFINITIONS} ${ARGV} CACHE INTERNAL "Atomic game engine definitions" FORCE)
 endmacro ()
 endmacro ()
 
 
+# Macro for exporting game engine link libraries. Adds specified targets/libraries to ATOMIC_LINK_LIBRARIES cache
+# variable. This macro does not implicitly add link libraries to any target.
+# Macro arguments:
+#  List of definitions
 macro (add_link_libraries_exported)
 macro (add_link_libraries_exported)
     set (ATOMIC_LINK_LIBRARIES ${ATOMIC_LINK_LIBRARIES} ${ARGV} CACHE INTERNAL "Atomic game engine link libraries" FORCE)
     set (ATOMIC_LINK_LIBRARIES ${ATOMIC_LINK_LIBRARIES} ${ARGV} CACHE INTERNAL "Atomic game engine link libraries" FORCE)
 endmacro ()
 endmacro ()

+ 33 - 11
Source/ThirdParty/SDL/cmake/sdlchecks.cmake

@@ -104,7 +104,9 @@ endmacro()
 macro(CheckOSS)
 macro(CheckOSS)
   if(OSS)
   if(OSS)
     # Urho3D - bug fix - should use different variables for different checks, however, we replace the whole checks with find_package() approach for consistency sake
     # Urho3D - bug fix - should use different variables for different checks, however, we replace the whole checks with find_package() approach for consistency sake
-    find_package (OSS QUIET)
+    # ATOMIC BEGIN
+    find_package (OSS QUIET)    # silence warnings
+    # ATOMIC END
     if(OSS_FOUND)
     if(OSS_FOUND)
       include_directories (${OSS_INCLUDE_DIRS})
       include_directories (${OSS_INCLUDE_DIRS})
       if (OSS_LIBRARIES)
       if (OSS_LIBRARIES)
@@ -132,7 +134,9 @@ endmacro()
 macro(CheckALSA)
 macro(CheckALSA)
   if(ALSA)
   if(ALSA)
     # Urho3D - bug fix - use the more trusted FindALSA module as it has been tested to work for both native and cross-compiling build
     # Urho3D - bug fix - use the more trusted FindALSA module as it has been tested to work for both native and cross-compiling build
-    find_package (ALSA)
+    # ATOMIC BEGIN
+    find_package (ALSA QUIET)    # silence warnings
+    # ATOMIC END
     # todo: remove this fix when the minimum CMake version has been raised to higher than 2.8.7
     # todo: remove this fix when the minimum CMake version has been raised to higher than 2.8.7
     # There is a bug in older version of FindALSA.cmake module where it erroneously include 'alsa' directory component into the variable
     # There is a bug in older version of FindALSA.cmake module where it erroneously include 'alsa' directory component into the variable
     # For cross-compiling build to work correctly, this extra directory component must be removed
     # For cross-compiling build to work correctly, this extra directory component must be removed
@@ -169,7 +173,9 @@ endmacro()
 macro(CheckPulseAudio)
 macro(CheckPulseAudio)
   if(PULSEAUDIO)
   if(PULSEAUDIO)
     # Urho3D - bug fix - do not use pkg-config tool for detection as it only works for host environment and not for rooted environment when cross-compiling
     # Urho3D - bug fix - do not use pkg-config tool for detection as it only works for host environment and not for rooted environment when cross-compiling
-    find_package (PulseAudio)
+    # ATOMIC BEGIN
+    find_package (PulseAudio QUIET)    # silence warnings
+    # ATOMIC END
     if(PULSEAUDIO_FOUND)
     if(PULSEAUDIO_FOUND)
       include_directories (${PULSEAUDIO_INCLUDE_DIRS})
       include_directories (${PULSEAUDIO_INCLUDE_DIRS})
       set(HAVE_PULSEAUDIO TRUE)
       set(HAVE_PULSEAUDIO TRUE)
@@ -201,7 +207,9 @@ endmacro()
 macro(CheckESD)
 macro(CheckESD)
   if(ESD)
   if(ESD)
     # Urho3D - bug fix - do not use pkg-config tool for detection as it only works for host environment and not for rooted environment when cross-compiling
     # Urho3D - bug fix - do not use pkg-config tool for detection as it only works for host environment and not for rooted environment when cross-compiling
-    find_package (Esound QUIET)
+    # ATOMIC BEGIN 
+    find_package (Esound QUIET)    # silence warnings
+    # ATOMIC END
     if(ESOUND_FOUND)
     if(ESOUND_FOUND)
       include_directories (${ESOUND_INCLUDE_DIRS})
       include_directories (${ESOUND_INCLUDE_DIRS})
       set(HAVE_ESD TRUE)
       set(HAVE_ESD TRUE)
@@ -232,7 +240,9 @@ endmacro()
 macro(CheckARTS)
 macro(CheckARTS)
   if(ARTS)
   if(ARTS)
     # Urho3D - bug fix - do not use (host) arts-config tool for detection as it only works for host environment and not for rooted environment when cross-compiling
     # Urho3D - bug fix - do not use (host) arts-config tool for detection as it only works for host environment and not for rooted environment when cross-compiling
-    find_package (aRts QUIET)
+    # ATOMIC BEGIN 
+    find_package (aRts QUIET)    # silence warnings
+    # ATOMIC END
     if(ARTS_FOUND)
     if(ARTS_FOUND)
       include_directories (${ARTS_INCLUDE_DIRS})
       include_directories (${ARTS_INCLUDE_DIRS})
       file(GLOB ARTS_SOURCES ${SDL2_SOURCE_DIR}/src/audio/arts/*.c)
       file(GLOB ARTS_SOURCES ${SDL2_SOURCE_DIR}/src/audio/arts/*.c)
@@ -263,7 +273,9 @@ endmacro()
 macro(CheckNAS)
 macro(CheckNAS)
   if(NAS)
   if(NAS)
     # Urho3D - bug fix - do not use check_include_file() for detection as it only works for host environment and not for rooted environment when cross-compiling
     # Urho3D - bug fix - do not use check_include_file() for detection as it only works for host environment and not for rooted environment when cross-compiling
-    find_package (NetworkAudioSystem QUIET)
+    # ATOMIC BEGIN 
+    find_package (NetworkAudioSystem QUIET)    # silence warnings
+    # ATOMIC END
     if(NAS_FOUND)
     if(NAS_FOUND)
       include_directories (${NAS_INCLUDE_DIRS})
       include_directories (${NAS_INCLUDE_DIRS})
       set(HAVE_NAS TRUE)
       set(HAVE_NAS TRUE)
@@ -294,7 +306,9 @@ endmacro()
 macro(CheckSNDIO)
 macro(CheckSNDIO)
   if(SNDIO)
   if(SNDIO)
     # Urho3D - bug fix - do not use check_include_file() for detection as it only works for host environment and not for rooted environment when cross-compiling
     # Urho3D - bug fix - do not use check_include_file() for detection as it only works for host environment and not for rooted environment when cross-compiling
-    find_package (RoarAudio QUIET)
+    # ATOMIC BEGIN 
+    find_package (RoarAudio QUIET)    # silence warnings
+    # ATOMIC END
     if(SNDIO_FOUND)
     if(SNDIO_FOUND)
       include_directories (${SNDIO_INCLUDE_DIRS})
       include_directories (${SNDIO_INCLUDE_DIRS})
       set(HAVE_SNDIO TRUE)
       set(HAVE_SNDIO TRUE)
@@ -325,7 +339,9 @@ endmacro()
 macro(CheckFusionSound)
 macro(CheckFusionSound)
   if(FUSIONSOUND)
   if(FUSIONSOUND)
     # Urho3D - bug fix - do not use pkg-config tool for detection as it only works for host environment and not for rooted environment when cross-compiling
     # Urho3D - bug fix - do not use pkg-config tool for detection as it only works for host environment and not for rooted environment when cross-compiling
-    find_package (FusionSound 1.0.0)
+    # ATOMIC BEGIN
+    find_package (FusionSound 1.0.0 QUIET)    # silence warnings
+    # ATOMIC END
     if(FUSIONSOUND_FOUND)
     if(FUSIONSOUND_FOUND)
       include_directories (${FUSIONSOUND_INCLUDE_DIRS})
       include_directories (${FUSIONSOUND_INCLUDE_DIRS})
       set(HAVE_FUSIONSOUND TRUE)
       set(HAVE_FUSIONSOUND TRUE)
@@ -552,7 +568,9 @@ endmacro()
 macro(CheckMir)
 macro(CheckMir)
     if(VIDEO_MIR)
     if(VIDEO_MIR)
         # Urho3D - bug fix - do not use pkg-config tool for detection as it only works for host environment and not for rooted environment when cross-compiling
         # Urho3D - bug fix - do not use pkg-config tool for detection as it only works for host environment and not for rooted environment when cross-compiling
-        find_package (Mir QUIET)
+        # ATOMIC BEGIN 
+        find_package (Mir QUIET)    # silence warnings
+        # ATOMIC END
         if (MIR_FOUND)
         if (MIR_FOUND)
             include_directories (${MIR_INCLUDE_DIRS})
             include_directories (${MIR_INCLUDE_DIRS})
             set(HAVE_VIDEO_MIR TRUE)
             set(HAVE_VIDEO_MIR TRUE)
@@ -588,7 +606,9 @@ endmacro()
 macro(CheckWayland)
 macro(CheckWayland)
   if(VIDEO_WAYLAND)
   if(VIDEO_WAYLAND)
     # Urho3D - bug fix - do not use pkg-config tool for detection as it only works for host environment and not for rooted environment when cross-compiling
     # Urho3D - bug fix - do not use pkg-config tool for detection as it only works for host environment and not for rooted environment when cross-compiling
-    find_package (Wayland QUIET)
+    # ATOMIC BEGIN 
+    find_package (Wayland QUIET)    # silence warnings
+    # ATOMIC END
     if(WAYLAND_FOUND)
     if(WAYLAND_FOUND)
       include_directories (${WAYLAND_INCLUDE_DIRS})
       include_directories (${WAYLAND_INCLUDE_DIRS})
       set(HAVE_VIDEO_WAYLAND TRUE)
       set(HAVE_VIDEO_WAYLAND TRUE)
@@ -635,7 +655,9 @@ endmacro()
 macro(CheckDirectFB)
 macro(CheckDirectFB)
   if(VIDEO_DIRECTFB)
   if(VIDEO_DIRECTFB)
     # Urho3D - bug fix - do not use pkg-config tool for detection as it only works for host environment and not for rooted environment when cross-compiling
     # Urho3D - bug fix - do not use pkg-config tool for detection as it only works for host environment and not for rooted environment when cross-compiling
-    find_package (DirectFB 1.0.0)
+    # ATOMIC BEGIN
+    find_package (DirectFB 1.0.0 QUIET)    # silence warnings
+    # ATOMIC END
     if(DIRECTFB_FOUND)
     if(DIRECTFB_FOUND)
       include_directories (${DIRECTFB_INCLUDE_DIRS})
       include_directories (${DIRECTFB_INCLUDE_DIRS})
       set(HAVE_VIDEO_DIRECTFB TRUE)
       set(HAVE_VIDEO_DIRECTFB TRUE)