On Monday, December 12, 2011 06:51:48 PM Raphael Kubo da Costa wrote:
> This will make the headers be installed into
> ${CMAKE_INSTALL_PREFIX}/include/qjson/qjson, so the problem is not going
> away.
>
> If you adjust the patch and do set INCLUDE_INSTALL_DIR to
> ${CMAKE_INSTALL_PREFIX}/include/qjson and install the headers there,
> code which currently uses #include <qjson/foo.h> will break. I'm not
> sure the project has a policy against that, but this would be a
> source-incompatible change.
Opps, my bad, I've attached the fixed patch.
As for being a source incompatible change, that isn't true of most *nix
systems since they have "${CMAKE_INSTALL_PREFIX}/include" as the standard
include dir, I've no idea about how that would be in windows tough, so I'm
also attaching a patch that makes this change not source incompatible by
having the include dir be both "${CMAKE_INSTALL_PREFIX}/include" and
"${CMAKE_INSTALL_PREFIX}/include/qjson". Having more include dirs is not
ideal, but it might a good solution if source compatibility is a concern.
Regards,
Gastaldiff --git a/CMakeLists.txt b/CMakeLists.txt
index efbcaab..0172ec4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -40,7 +40,7 @@ INCLUDE( ${QT_USE_FILE} )
#add extra search paths for libraries and includes
SET (LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" )
SET (LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" CACHE STRING "Directory where lib will install")
-SET (INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "The directory the headers are installed in")
+SET (INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include/qjson" CACHE PATH "The directory the headers are installed in")
SET (CMAKECONFIG_INSTALL_DIR "${LIB_INSTALL_DIR}/cmake/${CMAKE_PROJECT_NAME}" CACHE PATH "Directory where to install QJSONConfig.cmake")
set(QJSON_LIB_MAJOR_VERSION "0")
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index c8b13e4..86607b3 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -12,7 +12,7 @@ install(FILES
serializer.h
serializerrunnable.h
qjson_export.h
- DESTINATION ${INCLUDE_INSTALL_DIR}/qjson COMPONENT Devel
+ DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT Devel
)
set(qjson_MOC_HDRS
diff --git a/QJSONConfig.cmake.in b/QJSONConfig.cmake.in
index def072c..59f49d7 100644
--- a/QJSONConfig.cmake.in
+++ b/QJSONConfig.cmake.in
@@ -1,6 +1,6 @@
GET_FILENAME_COMPONENT(myDir ${CMAKE_CURRENT_LIST_FILE} PATH)
SET(QJSON_LIBRARIES qjson)
-SET(QJSON_INCLUDE_DIR "@INCLUDE_INSTALL_DIR@")
+SET(QJSON_INCLUDE_DIR "@INCLUDE_INSTALL_DIR@ @INCLUDE_INSTALL_DIR@/qjson")
include(${myDir}/QJSONTargets.cmake)
diff --git a/QJson.pc.in b/QJson.pc.in
index e4704bd..a00114d 100644
--- a/QJson.pc.in
+++ b/QJson.pc.in
@@ -8,4 +8,4 @@ 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: QtCore
Libs: -L${libdir} -lqjson
-Cflags: -I${includedir}
\ No newline at end of file
+Cflags: -I${includedir} -I${includedir}/qjson
------------------------------------------------------------------------------
Systems Optimization Self Assessment
Improve efficiency and utilization of IT resources. Drive out cost and
improve service delivery. Take 5 minutes to use this Systems Optimization
Self Assessment. http://www.accelacomm.com/jaw/sdnl/114/51450054/
_______________________________________________
QJson-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qjson-devel