changeset 571:ec2c2411d4db laaw

versioning
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 25 Sep 2013 15:03:24 +0200
parents 86c5bb651bfa
children e5eaef9cad80
files CMakeLists.txt OrthancCppClient/Package/AUTOGENERATED/ExternC.cpp OrthancCppClient/Package/AUTOGENERATED/OrthancCppClient.h OrthancCppClient/Package/AUTOGENERATED/Windows32.rc OrthancCppClient/Package/AUTOGENERATED/Windows64.rc OrthancCppClient/Package/Product.json OrthancCppClient/Package/Test.sh Resources/CMake/Compiler.cmake Resources/MinGW64Toolchain.cmake Resources/MinGWToolchain.cmake
diffstat 10 files changed, 99 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/CMakeLists.txt	Wed Sep 25 14:01:01 2013 +0200
+++ b/CMakeLists.txt	Wed Sep 25 15:03:24 2013 +0200
@@ -283,6 +283,16 @@
       # Nothing to do if using Visual Studio
     endif()
 
+    if (${CMAKE_SIZEOF_VOID_P} EQUAL 4)
+      set(CMAKE_SHARED_LIBRARY_SUFFIX "_Windows32.dll")
+      list(APPEND ORTHANC_CPP_CLIENT_AUX ${ORTHANC_ROOT}/OrthancCppClient/Package/AUTOGENERATED/Windows32.rc)
+    elseif (${CMAKE_SIZEOF_VOID_P} EQUAL 8)
+      set(CMAKE_SHARED_LIBRARY_SUFFIX "_Windows64.dll")
+      list(APPEND ORTHANC_CPP_CLIENT_AUX ${ORTHANC_ROOT}/OrthancCppClient/Package/AUTOGENERATED/Windows64.rc)
+    else()
+      message(FATAL_ERROR "Support your platform here")
+    endif()    
+
   else()
     set(ORTHANC_CPP_CLIENT_AUX ${OPENSSL_SOURCES})
   endif()
