# HG changeset patch # User Sebastien Jodogne # Date 1343117832 -7200 # Node ID e85455ff60390acfb1f5be68fe0c443eeded19fc # Parent f3551378e8f3841d5c7ad2e4041c3540c616e92e standalon diff -r f3551378e8f3 -r e85455ff6039 CMakeLists.txt --- a/CMakeLists.txt Tue Jul 24 10:03:17 2012 +0200 +++ b/CMakeLists.txt Tue Jul 24 10:17:12 2012 +0200 @@ -6,9 +6,13 @@ include(CheckIncludeFiles) SET(STATIC_BUILD ON CACHE BOOL "Static build of the third-party libraries (necessary for Windows)") -SET(RELEASE_BUILD OFF CACHE BOOL "Release build") +SET(STANDALONE_BUILD OFF CACHE BOOL "Standalone build (necessary for cross-compilation or binary releases)") -if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") +if (${CMAKE_CROSSCOMPILING}) + SET(STANDALONE_BUILD ON) +endif() + +if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") CHECK_INCLUDE_FILES(rpc.h HAVE_UUID_H) else() CHECK_INCLUDE_FILES(uuid/uuid.h HAVE_UUID_H) @@ -85,9 +89,9 @@ add_definitions(-DPALANTIR_STATIC=0) endif() -if (${RELEASE_BUILD}) +if (${STANDALONE_BUILD}) add_definitions( - -DPALANTIR_RELEASE=1 + -DPALANTIR_STANDALONE=1 ) EmbedResources( @@ -97,7 +101,7 @@ else() add_definitions( - -DPALANTIR_RELEASE=0 + -DPALANTIR_STANDALONE=0 -DPALANTIR_PATH=\"${CMAKE_SOURCE_DIR}\" ) diff -r f3551378e8f3 -r e85455ff6039 NEWS --- a/NEWS Tue Jul 24 10:03:17 2012 +0200 +++ b/NEWS Tue Jul 24 10:17:12 2012 +0200 @@ -2,6 +2,7 @@ =============== * Licensing of the "Core/SQLite" folder +* Standalone build for cross-compilation Version 0.1.1 (2012/07/20) diff -r f3551378e8f3 -r e85455ff6039 PalantirServer/PalantirInitialization.cpp --- a/PalantirServer/PalantirInitialization.cpp Tue Jul 24 10:03:17 2012 +0200 +++ b/PalantirServer/PalantirInitialization.cpp Tue Jul 24 10:17:12 2012 +0200 @@ -48,14 +48,22 @@ } else { -#if PALANTIR_RELEASE == 0 - boost::filesystem::path p = PALANTIR_PATH; - p /= "Resources"; - p /= CONFIGURATION_FILE; - Toolbox::ReadFile(content, p.string()); + try + { +#if PALANTIR_STANDALONE == 0 + boost::filesystem::path p = PALANTIR_PATH; + p /= "Resources"; + p /= CONFIGURATION_FILE; + Toolbox::ReadFile(content, p.string()); #else - Toolbox::ReadFile(content, CONFIGURATION_FILE); + Toolbox::ReadFile(content, CONFIGURATION_FILE); #endif + } + catch (PalantirException&) + { + // No configuration file found, give up with empty configuration + return; + } } Json::Reader reader; diff -r f3551378e8f3 -r e85455ff6039 PalantirServer/main.cpp --- a/PalantirServer/main.cpp Tue Jul 24 10:03:17 2012 +0200 +++ b/PalantirServer/main.cpp Tue Jul 24 10:17:12 2012 +0200 @@ -107,7 +107,7 @@ try { - std::string storageDirectory = GetGlobalStringParameter("StorageDirectory", "PalantirStorage"); + std::string storageDirectory = GetGlobalStringParameter("StorageDirectory", "PalantirStorage"); ServerIndex index(storageDirectory); MyDicomStoreFactory storeScp(index, storageDirectory); @@ -123,7 +123,7 @@ MongooseServer httpServer; httpServer.SetPort(GetGlobalIntegerParameter("HttpPort", 8000)); -#if PALANTIR_RELEASE == 1 +#if PALANTIR_STANDALONE == 1 httpServer.RegisterHandler(new EmbeddedResourceHttpHandler("/app", EmbeddedResources::PALANTIR_EXPLORER)); #else httpServer.RegisterHandler(new FilesystemHttpHandler("/app", PALANTIR_PATH "/PalantirExplorer"));