Browse Source

Configure and install Urho3D.pc file for pkg-config tool.

This is useful for Urho3D library user via SDK installation without having CMake installed.
Yao Wei Tjong 姚伟忠 12 years ago
parent
commit
d7942132f1

+ 0 - 0
.bash_helpers → .bash_helpers.sh


+ 15 - 6
Docs/GettingStarted.dox

@@ -269,10 +269,6 @@ F2          Toggle debug HUD
 
 This page shows how to create a new C++ project linking against Urho3D library as external library. There are two approaches to do this. It is imperative to clear the CMake cache when changing from one approach to the other. In fact, you also need to clear the cache when any of the environment variables required by the CMake build script below change its value.
 
-\section UsingLibraryFromProjectRootTree From Urho3D project root tree
-
-This section assumes that you have already successfully build a static or shared library in the Urho3D project (separately from your own project). In order to find Urho3D library in Urho3D project library output directory, specify an environment variable called "URHO3D_HOME" which points to a Urho3D project root directory that you want to use (if you have more than one).
-
 First of all, structure your project similar to Urho3D project as below:
 
 \code
@@ -280,11 +276,16 @@ PROJECT_ROOT/
 L Source/
 L Bin/
 L Build/
+L *.bat or *.sh
 \endcode
 
-The Source/ directory is where your project CMakeLists.txt and all your source codes should reside. The Bin/ directory is where all the executables output will be generated. In order to run the executable in this directory, you need to copy (or symlink) the CoreData/ and Data/ directories from Urho3D project Bin/ directory to here. The Build/ directory will be created automatically by the Urho3D CMake module that will be discussed shortly below. The module creates a so-called out-of-source build tree to keep the Source/ directory clean from intermediate build files.
+The Source/ directory is where your project CMakeLists.txt and all your source codes should reside. The Bin/ directory is where all the executables output will be generated. In order to run the executable in this directory, you need to copy (or symlink) the CoreData/ and Data/ directories from Urho3D project Bin/ directory (or from Urho3D SDK installation) to here. You may also want to copy (or symlink) the batch files or shell script files from Urho3D project root directory (or from Urho3D SDK installation) to your project root directory. The Build/ directory will be created automatically by the Urho3D CMake module that will be discussed shortly below. The *.bat or *.sh scripts work together with the module to create a so-called out-of-source build tree to keep the Source/ directory clean from intermediate build files.
 
-Now, in your own project Source/ directory, create a new CMakeLists.txt file and add the following lines:
+\section UsingLibraryFromProjectRootTree From Urho3D project root tree
+
+This section assumes that you have already successfully build a static or shared library in the Urho3D project (separately from your own project). In order to find Urho3D library in Urho3D project library output directory, specify an environment variable called "URHO3D_HOME" which points to a Urho3D project root directory that you want to use (if you have more than one).
+
+In your own project Source/ directory, create a new CMakeLists.txt file and add the following lines:
 
 \code
 # Set project name
@@ -349,6 +350,14 @@ On non-Windows platform:
 set (CMAKE_MODULE_PATH $ENV{URHO3D_INSTALL_PREFIX}/share/Urho3D/CMake/Modules ${CMAKE_INSTALL_PREFIX}/share/Urho3D/CMake/Modules CACHE PATH "Path to Urho3D-specific CMake modules")
 \endcode
 
+\subsection UsingLibraryFromSDKWithPkgConfig Using pkg-config instead of CMake 
+
+If for some reason you could not use CMake in your project, you could configure your project to compile and link against Urho3D library from SDK installation using 'pkg-config' tool with the help of Urho3D.pc configuration file (which is installed as part of the SDK installation). If the Urho3D SDK is being installed into a local location (such as /usr/local) or a non-default location, then most likely you would need to specify PKG_CONFIG_PATH environment variable to point to the location of the configuration file for this to work. For example on Fedora with local installation:
+
+\code
+cc `PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig pkg-config --cflags --libs Urho3D` -o myapp myapp.cpp
+\endcode
+
 \page Structure Overall structure
 
 The Urho3D library consists of the following subdirectories that represent different subsystems:

+ 6 - 4
Source/CMake/Modules/FindUrho3D.cmake

