You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
68 lines
2.4 KiB
68 lines
2.4 KiB
This file is part of MXE. See LICENSE.md for licensing information.
|
|
|
|
Contains ad hoc patches for cross building.
|
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Tony Theodore <tonyt@logyst.com>
|
|
Date: Sat, 24 Feb 2018 15:54:48 +1100
|
|
Subject: [PATCH 1/1] fixes
|
|
|
|
|
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
index 1111111..2222222 100755
|
|
--- a/CMakeLists.txt
|
|
+++ b/CMakeLists.txt
|
|
@@ -32,6 +32,10 @@ endif (WIN32)
|
|
# BUILD_SHARED_LIBS is cmake variable. Need to change default value.
|
|
option(BUILD_SHARED_LIBS "Build shared library" ON)
|
|
|
|
+if(NOT BUILD_SHARED_LIBS)
|
|
+ set(PC_CFLAGS "-DQJSON_STATIC")
|
|
+endif()
|
|
+
|
|
OPTION(OSX_FRAMEWORK "Build a Mac OS X Framework")
|
|
SET(FRAMEWORK_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/Library/Frameworks"
|
|
CACHE PATH "Where to place qjson.framework if OSX_FRAMEWORK is selected")
|
|
@@ -96,13 +100,13 @@ set(QJSON_LIB_VERSION_STRING "${QJSON_LIB_MAJOR_VERSION}.${QJSON_LIB_MINOR_VERSI
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" )
|
|
|
|
# pkg-config
|
|
-IF (NOT WIN32)
|
|
+IF (MINGW OR NOT WIN32)
|
|
CONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/QJson.pc.in
|
|
${CMAKE_CURRENT_BINARY_DIR}/QJson${QJSON_SUFFIX}.pc
|
|
@ONLY)
|
|
INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/QJson${QJSON_SUFFIX}.pc
|
|
DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
|
|
-ENDIF (NOT WIN32)
|
|
+ENDIF (MINGW OR NOT WIN32)
|
|
|
|
# Subdirs
|
|
ADD_SUBDIRECTORY(src)
|
|
diff --git a/QJson.pc.in b/QJson.pc.in
|
|
index 1111111..2222222 100644
|
|
--- a/QJson.pc.in
|
|
+++ b/QJson.pc.in
|
|
@@ -7,5 +7,5 @@ Name: QJson
|
|
Description: QJson is a qt-based library that maps JSON data to QVariant objects
|
|
Version: @QJSON_LIB_MAJOR_VERSION@.@QJSON_LIB_MINOR_VERSION@.@QJSON_LIB_PATCH_VERSION@
|
|
Requires: @PC_Requires@
|
|
-Libs: -L${libdir} -lqjson
|
|
-Cflags: -I${includedir}
|
|
\ No newline at end of file
|
|
+Libs: -L${libdir} -lqjson@QJSON_SUFFIX@
|
|
+Cflags: -I${includedir} @PC_CFLAGS@
|
|
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
|
|
index 1111111..2222222 100755
|
|
--- a/src/CMakeLists.txt
|
|
+++ b/src/CMakeLists.txt
|
|
@@ -59,7 +59,7 @@ INSTALL(TARGETS qjson${QJSON_SUFFIX} EXPORT qjson-export
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
|
|
ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
|
|
FRAMEWORK DESTINATION ${FRAMEWORK_INSTALL_DIR}
|
|
- PUBLIC_HEADER DESTINATION ${INCLUDE_INSTALL_DIR}/qjson${QJSON_SUFFIX}
|
|
+ PUBLIC_HEADER DESTINATION ${INCLUDE_INSTALL_DIR}/qjson
|
|
)
|
|
|
|
if(MSVC)
|