@@ -331,8 +341,8 @@
 
   install(
     TARGETS OrthancClient
-    RUNTIME DESTINATION lib
-    LIBRARY DESTINATION lib
+    RUNTIME DESTINATION lib    # Destination for Windows
+    LIBRARY DESTINATION lib    # Destination for Linux
     )
 
   install(
--- a/OrthancCppClient/Package/AUTOGENERATED/ExternC.cpp	Wed Sep 25 14:01:01 2013 +0200
+++ b/OrthancCppClient/Package/AUTOGENERATED/ExternC.cpp	Wed Sep 25 15:03:24 2013 +0200
@@ -1430,22 +1430,22 @@
 
   LAAW_EXPORT_DLL_API const char* LAAW_CALL_CONVENTION LAAW_EXTERNC_GetCopyright()
   {
-    return "(c) 2012-2013 CHU of Liege";
+    return "(c) 2012-2013, Sebastien Jodogne, CHU of Liege";
   }
 
   LAAW_EXPORT_DLL_API const char* LAAW_CALL_CONVENTION LAAW_EXTERNC_GetVersion()
   {
-    return "1.0";
+    return "0.6";
   }
 
   LAAW_EXPORT_DLL_API const char* LAAW_CALL_CONVENTION LAAW_EXTERNC_GetFileVersion()
   {
-    return "1.0.0.1";
+    return "0.6.0.1";
   }
 
   LAAW_EXPORT_DLL_API const char* LAAW_CALL_CONVENTION LAAW_EXTERNC_GetFullVersion()
   {
-    return "1.0.1";
+    return "0.6.1";
   }
 
   LAAW_EXPORT_DLL_API void LAAW_CALL_CONVENTION LAAW_EXTERNC_FreeString(char* str)
--- a/OrthancCppClient/Package/AUTOGENERATED/OrthancCppClient.h	Wed Sep 25 14:01:01 2013 +0200
+++ b/OrthancCppClient/Package/AUTOGENERATED/OrthancCppClient.h	Wed Sep 25 15:03:24 2013 +0200
@@ -81,9 +81,9 @@
 
 /* cf. http://sourceforge.net/p/predef/wiki/Architectures/ */
 #ifdef __amd64__
-#define LAAW_ORTHANC_CLIENT_DEFAULT_PATH  "libOrthancClient_Linux64.so.1.0"
+#define LAAW_ORTHANC_CLIENT_DEFAULT_PATH  "libOrthancClient.so.0.6"
 #else
-#define LAAW_ORTHANC_CLIENT_DEFAULT_PATH  "libOrthancClient_Linux32.so.1.0"
+#define LAAW_ORTHANC_CLIENT_DEFAULT_PATH  "libOrthancClient.so.0.6"
 #endif
 
 #define LAAW_ORTHANC_CLIENT_CALL_CONV
@@ -381,7 +381,7 @@
    * It is assumed that the API does not change when the revision
    * number (MAJOR.MINOR.REVISION) changes.
    **/
-  if (strcmp(getVersion(), "1.0"))
+  if (strcmp(getVersion(), "0.6"))
   {
     throw ::OrthancClient::OrthancClientException("Mismatch between the C++ header and the library version");
   }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/OrthancCppClient/Package/AUTOGENERATED/Windows32.rc	Wed Sep 25 15:03:24 2013 +0200
@@ -0,0 +1,30 @@
+#include <winver.h>
+
+VS_VERSION_INFO VERSIONINFO
+   FILEVERSION 0,6,0,1
+   PRODUCTVERSION 0,6,0,0
+   FILEOS VOS_NT_WINDOWS32
+   FILETYPE VFT_DLL
+   BEGIN
+      BLOCK "StringFileInfo"
+      BEGIN
+         BLOCK "040904E4"
+         BEGIN
+            VALUE "Comments", "Release 0.6.1"
+            VALUE "CompanyName", "CHU of Liege"
+            VALUE "FileDescription", "Native client to the REST API of Orthanc"
+            VALUE "FileVersion", "0.6.0.1"
+            VALUE "InternalName", "OrthancClient"
+            VALUE "LegalCopyright", "(c) 2012-2013, Sebastien Jodogne, CHU of Liege"
+            VALUE "LegalTrademarks", "Licensing information is available on https://code.google.com/p/orthanc/"
+            VALUE "OriginalFilename", "OrthancClient_Windows32.dll"
+            VALUE "ProductName", "OrthancClient"
+            VALUE "ProductVersion", "0.6"
+         END
+      END
+
+      BLOCK "VarFileInfo"
+      BEGIN
+        VALUE "Translation", 0x409, 1252  // U.S. English
+      END
+   END
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/OrthancCppClient/Package/AUTOGENERATED/Windows64.rc	Wed Sep 25 15:03:24 2013 +0200
@@ -0,0 +1,30 @@
+#include <winver.h>
+
+VS_VERSION_INFO VERSIONINFO
+   FILEVERSION 0,6,0,1
+   PRODUCTVERSION 0,6,0,0
+   FILEOS VOS_NT_WINDOWS32
+   FILETYPE VFT_DLL
+   BEGIN
+      BLOCK "StringFileInfo"
+      BEGIN
+         BLOCK "040904E4"
+         BEGIN
+            VALUE "Comments", "Release 0.6.1"
+            VALUE "CompanyName", "CHU of Liege"
+            VALUE "FileDescription", "Native client to the REST API of Orthanc"
+            VALUE "FileVersion", "0.6.0.1"
+            VALUE "InternalName", "OrthancClient"
+            VALUE "LegalCopyright", "(c) 2012-2013, Sebastien Jodogne, CHU of Liege"
+            VALUE "LegalTrademarks", "Licensing information is available on https://code.google.com/p/orthanc/"
+            VALUE "OriginalFilename", "OrthancClient_Windows64.dll"
+            VALUE "ProductName", "OrthancClient"
+            VALUE "ProductVersion", "0.6"
+         END
+      END
+
+      BLOCK "VarFileInfo"
+      BEGIN
+        VALUE "Translation", 0x409, 1252  // U.S. English
+      END
+   END
--- a/OrthancCppClient/Package/Product.json	Wed Sep 25 14:01:01 2013 +0200
+++ b/OrthancCppClient/Package/Product.json	Wed Sep 25 15:03:24 2013 +0200
@@ -2,7 +2,7 @@
   "Product" : "OrthancClient",
   "Description" : "Native client to the REST API of Orthanc",
   "Company" : "CHU of Liege",
-  "Copyright" : "(c) 2012-2013 CHU of Liege",
+  "Copyright" : "(c) 2012-2013, Sebastien Jodogne, CHU of Liege",
   "Legal" : "Licensing information is available on https://code.google.com/p/orthanc/",
-  "Version" : "1.0.1"
+  "Version" : "0.6.1"
 }
--- a/OrthancCppClient/Package/Test.sh	Wed Sep 25 14:01:01 2013 +0200
+++ b/OrthancCppClient/Package/Test.sh	Wed Sep 25 15:03:24 2013 +0200
@@ -11,3 +11,5 @@
 python ${LAAW_ROOT}/Generators/GenerateExternC.py AUTOGENERATED/ExternC.cpp AUTOGENERATED/CodeModel.json Product.json
 python ${LAAW_ROOT}/Generators/GenerateWindows32Def.py AUTOGENERATED/Windows32.def AUTOGENERATED/CodeModel.json
 python ${LAAW_ROOT}/Generators/GenerateWindows64Def.py AUTOGENERATED/Windows64.def AUTOGENERATED/CodeModel.json
