[BACK]Return to patch-CMakeLists_txt CVS log [TXT][DIR] Up to [local] / ports / devel / libgigi / patches

File: [local] / ports / devel / libgigi / patches / Attic / patch-CMakeLists_txt (download)

Revision 1.1, Sun Aug 10 12:33:42 2014 UTC (9 years, 10 months ago) by kirby
Branch: MAIN

cleanup

$OpenBSD$
--- CMakeLists.txt.orig	Wed Oct 26 05:56:00 2011
+++ CMakeLists.txt	Thu Jun 26 13:16:36 2014
@@ -181,6 +181,7 @@ set(int_have_devil 0)
 set(int_have_jpeg 0)
 set(int_have_png 0)
 set(int_have_tiff 0)
+set(int_have_system_ltdl 0)
 if (USE_DEVIL)
     find_package(DevIL)
     if (IL_FOUND)
@@ -224,21 +225,24 @@ else ()
     message(FATAL_ERROR "Freetype library not found.")
 endif ()
 
-
-########################################
-# Header Generation                    #
-########################################
-if (NOT EXISTS ${CMAKE_HOME_DIRECTORY}/libltdl/config.h)
-    if (UNIX)
-        message("-- Configuring libltdl using \"libltdl/configure\" ...")
-        execute_process(
-            COMMAND ${CMAKE_HOME_DIRECTORY}/libltdl/configure
-            WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}/libltdl
-            OUTPUT_QUIET
-        )
-    else ()
-        file(WRITE ${CMAKE_HOME_DIRECTORY}/libltdl/config.h
-             "/* WARNING: Generated by GG's build system.  All local changes will be lost! */
+find_package(ltdl)
+if (LTDL_FOUND)
+    message(STATUS "Using system libltdl.")
+    include_directories(${LTDL_INCLUDE_DIRS})
+    set(int_have_system_ltdl 1)
+else ()
+    message(STATUS "Using local libltdl.")
+    if (NOT EXISTS ${CMAKE_HOME_DIRECTORY}/libltdl/config.h)
+        if (UNIX)
+            message("-- Configuring libltdl using \"libltdl/configure\" ...")
+            execute_process(
+                COMMAND ${CMAKE_HOME_DIRECTORY}/libltdl/configure
+                WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}/libltdl
+                OUTPUT_QUIET
+            )
+        else ()
+            file(WRITE ${CMAKE_HOME_DIRECTORY}/libltdl/config.h
+                 "/* WARNING: Generated by GG's build system.  All local changes will be lost! */
 #define error_t int
 #define HAVE_STDIO_H 1
 #define HAVE_STDLIB_H 1
@@ -253,11 +257,16 @@ if (NOT EXISTS ${CMAKE_HOME_DIRECTORY}/libltdl/config.
 #define LTDL_DLOPEN_DEPLIBS 1
 #define LTDL_SHLIBPATH_VAR \"PATH\"
 #define LTDL_SHLIB_EXT \".dll\"
-"
-        )
+    "
+            )
+        endif ()
     endif ()
-endif ()
+endif()
 
+
+########################################
+# Header Generation                    #
+########################################
 configure_file(
     ${CMAKE_HOME_DIRECTORY}/cmake/Config.h.in
     ${CMAKE_HOME_DIRECTORY}/GG/Config.h