diff --git a/README.md b/README.md index f935046..a97068e 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ You can specify the directory that will be passed as `nCine_DIR` to game project ncline set -ncine-dir /path/to/nCine-build -If the option is not already specified then it is automatically set after a successful compilation of the engine. +The option is automatically set after each successful compilation or download of the engine. If you need to specify additional CMake arguments when configuring the engine compilation you can use the `-cmake-args ` option: @@ -78,7 +78,7 @@ On Windows you can also pass the `-vs2017` and `-vs2019` to choose between the V If left unspecified the default would be `-vs2019`. If you need to specify a `CMAKE_PREFIX_PATH` when configuring the engine compilation you can use the `-prefix-path ` option. -If the option is not already specified on Linux then it is automatically set after a successful compilation of the libraries. +The option is automatically set after each successful compilation or download of the libraries. #### Android section diff --git a/src/BuildMode.cpp b/src/BuildMode.cpp index 43247a9..d53805b 100644 --- a/src/BuildMode.cpp +++ b/src/BuildMode.cpp @@ -32,14 +32,14 @@ void buildLibraries(CMakeCommand &cmake, const Settings &settings) hasBuilt = cmake.build(buildDir.data()); #if !defined(_WIN32) && !defined(__APPLE__) - if (hasBuilt && config().hasCMakePrefixPath() == false) + if (hasBuilt) // Overwrite `CMAKE_PREFIX_PATH` variable in any case { std::string absolutePath = fs::currentDir(); absolutePath = fs::joinPath(absolutePath, Helpers::nCineExternalDir()); if (fs::isDirectory(absolutePath.data())) { - config().setCMakePrefixPath(absolutePath.data()); + config().setCMakePrefixPath(absolutePath); config().save(); Helpers::info("Set 'CMAKE_PREFIX_PATH' CMake variable to: ", absolutePath.data()); } @@ -75,13 +75,13 @@ void buildEngine(CMakeCommand &cmake, const Settings &settings) else hasBuilt = cmake.build(buildDir.data()); - if (hasBuilt && config().hasEngineDir() == false) + if (hasBuilt) // Overwrite `nCine_DIR` variable in any case { std::string absolutePath = fs::currentDir(); absolutePath = fs::joinPath(absolutePath, buildDir); if (fs::isDirectory(absolutePath.data())) { - config().setEngineDir(absolutePath.data()); + config().setEngineDir(absolutePath); config().save(); Helpers::info("Set 'nCine_DIR' CMake variable to: ", absolutePath.data()); } diff --git a/src/DownloadMode.cpp b/src/DownloadMode.cpp index 6526372..1571970 100644 --- a/src/DownloadMode.cpp +++ b/src/DownloadMode.cpp @@ -190,19 +190,18 @@ void downloadLibrariesArtifact(GitCommand &git, CMakeCommand &cmake) const bool hasExtracted = extractArchiveAndDeleteDir(cmake, archiveFile.data(), Helpers::nCineLibrariesArtifactsSourceDir()); #if !defined(__APPLE__) - if (config().platform() == Configuration::Platform::DESKTOP && - hasExtracted && config().hasCMakePrefixPath() == false + if (config().platform() == Configuration::Platform::DESKTOP && hasExtracted #if defined(_WIN32) && config().withMinGW() #endif - ) + ) // Overwrite `CMAKE_PREFIX_PATH` variable in any case { std::string absolutePath = fs::currentDir(); absolutePath = fs::joinPath(absolutePath, Helpers::nCineExternalDir()); if (fs::isDirectory(absolutePath.data())) { - config().setCMakePrefixPath(absolutePath.data()); + config().setCMakePrefixPath(absolutePath); config().save(); Helpers::info("Set 'CMAKE_PREFIX_PATH' CMake variable to: ", absolutePath.data()); } @@ -323,7 +322,7 @@ void downloadEngineArtifact(GitCommand &git, CMakeCommand &cmake) else hasExtracted = extractEngineArchive(git, cmake, archiveFile); - if (hasExtracted && config().hasEngineDir() == false) + if (hasExtracted) // Overwrite `nCine_DIR` variable in any case { std::string absolutePath = fs::currentDir(); #ifdef _WIN32 @@ -359,7 +358,7 @@ void downloadEngineArtifact(GitCommand &git, CMakeCommand &cmake) if (fs::isDirectory(absolutePath.data())) { - config().setEngineDir(absolutePath.data()); + config().setEngineDir(absolutePath); config().save(); Helpers::info("Set 'nCine_DIR' CMake variable to: ", absolutePath.data()); }