@@ -90,17 +90,19 @@ else ()
     # For example on Linux platform: URHO3D_INSTALL_PREFIX=/home/john/usr/local if the SDK is installed using DESTDIR=/home/john and CMAKE_INSTALL_PREFIX=/usr/local (default)
     set (CMAKE_PREFIX_PATH $ENV{URHO3D_INSTALL_PREFIX} CACHE PATH "Prefix path to Urho3D SDK installation")
     if (WIN32)
-        set (URHO3D_INC_SEARCH_PATH "${CMAKE_INSTALL_PREFIX}/Urho3D SDK/Include")
-        set (URHO3D_LIB_SEARCH_PATH "${CMAKE_INSTALL_PREFIX}/Urho3D SDK/Lib")
+        set (PATH_PREFIX "Urho3D SDK")
+        set (URHO3D_INC_SEARCH_PATH ${PATH_PREFIX}/Include)
+        set (URHO3D_LIB_SEARCH_PATH ${PATH_PREFIX}/Lib)
     else ()
+        set (PATH_SUFFIX Urho3D)    # This could be patched to "" if the suffix is not desirable
         if (IOS)
             set (CMAKE_LIBRARY_ARCHITECTURE ios)
         endif ()
         set (URHO3D_INC_SEARCH_PATH /opt/include)
         set (URHO3D_LIB_SEARCH_PATH /opt/lib)
     endif ()
-    find_path (URHO3D_INCLUDE_DIR Urho3D.h PATHS ${URHO3D_INC_SEARCH_PATH} PATH_SUFFIXES Urho3D)
-    find_library (URHO3D_LIBRARIES NAMES ${URHO3D_LIB_NAMES} PATHS ${URHO3D_LIB_SEARCH_PATH} PATH_SUFFIXES Urho3D)
+    find_path (URHO3D_INCLUDE_DIR Urho3D.h PATHS ${URHO3D_INC_SEARCH_PATH} PATH_SUFFIXES ${PATH_SUFFIX})
+    find_library (URHO3D_LIBRARIES NAMES ${URHO3D_LIB_NAMES} PATHS ${URHO3D_LIB_SEARCH_PATH} PATH_SUFFIXES ${PATH_SUFFIX})
 
     if (URHO3D_INCLUDE_DIR)
         set (BASE_DIR ${URHO3D_INCLUDE_DIR})

+ 32 - 12
Source/CMake/Modules/Urho3D-CMake-magic.cmake

@@ -61,8 +61,7 @@ endif ()
 # Enable file watcher support for automatic resource reloads.
 add_definitions (-DENABLE_FILEWATCHER)
 
-# Enable profiling. If disabled, autoprofileblocks become no-ops and the Profiler subsystem is not
-# instantiated.
+# Enable profiling. If disabled, autoprofileblocks become no-ops and the Profiler subsystem is not instantiated.
 add_definitions (-DENABLE_PROFILING)
 
 # Enable logging. If disabled, LOGXXXX macros become no-ops and the Log subsystem is not instantiated.
@@ -86,6 +85,23 @@ if (NOT WIN32)
     add_definitions (-DUNIX)
 endif ()
 
+# Add definitions for GLEW
+if (NOT IOS AND NOT ANDROID AND NOT RASPI AND USE_OPENGL)
+    add_definitions (-DGLEW_STATIC)
+    add_definitions (-DGLEW_NO_GLU)
+endif ()
+
+# Add definition for Lua and LuaJIT
+if (ENABLE_LUAJIT)
+    add_definitions (-DENABLE_LUAJIT)
+    set (JIT JIT)
+    # Implied ENABLE_LUA
+    set (ENABLE_LUA 1)
+endif ()
+if (ENABLE_LUA)
+    add_definitions (-DENABLE_LUA)
+endif ()
+
 # Default library type is STATIC
 if (URHO3D_LIB_TYPE)
     string (TOUPPER ${URHO3D_LIB_TYPE} URHO3D_LIB_TYPE)
@@ -412,12 +428,12 @@ macro (add_android_native_init)
     elseif (EXISTS $ENV{URHO3D_HOME}/Source/ThirdParty/SDL/src/main/android/SDL_android_main.c)
         # Use Urho3D source installation
         list (APPEND SOURCE_FILES $ENV{URHO3D_HOME}/Source/ThirdParty/SDL/src/main/android/SDL_android_main.c)
