aboutsummaryrefslogtreecommitdiff
path: root/project/cmake
diff options
context:
space:
mode:
authormontellese <montellese@xbmc.org>2014-07-22 14:04:31 +0200
committermontellese <montellese@xbmc.org>2014-07-30 11:16:01 +0200
commit060f34fdb1420ae7f9d86b3271c109623c60d294 (patch)
tree14edc8ef99ec50a7741ed03a8e155447c0b25892 /project/cmake
parentd187586fe5d2542fa2e5f5112642e4901e2506d2 (diff)
[win32] cmake: move generation of xbmc-config.cmake into xbmc dependency
Diffstat (limited to 'project/cmake')
-rw-r--r--project/cmake/addons/CMakeLists.txt38
-rw-r--r--project/cmake/addons/depends/common/xbmc/CMakeLists.txt65
-rw-r--r--project/cmake/addons/depends/windows/cmake/xbmc/CMakeLists.txt31
-rw-r--r--project/cmake/addons/depends/windows/cmake/xbmc/noinstall.txt (renamed from project/cmake/addons/depends/common/xbmc/noinstall.txt)0
-rw-r--r--project/cmake/addons/depends/windows/cmake/xbmc/xbmc.txt (renamed from project/cmake/addons/depends/common/xbmc/xbmc.txt)0
5 files changed, 52 insertions, 82 deletions
diff --git a/project/cmake/addons/CMakeLists.txt b/project/cmake/addons/CMakeLists.txt
index a8c708d577..018e16cedd 100644
--- a/project/cmake/addons/CMakeLists.txt
+++ b/project/cmake/addons/CMakeLists.txt
@@ -18,18 +18,20 @@ else()
endif()
get_filename_component(XBMCROOT "${XBMCROOT}" ABSOLUTE)
-if(NOT DEPENDS_PATH)
- set(DEPENDS_PATH "${PROJECT_SOURCE_DIR}/output/depends")
-else()
- file(TO_CMAKE_PATH "${DEPENDS_PATH}" DEPENDS_PATH)
-endif()
+if(NOT WIN32)
+ if(NOT DEPENDS_PATH)
+ set(DEPENDS_PATH "${PROJECT_SOURCE_DIR}/output/depends")
+ else()
+ file(TO_CMAKE_PATH "${DEPENDS_PATH}" DEPENDS_PATH)
+ endif()
-# make sure CMAKE_PREFIX_PATH is set
-if(NOT CMAKE_PREFIX_PATH)
- set(CMAKE_PREFIX_PATH "${DEPENDS_PATH}")
-else()
- file(TO_CMAKE_PATH "${CMAKE_PREFIX_PATH}" CMAKE_PREFIX_PATH)
- list(APPEND CMAKE_PREFIX_PATH "${DEPENDS_PATH}")
+ # make sure CMAKE_PREFIX_PATH is set
+ if(NOT CMAKE_PREFIX_PATH)
+ set(CMAKE_PREFIX_PATH "${DEPENDS_PATH}")
+ else()
+ file(TO_CMAKE_PATH "${CMAKE_PREFIX_PATH}" CMAKE_PREFIX_PATH)
+ list(APPEND CMAKE_PREFIX_PATH "${DEPENDS_PATH}")
+ endif()
endif()
if(NOT CMAKE_INSTALL_PREFIX)
@@ -56,14 +58,16 @@ if(CMAKE_TOOLCHAIN_FILE)
MESSAGE(${BUILD_ARGS})
endif()
-# copy the xbmc-prepare-env.cmake script to the depends path so that we can include it
-file(COPY ${XBMCROOT}/project/cmake/scripts/common/xbmc-prepare-env.cmake DESTINATION ${DEPENDS_PATH}/lib/xbmc)
+if(NOT WIN32)
+ # copy the xbmc-prepare-env.cmake script to the depends path so that we can include it
+ file(COPY ${XBMCROOT}/project/cmake/scripts/common/xbmc-prepare-env.cmake DESTINATION ${DEPENDS_PATH}/lib/xbmc)
-# add the location of xbmc-prepare-env.cmake to CMAKE_MODULE_PATH so that it is found
-list(APPEND CMAKE_MODULE_PATH ${DEPENDS_PATH}/lib/xbmc)
+ # add the location of xbmc-prepare-env.cmake to CMAKE_MODULE_PATH so that it is found
+ list(APPEND CMAKE_MODULE_PATH ${DEPENDS_PATH}/lib/xbmc)
-# include xbmc-prepare-env.cmake which contains the logic to install the addon header bindings etc
-include(xbmc-prepare-env)
+ # include xbmc-prepare-env.cmake which contains the logic to install the addon header bindings etc
+ include(xbmc-prepare-env)
+endif()
### get and build all the binary addons
# look for all the addons to be built
diff --git a/project/cmake/addons/depends/common/xbmc/CMakeLists.txt b/project/cmake/addons/depends/common/xbmc/CMakeLists.txt
deleted file mode 100644
index a3d66fde3a..0000000000
--- a/project/cmake/addons/depends/common/xbmc/CMakeLists.txt
+++ /dev/null
@@ -1,65 +0,0 @@
-project(xbmc)
-
-cmake_minimum_required(VERSION 2.8)
-
-### setup all the necessary paths
-if(NOT XBMCROOT)
- set(XBMCROOT ${PROJECT_SOURCE_DIR}/../../../../../..)
-else()
- file(TO_CMAKE_PATH "${XBMCROOT}" XBMCROOT)
-endif()
-get_filename_component(XBMCROOT "${XBMCROOT}" ABSOLUTE)
-
-if(NOT CMAKE_INSTALL_PREFIX)
- message(FATAL_ERROR "CMAKE_INSTALL_PREFIX (${CMAKE_INSTALL_PREFIX}) is not a valid target directory.")
-else()
- file(TO_CMAKE_PATH "${CMAKE_INSTALL_PREFIX}" CMAKE_INSTALL_PREFIX)
-endif()
-get_filename_component(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" ABSOLUTE)
-
-# xbmc-config.cmake.in (further down) expects a "prefix" variable
-get_filename_component(prefix "${CMAKE_INSTALL_PREFIX}" ABSOLUTE)
-
-# parse version.txt to get the version info
-if(EXISTS "${XBMCROOT}/version.txt")
- file(STRINGS "${XBMCROOT}/version.txt" versions)
- foreach (version ${versions})
- string(REGEX MATCH "^[^ ]+" version_name ${version})
- string(REPLACE "${version_name} " "" version_value ${version})
- set(APP_${version_name} "${version_value}")
- endforeach()
-endif()
-
-# bail if we can't parse versions
-if(NOT DEFINED APP_VERSION_MAJOR OR NOT DEFINED APP_VERSION_MINOR)
- message(FATAL_ERROR "Could not determine app version! make sure that ${XBMCROOT}/version.txt exists")
-endif()
-
-### copy all the addon binding header files to include/xbmc
-# make sure include/xbmc exists and is empty
-set(XBMC_LIB_DIR ${CMAKE_INSTALL_PREFIX}/lib/xbmc)
-if(NOT EXISTS "${XBMC_LIB_DIR}/")
- file(MAKE_DIRECTORY ${XBMC_LIB_DIR})
-endif()
-
-set(XBMC_INCLUDE_DIR ${CMAKE_INSTALL_PREFIX}/include/xbmc)
-if(NOT EXISTS "${XBMC_INCLUDE_DIR}/")
- file(MAKE_DIRECTORY ${XBMC_INCLUDE_DIR})
-endif()
-
-# generate the proper xbmc-config.cmake file
-configure_file(${XBMCROOT}/project/cmake/xbmc-config.cmake.in ${XBMC_LIB_DIR}/xbmc-config.cmake @ONLY)
-# copy cmake helpers to lib/xbmc
-file(COPY ${XBMCROOT}/project/cmake/xbmc-addon-helpers.cmake ${XBMCROOT}/project/cmake/AddOptions.cmake DESTINATION ${XBMC_LIB_DIR})
-
-### copy all the addon binding header files to include/xbmc
-# parse addon-bindings.mk to get the list of header files to copy
-file(STRINGS ${XBMCROOT}/xbmc/addons/addon-bindings.mk bindings)
-string(REPLACE "\n" ";" bindings "${bindings}")
-foreach(binding ${bindings})
- string(REPLACE " =" ";" binding "${binding}")
- string(REPLACE "+=" ";" binding "${binding}")
- list(GET binding 1 header)
- # copy the header file to include/xbmc
- file(COPY ${XBMCROOT}/${header} DESTINATION ${XBMC_INCLUDE_DIR})
-endforeach()
diff --git a/project/cmake/addons/depends/windows/cmake/xbmc/CMakeLists.txt b/project/cmake/addons/depends/windows/cmake/xbmc/CMakeLists.txt
new file mode 100644
index 0000000000..57d8a93065
--- /dev/null
+++ b/project/cmake/addons/depends/windows/cmake/xbmc/CMakeLists.txt
@@ -0,0 +1,31 @@
+project(xbmc)
+
+cmake_minimum_required(VERSION 2.8)
+
+list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR})
+list(APPEND CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR})
+
+### setup all the necessary paths
+if(NOT XBMCROOT)
+ set(XBMCROOT ${PROJECT_SOURCE_DIR}/../../../../../../..)
+else()
+ file(TO_CMAKE_PATH "${XBMCROOT}" XBMCROOT)
+endif()
+get_filename_component(XBMCROOT "${XBMCROOT}" ABSOLUTE)
+
+if(NOT CMAKE_INSTALL_PREFIX)
+ message(FATAL_ERROR "CMAKE_INSTALL_PREFIX (${CMAKE_INSTALL_PREFIX}) is not a valid target directory.")
+else()
+ file(TO_CMAKE_PATH "${CMAKE_INSTALL_PREFIX}" CMAKE_INSTALL_PREFIX)
+endif()
+get_filename_component(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" ABSOLUTE)
+
+### prepare the environment
+# set the DEPENDS_PATH variable used by xbmc-prepare-env
+set(DEPENDS_PATH "${CMAKE_INSTALL_PREFIX}")
+
+# copy the xbmc-prepare-env.cmake script so that we can include it
+file(COPY ${XBMCROOT}/project/cmake/scripts/common/xbmc-prepare-env.cmake DESTINATION ${CMAKE_BINARY_DIR})
+
+# include xbmc-prepare-env.cmake which contains the logic to install the addon header bindings etc
+include(xbmc-prepare-env) \ No newline at end of file
diff --git a/project/cmake/addons/depends/common/xbmc/noinstall.txt b/project/cmake/addons/depends/windows/cmake/xbmc/noinstall.txt
index e69de29bb2..e69de29bb2 100644
--- a/project/cmake/addons/depends/common/xbmc/noinstall.txt
+++ b/project/cmake/addons/depends/windows/cmake/xbmc/noinstall.txt
diff --git a/project/cmake/addons/depends/common/xbmc/xbmc.txt b/project/cmake/addons/depends/windows/cmake/xbmc/xbmc.txt
index 0d53f64477..0d53f64477 100644
--- a/project/cmake/addons/depends/common/xbmc/xbmc.txt
+++ b/project/cmake/addons/depends/windows/cmake/xbmc/xbmc.txt