+python ${LAAW_ROOT}/Generators/ApplyProductSubstitutions.py AUTOGENERATED/Windows32.rc ${LAAW_ROOT}/Resources/DllResources.rc.mustache Product.json PLATFORM_SUFFIX "_Windows32"
+python ${LAAW_ROOT}/Generators/ApplyProductSubstitutions.py AUTOGENERATED/Windows64.rc ${LAAW_ROOT}/Resources/DllResources.rc.mustache Product.json PLATFORM_SUFFIX "_Windows64"
--- a/Resources/CMake/Compiler.cmake	Wed Sep 25 14:01:01 2013 +0200
+++ b/Resources/CMake/Compiler.cmake	Wed Sep 25 15:03:24 2013 +0200
@@ -5,6 +5,12 @@
   # --std=c99 makes libcurl not to compile
   # -pedantic gives a lot of warnings on OpenSSL 
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -Wno-long-long -Wno-variadic-macros")
+
+  if (CMAKE_CROSSCOMPILING)
+    # http://stackoverflow.com/a/3543845/881731
+    set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff -I<CMAKE_CURRENT_SOURCE_DIR> <SOURCE> <OBJECT>")
+  endif()
+
 elseif (${MSVC})
   # Use static runtime under Visual Studio
   # http://www.cmake.org/Wiki/CMake_FAQ#Dynamic_Replace
--- a/Resources/MinGW64Toolchain.cmake	Wed Sep 25 14:01:01 2013 +0200
+++ b/Resources/MinGW64Toolchain.cmake	Wed Sep 25 15:03:24 2013 +0200
@@ -1,7 +1,7 @@
 # http://sourceforge.net/apps/trac/mingw-w64/wiki/GeneralUsageInstructions
 
 # the name of the target operating system
-SET(CMAKE_SYSTEM_NAME Windows)
+set(CMAKE_SYSTEM_NAME Windows)
 
 # Detect the prefix of the mingw-w64 compiler
 execute_process(
@@ -17,12 +17,12 @@
 endif()
   
 # which compilers to use for C and C++
-SET(CMAKE_C_COMPILER ${MINGW64_PREFIX}-w64-mingw32-gcc)
-SET(CMAKE_CXX_COMPILER ${MINGW64_PREFIX}-w64-mingw32-g++)
-SET(CMAKE_RC_COMPILER ${MINGW64_PREFIX}-w64-mingw32-windres)
+set(CMAKE_C_COMPILER ${MINGW64_PREFIX}-w64-mingw32-gcc)
+set(CMAKE_CXX_COMPILER ${MINGW64_PREFIX}-w64-mingw32-g++)
+set(CMAKE_RC_COMPILER ${MINGW64_PREFIX}-w64-mingw32-windres)
 
 # here is the target environment located
-SET(CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32)
+set(CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32)
 
 # adjust the default behaviour of the FIND_XXX() commands:
 # search headers and libraries in the target environment, search 
@@ -30,5 +30,3 @@
 set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
 set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
 set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
-
-SET(CMAKE_RC_COMPILE_OBJECT "${CMAKE_RC_COMPILER} -O coff -I${CMAKE_CURRENT_SOURCE_DIR} <SOURCE> <OBJECT>")
--- a/Resources/MinGWToolchain.cmake	Wed Sep 25 14:01:01 2013 +0200
+++ b/Resources/MinGWToolchain.cmake	Wed Sep 25 15:03:24 2013 +0200
@@ -1,15 +1,15 @@
 # http://www.vtk.org/Wiki/CmakeMingw
 
 # the name of the target operating system
-SET(CMAKE_SYSTEM_NAME Windows)
+set(CMAKE_SYSTEM_NAME Windows)
 
 # which compilers to use for C and C++
-SET(CMAKE_C_COMPILER i586-mingw32msvc-gcc)
-SET(CMAKE_CXX_COMPILER i586-mingw32msvc-g++)
-SET(CMAKE_RC_COMPILER i586-mingw32msvc-windres)
+set(CMAKE_C_COMPILER i586-mingw32msvc-gcc)
+set(CMAKE_CXX_COMPILER i586-mingw32msvc-g++)
+set(CMAKE_RC_COMPILER i586-mingw32msvc-windres)
 
 # here is the target environment located
-SET(CMAKE_FIND_ROOT_PATH /usr/i586-mingw32msvc)
+set(CMAKE_FIND_ROOT_PATH /usr/i586-mingw32msvc)
 
 # adjust the default behaviour of the FIND_XXX() commands:
 # search headers and libraries in the target environment, search