Commits

Shlomi Fish committed 31c91b6

Mangling the WML_LIB_DIR better (for great justice!).

  • Participants
  • Parent commits 5a66b80
  • Branches conversion-to-cmake
  • Tags releases/wml-2.1.8

Comments (0)

Files changed (2)

File src/CMakeLists.txt

 # see - http://www.cmake.org/Wiki/CMake_FAQ#Is_there_an_option_to_produce_more_.27verbose.27_compiling.3F
 # SET(CMAKE_VERBOSE_MAKEFILE ON)
 
-SET(VERSION "2.1.7")
+SET(VERSION "2.1.8")
 
 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
 
-STRING(REGEX REPLACE "^\\Q${CMAKE_PREFIX_PATH}\\E/?" "" WML_LIB_DIR_BASE "${LIB_INSTALL_DIR}")
+SET (MYPREFIX "${CMAKE_INSTALL_PREFIX}")
+STRING(LENGTH "${MYPREFIX}" MYPREFIX_LEN)
+STRING(SUBSTRING "${LIB_INSTALL_DIR}" 0 "${MYPREFIX_LEN}" LIB_MYPREFIX)
+
+IF ("${LIB_MYPREFIX}" STREQUAL "${MYPREFIX}")
+    MATH (EXPR START_FROM "${MYPREFIX_LEN} + 1")
+    STRING(SUBSTRING "${LIB_INSTALL_DIR}" "${START_FROM}" -1 WML_LIB_DIR_BASE)
+    # MESSAGE(FATAL_ERROR "WDBASe = ${WML_LIB_DIR_BASE} == ")
+ELSE ("${LIB_MYPREFIX}" STREQUAL "${MYPREFIX}")
+    SET (WML_LIB_DIR_BASE "lib")
+ENDIF ("${LIB_MYPREFIX}" STREQUAL "${MYPREFIX}")
+
 SET (WML_LIB_DIR "${WML_LIB_DIR_BASE}/wml")
 SET (WML_DATA_DIR "${WML_LIB_DIR}/data")
 SET (WML_LIBEXE_DIR "${WML_LIB_DIR}/exec/")

File src/wml_frontend/CMakeLists.txt

 
 FOREACH (cmd wmk wml wmb wmd wmu)
     set_vars()
+    # MESSAGE( FATAL_ERROR "WML_LIB_DIR = ${WML_LIB_DIR}")
     ADD_CUSTOM_COMMAND(
         OUTPUT "${dest}"
         COMMAND "${PERL_EXECUTABLE}"