-    elseif (EXISTS $ENV{URHO3D_INSTALL_PREFIX}/share/Urho3D/templates/android/SDL_android_main.c)
-        # Use Urho3D SDK installation on non-default installation location
-        list (APPEND SOURCE_FILES $ENV{URHO3D_INSTALL_PREFIX}/share/Urho3D/templates/android/SDL_android_main.c)
-    elseif (EXISTS ${CMAKE_INSTALL_PREFIX}/share/Urho3D/templates/android/SDL_android_main.c)
+    elseif (EXISTS $ENV{URHO3D_INSTALL_PREFIX}/share/${PATH_SUFFIX}/templates/android/SDL_android_main.c)
+        # Use Urho3D SDK installation on non-default installation location (PATH_SUFFIX variable is set in FindUrho3D.cmake module)
+        list (APPEND SOURCE_FILES $ENV{URHO3D_INSTALL_PREFIX}/share/${PATH_SUFFIX}/templates/android/SDL_android_main.c)
+    elseif (EXISTS ${CMAKE_INSTALL_PREFIX}/share/${PATH_SUFFIX}/templates/android/SDL_android_main.c)
         # Use Urho3D SDK installation on system default installation location
-        list (APPEND SOURCE_FILES ${CMAKE_INSTALL_PREFIX}/share/Urho3D/templates/android/SDL_android_main.c)
+        list (APPEND SOURCE_FILES ${CMAKE_INSTALL_PREFIX}/share/${PATH_SUFFIX}/templates/android/SDL_android_main.c)
     else ()
         message (FATAL_ERROR
             "Could not find SDL_android_main.c source file in default SDK installation location or Urho3D project root tree. "
@@ -521,9 +537,6 @@ macro (define_dependency_libs TARGET)
     if (ENABLE_LUAJIT AND ${TARGET} MATCHES LuaJIT|Urho3D)
         if (NOT WIN32)
             list (APPEND LINK_LIBS_ONLY dl m)
-            if (NOT APPLE)
-                set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-E")
-            endif ()
         endif ()
     endif ()
 
@@ -557,6 +570,11 @@ macro (define_dependency_libs TARGET)
         if (URHO3D_LIBRARIES)
             list (APPEND ABSOLUTE_PATH_LIBS ${URHO3D_LIBRARIES})
         endif ()
+
+        # GCC-specific executable linker flag for LuaJIT
+        if (ENABLE_LUAJIT AND NOT WIN32 AND NOT APPLE)
+            set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-E")
+        endif ()
     endif ()
 
     if (LINK_LIBS_ONLY)
@@ -566,8 +584,10 @@ endmacro ()
 
 # Macro for sorting and removing duplicate values
 macro (remove_duplicate LIST_NAME)
-    list (SORT ${LIST_NAME})
-    list (REMOVE_DUPLICATES ${LIST_NAME})
+    if (${LIST_NAME})
+        list (SORT ${LIST_NAME})
+        list (REMOVE_DUPLICATES ${LIST_NAME})
+    endif ()
 endmacro ()
 
 # Macro for setting a list from another with option to sort and remove duplicate values

+ 21 - 38
Source/CMakeLists.txt

@@ -43,45 +43,23 @@ if (HAVE_STDINT_H)
     add_definitions (-DHAVE_STDINT_H)
 endif ()
 
-# Add definitions for GLEW
-if (NOT IOS AND NOT ANDROID AND NOT RASPI AND USE_OPENGL)
-    add_definitions (-DGLEW_STATIC)
-    add_definitions (-DGLEW_NO_GLU)
-endif ()
-
-# Add definition for Lua and LuaJIT
-if (ENABLE_LUAJIT)
-    add_definitions (-DENABLE_LUAJIT)
-    set (JIT JIT)
-    # Implied ENABLE_LUA
-    set (ENABLE_LUA 1)
-endif ()
-if (ENABLE_LUA)
-    add_definitions (-DENABLE_LUA)
-endif ()
-
 # Add global include directories for export header and SDL header
 include_directories (${CMAKE_BINARY_DIR}/Engine ThirdParty/SDL/include)
 
-# Setup the compiler flags for building shared library
-if (URHO3D_LIB_TYPE STREQUAL SHARED)
-    # Hide the symbols that are not explicitly marked for export
-    add_compiler_export_flags ()
-    # Use PIC on platforms that support it 
-    set (CMAKE_POSITION_INDEPENDENT_CODE true)
-endif ()
-
-# Setup install destinations
+# Setup SDK install destinations
 if (WIN32)
-    set (DEST_INCLUDE_DIR "Urho3D SDK/Include")
-    set (DEST_RUNTIME_DIR "Urho3D SDK/Bin")
-    set (DEST_LIBRARY_DIR "Urho3D SDK/Lib")
-    set (DEST_ARCHIVE_DIR "Urho3D SDK/Lib")
-    set (DEST_CMAKE_DIR   "Urho3D SDK/CMake")
+    set (PATH_PREFIX "Urho3D SDK")
+    set (DEST_INCLUDE_DIR ${PATH_PREFIX}/Include)
+    set (DEST_RUNTIME_DIR ${PATH_PREFIX}/Bin)
+    set (DEST_LIBRARY_DIR ${PATH_PREFIX}/Lib)
+    set (DEST_ARCHIVE_DIR ${PATH_PREFIX}/Lib)
+    set (DEST_SHARE_DIR ${PATH_PREFIX})
+    set (DEST_PKGCONFIG_DIR ${PATH_PREFIX}/Lib/pkgconfig)
     set (SCRIPT_PATTERN *.bat)
 else ()
-    set (DEST_INCLUDE_DIR include/Urho3D)
-    set (DEST_RUNTIME_DIR share/Urho3D/Bin)
+    set (PATH_SUFFIX /Urho3D)   # This could be patched to "" if the suffix is not desirable
+    set (DEST_INCLUDE_DIR include${PATH_SUFFIX})
+    set (DEST_RUNTIME_DIR share${PATH_SUFFIX}/Bin)
     if (ENABLE_64BIT)
         if (NOT CMAKE_CROSSCOMPILING AND EXISTS /usr/lib64)    # TODO: Revisit this again when ARM also supports 64bit, for now ARM architecture ignores ENABLE_64BIT build option
             # Probably target system is a RedHat-based distro
@@ -92,17 +70,22 @@ else ()
         # Use 'ios' arch subdirectory to differentiate, in case both Mac OS X and iOS build are installed at the same destination
         set (LIB_SUFFIX ${LIB_SUFFIX}/ios)
     endif ()
-    set (DEST_LIBRARY_DIR lib${LIB_SUFFIX}/Urho3D)
-    set (DEST_ARCHIVE_DIR lib${LIB_SUFFIX}/Urho3D)
-    set (DEST_CMAKE_DIR share/Urho3D/CMake)
+    set (DEST_LIBRARY_DIR lib${LIB_SUFFIX}${PATH_SUFFIX})
+    set (DEST_ARCHIVE_DIR lib${LIB_SUFFIX}${PATH_SUFFIX})
+    set (DEST_SHARE_DIR share${PATH_SUFFIX})
+    set (DEST_PKGCONFIG_DIR lib${LIB_SUFFIX}/pkgconfig)
     set (SCRIPT_PATTERN *.sh)
 endif ()
 # Install application launcher scripts
-install (DIRECTORY ${PROJECT_ROOT_DIR}/Bin/ DESTINATION ${DEST_RUNTIME_DIR} USE_SOURCE_PERMISSIONS FILES_MATCHING PATTERN ${SCRIPT_PATTERN})    # Note: the trailing slash is significant
+file (GLOB APP_SCRIPTS ${PROJECT_ROOT_DIR}/Bin/${SCRIPT_PATTERN})
+install (FILES ${APP_SCRIPTS} DESTINATION ${DEST_RUNTIME_DIR} PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)   # 755
 # Install resource directories required by applications built with Urho3D library
 install (DIRECTORY ${PROJECT_ROOT_DIR}/Bin/CoreData ${PROJECT_ROOT_DIR}/Bin/Data DESTINATION ${DEST_RUNTIME_DIR} USE_SOURCE_PERMISSIONS)
 # Install CMake modules and toolchains provided by and for Urho3D
-install (DIRECTORY ${PROJECT_ROOT_DIR}/Source/CMake/ DESTINATION ${DEST_CMAKE_DIR} USE_SOURCE_PERMISSIONS)
+install (DIRECTORY ${PROJECT_ROOT_DIR}/Source/CMake/ DESTINATION ${DEST_SHARE_DIR}/CMake USE_SOURCE_PERMISSIONS)    # Note: the trailing slash is significant
+# Install CMake launcher scripts
+file (GLOB CMAKE_SCRIPTS ${PROJECT_ROOT_DIR}/${SCRIPT_PATTERN})
+install (FILES ${CMAKE_SCRIPTS} DESTINATION ${DEST_SHARE_DIR}/Scripts PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
 
 # Add targets
 foreach (TARGET AngelScript Bullet Civetweb Detour FreeType JO kNet LZ4 PugiXml Recast SDL StanHull STB)

+ 1 - 2
Source/Engine/Audio/CMakeLists.txt

@@ -24,5 +24,4 @@
 define_source_files (PARENT_SCOPE)
 
 # Define dependency libs
-set (ENGINE_LIBS ${ENGINE_LIBS} ../ThirdParty/STB PARENT_SCOPE)
-set (ENGINE_LINK_LIBS_ONLY ${ENGINE_LINK_LIBS_ONLY} SDL PARENT_SCOPE)
+set (ENGINE_INCLUDE_DIRS_ONLY ${ENGINE_INCLUDE_DIRS_ONLY} ../ThirdParty/STB PARENT_SCOPE)

+ 17 - 0
Source/Engine/CMakeLists.txt

@@ -157,6 +157,23 @@ if (NOT URHO3D_LIB_TYPE STREQUAL URHO3D_EXPORTS_LIB_TYPE OR ${CMAKE_CURRENT_SOUR
 endif ()
 install (FILES ${CMAKE_CURRENT_BINARY_DIR}/Urho3D.h DESTINATION ${DEST_INCLUDE_DIR})
 
+# Generate platform specific pkg-config file for the benefit of Urho3D library users via SDK without CMake
+get_directory_property (URHO3D_COMPILE_DEFINITIONS DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMPILE_DEFINITIONS)
+list (REMOVE_ITEM URHO3D_COMPILE_DEFINITIONS HAVE_STDINT_H GLEW_STATIC GLEW_NO_GLU)     # Remove those defines that are only used for building the library and not needed by library user
+string (REPLACE ";" " -D" URHO3D_COMPILE_DEFINITIONS ";${URHO3D_COMPILE_DEFINITIONS}")
+set (URHO3D_EXT_LIBS ${LINK_LIBS_ONLY})
+string (REPLACE ";" " -l" URHO3D_EXT_LIBS ";${URHO3D_EXT_LIBS}")
+configure_file (${CMAKE_CURRENT_SOURCE_DIR}/Urho3D.pc.in ${CMAKE_CURRENT_BINARY_DIR}/Urho3D.pc @ONLY)
+install (FILES ${CMAKE_CURRENT_BINARY_DIR}/Urho3D.pc DESTINATION ${DEST_PKGCONFIG_DIR})
+
+# Setup the compiler flags for building shared library (do this here so that it does not interfere with the pkg-config file generation above)
+if (URHO3D_LIB_TYPE STREQUAL SHARED)
+    # Hide the symbols that are not explicitly marked for export
+    add_compiler_export_flags ()
+    # Use PIC on platforms that support it (shared library type has this property set to true by default, so we only have to deal with those static ones that the shared library links against)
+    set_target_properties (${STATIC_LIBRARY_TARGETS} PROPERTIES POSITION_INDEPENDENT_CODE true) 
+endif ()
+
 # Define post build steps
 # Strip the output shared library for embedded devices
 if (URHO3D_LIB_TYPE STREQUAL SHARED AND (CMAKE_CROSSCOMPILING OR IOS))

+ 0 - 1
Source/Engine/Core/CMakeLists.txt

@@ -26,5 +26,4 @@ define_source_files (PARENT_SCOPE)
 # Define dependency libs
 if (NOT IOS AND NOT ANDROID AND NOT RASPI)
     set (ENGINE_INCLUDE_DIRS_ONLY ${ENGINE_INCLUDE_DIRS_ONLY} ../ThirdParty/LibCpuId/src PARENT_SCOPE)
-    set (ENGINE_LINK_LIBS_ONLY ${ENGINE_LINK_LIBS_ONLY} LibCpuId PARENT_SCOPE)
 endif ()

+ 1 - 2
Source/Engine/Graphics/CMakeLists.txt

@@ -29,7 +29,6 @@ endif ()
 define_source_files (GLOB_CPP_PATTERNS *.cpp ${GRAPHICS_SYS_DIR}/*.cpp GLOB_H_PATTERNS *.h ${GRAPHICS_SYS_DIR}/*.h PARENT_SCOPE)
 
 # Define dependency libs
-set (ENGINE_LINK_LIBS_ONLY ${ENGINE_LINK_LIBS_ONLY} SDL PARENT_SCOPE)
 if (USE_OPENGL AND NOT IOS AND NOT ANDROID AND NOT RASPI)
-    set (ENGINE_LIBS ${ENGINE_LIBS} ../ThirdParty/GLEW PARENT_SCOPE)
+    set (ENGINE_INCLUDE_DIRS_ONLY ${ENGINE_INCLUDE_DIRS_ONLY} ../ThirdParty/GLEW PARENT_SCOPE)
 endif ()

+ 1 - 1
Source/Engine/IO/CMakeLists.txt

@@ -27,4 +27,4 @@ endif()
 define_source_files (GLOB_CPP_PATTERNS *.cpp ${GLOB_OBJC_PATTERN} PARENT_SCOPE)
 
 # Define dependency libs
-set (ENGINE_LIBS ${ENGINE_LIBS} ../ThirdParty/LZ4 PARENT_SCOPE)
+set (ENGINE_INCLUDE_DIRS_ONLY ${ENGINE_INCLUDE_DIRS_ONLY} ../ThirdParty/LZ4 PARENT_SCOPE)

+ 0 - 1
Source/Engine/Input/CMakeLists.txt

@@ -24,7 +24,6 @@
 define_source_files (PARENT_SCOPE)
 
 # Define dependency libs
-set (ENGINE_LINK_LIBS_ONLY ${ENGINE_LINK_LIBS_ONLY} SDL PARENT_SCOPE)
 if (USE_OPENGL AND NOT IOS AND NOT ANDROID AND NOT RASPI)
     set (ENGINE_INCLUDE_DIRS_ONLY ${ENGINE_INCLUDE_DIRS_ONLY} ../ThirdParty/GLEW PARENT_SCOPE)
 endif ()

+ 1 - 1
Source/Engine/Navigation/CMakeLists.txt

@@ -24,4 +24,4 @@
 define_source_files (PARENT_SCOPE)
 
 # Define dependency libs
-set (ENGINE_LIBS ${ENGINE_LIBS} ../ThirdParty/Recast/include ../ThirdParty/Detour/include PARENT_SCOPE)
+set (ENGINE_INCLUDE_DIRS_ONLY ${ENGINE_INCLUDE_DIRS_ONLY} ../ThirdParty/Recast/include ../ThirdParty/Detour/include PARENT_SCOPE)

+ 1 - 1
Source/Engine/Network/CMakeLists.txt

@@ -24,4 +24,4 @@
 define_source_files (PARENT_SCOPE)
 
 # Define dependency libs
-set (ENGINE_LIBS ${ENGINE_LIBS} ../ThirdParty/kNet/include ../ThirdParty/Civetweb/include PARENT_SCOPE)
+set (ENGINE_INCLUDE_DIRS_ONLY ${ENGINE_INCLUDE_DIRS_ONLY} ../ThirdParty/kNet/include ../ThirdParty/Civetweb/include PARENT_SCOPE)

+ 1 - 1
Source/Engine/Physics/CMakeLists.txt

@@ -24,4 +24,4 @@
 define_source_files (PARENT_SCOPE)
 
 # Define dependency libs
-set (ENGINE_LIBS ${ENGINE_LIBS} ../ThirdParty/Bullet/src ../ThirdParty/StanHull PARENT_SCOPE)
+set (ENGINE_INCLUDE_DIRS_ONLY ${ENGINE_INCLUDE_DIRS_ONLY} ../ThirdParty/Bullet/src ../ThirdParty/StanHull PARENT_SCOPE)

+ 1 - 1
Source/Engine/Resource/CMakeLists.txt

@@ -24,4 +24,4 @@
 define_source_files (PARENT_SCOPE)
 
 # Define dependency libs
-set (ENGINE_LIBS ${ENGINE_LIBS} ../ThirdParty/JO ../ThirdParty/PugiXml/src ../ThirdParty/STB PARENT_SCOPE)
+set (ENGINE_INCLUDE_DIRS_ONLY ${ENGINE_INCLUDE_DIRS_ONLY} ../ThirdParty/JO ../ThirdParty/PugiXml/src ../ThirdParty/STB PARENT_SCOPE)

+ 1 - 2
Source/Engine/Script/CMakeLists.txt

@@ -24,6 +24,5 @@
 define_source_files (PARENT_SCOPE)
 
 # Define dependency libs
-set (ENGINE_LIBS ${ENGINE_LIBS} ../ThirdParty/AngelScript/include PARENT_SCOPE)
-set (ENGINE_INCLUDE_DIRS_ONLY ${ENGINE_INCLUDE_DIRS_ONLY} ../ThirdParty/Bullet/src ../ThirdParty/kNet/include PARENT_SCOPE)
+set (ENGINE_INCLUDE_DIRS_ONLY ${ENGINE_INCLUDE_DIRS_ONLY} ../ThirdParty/AngelScript/include ../ThirdParty/Bullet/src ../ThirdParty/kNet/include PARENT_SCOPE)
 

+ 1 - 1
Source/Engine/UI/CMakeLists.txt

@@ -24,4 +24,4 @@
 define_source_files (PARENT_SCOPE)
 
 # Define dependency libs
-set (ENGINE_LIBS ${ENGINE_LIBS} ../ThirdParty/FreeType/include PARENT_SCOPE)
+set (ENGINE_INCLUDE_DIRS_ONLY ${ENGINE_INCLUDE_DIRS_ONLY} ../ThirdParty/FreeType/include PARENT_SCOPE)

+ 12 - 0
Source/Engine/Urho3D.pc.in

@@ -0,0 +1,12 @@
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=${prefix}
+includedir=${prefix}/@DEST_INCLUDE_DIR@
+libdir=${exec_prefix}/@DEST_LIBRARY_DIR@
+
+Name: Urho3D
+Description: Urho3D is a lightweight, cross-platform rendering and game engine implemented in C++ and released under the MIT license. Greatly inspired by OGRE (http://www.ogre3d.org) and Horde3D (http://www.horde3d.org).
+Version: 1.3.0
+Requires:
+Conflicts:
+Cflags: @URHO3D_COMPILE_DEFINITIONS@ @CMAKE_CXX_FLAGS@ -I${includedir}/Urho3D -I${includedir}/Urho3D/Bullet -I${includedir}/Urho3D/kNet -I${includedir}/Urho3D/SDL
+Libs: @CMAKE_EXE_LINKER_FLAGS@ -L${libdir} -lUrho3D @URHO3D_EXT_LIBS@

+ 1 - 1
Source/ThirdParty/SDL/CMakeLists.txt

@@ -107,7 +107,7 @@ set_source_files_properties (${SYS_C_FILES} PROPERTIES LANGUAGE C)
 set (SOURCE_FILES ${C_FILES} ${SYS_C_FILES} ${H_FILES})
 # Install dependency for SDL_android_main.c, D3D9GraphicsImpl.h, OGLGraphicsImpl.h, InputEvents.h, File.h, and Cursor.h
 install (DIRECTORY include/ DESTINATION ${DEST_INCLUDE_DIR}/SDL USE_SOURCE_PERMISSIONS FILES_MATCHING PATTERN *.h)     # Note: the trailing slash is significant
-install (FILES src/main/android/SDL_android_main.c DESTINATION ${DEST_RUNTIME_DIR}/../templates/android)
+install (FILES src/main/android/SDL_android_main.c DESTINATION ${DEST_SHARE_DIR}/templates/android)
 
 # Setup target
 setup_library ()

+ 1 - 1
cmake_gcc.sh

@@ -25,7 +25,7 @@ cd $( dirname $0 )
 SOURCE=`pwd`/Source
 
 # Define helpers
-. .bash_helpers
+. .bash_helpers.sh
 
 # Create out-of-source build directory
 cmake -E make_directory Build