From a807358b5df136a74545cf358baeeccc73ef2902 Mon Sep 17 00:00:00 2001 From: Vincent Payet Date: Thu, 19 Dec 2024 17:16:20 +0100 Subject: [PATCH] add a main --- src/solver/modeler/CMakeLists.txt | 60 +++++++++++++++++++++++++++++++ src/solver/modeler/main.cpp | 31 ++++++++++++++++ 2 files changed, 91 insertions(+) create mode 100644 src/solver/modeler/main.cpp diff --git a/src/solver/modeler/CMakeLists.txt b/src/solver/modeler/CMakeLists.txt index 334e4c6c60..44178780e0 100644 --- a/src/solver/modeler/CMakeLists.txt +++ b/src/solver/modeler/CMakeLists.txt @@ -2,3 +2,63 @@ add_subdirectory(api) add_subdirectory(ortoolsImpl) add_subdirectory(loadFiles) add_subdirectory(parameters) + + +# +# Resource file for Windows +# +if (WIN32) + file(REMOVE "${CMAKE_CURRENT_SOURCE_DIR}/win32/modeler.o") + FILE(COPY "${CMAKE_CURRENT_SOURCE_DIR}/win32/modeler.ico" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/win32/") + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/win32/modeler.rc.cmake" + "${CMAKE_CURRENT_SOURCE_DIR}/win32/modeler.rc") + + if (MINGW) + # resource compilation for mingw + add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/win32/modeler.o" + COMMAND windres.exe "-I${CMAKE_CURRENT_SOURCE_DIR}" + "-i${CMAKE_CURRENT_SOURCE_DIR}/win32/modeler.rc" + -o "${CMAKE_CURRENT_BINARY_DIR}/win32/modeler.o") + set(SRCS ${SRCS} "${CMAKE_CURRENT_BINARY_DIR}/win32/modeler.o") + else () + set(SRCS ${SRCS} "win32/modeler.rc") + endif () +endif () + +OMESSAGE(" :: modeler") + +set(exec_name "antares-modeler") + +add_library(modeler-lib INTERFACE + ${SRCS} +) + +add_executable(antares-modeler + main.cpp + ${SRCS} +) + +set_target_properties(antares-modeler PROPERTIES OUTPUT_NAME ${exec_name}) + +target_link_libraries(modeler-lib + INTERFACE + Antares::loadModelerFiles + modeler-parameters +) + +target_link_libraries(antares-modeler + PRIVATE + modeler-lib +) + +import_std_libs(antares-modeler) +executable_strip(antares-modeler) + +copy_dependency(sirius_solver antares-modeler) + +install(TARGETS antares-modeler EXPORT antares-modeler DESTINATION bin) + +INSTALL(EXPORT antares-modeler + FILE antares-modelerConfig.cmake + DESTINATION cmake +) diff --git a/src/solver/modeler/main.cpp b/src/solver/modeler/main.cpp new file mode 100644 index 0000000000..5759b59b2f --- /dev/null +++ b/src/solver/modeler/main.cpp @@ -0,0 +1,31 @@ +/* + * Copyright 2007-2024, RTE (https://www.rte-france.com) + * See AUTHORS.txt + * SPDX-License-Identifier: MPL-2.0 + * This file is part of Antares-Simulator, + * Adequacy and Performance assessment for interconnected energy networks. + * + * Antares_Simulator is free software: you can redistribute it and/or modify + * it under the terms of the Mozilla Public Licence 2.0 as published by + * the Mozilla Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * Antares_Simulator is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * Mozilla Public Licence 2.0 for more details. + * + * You should have received a copy of the Mozilla Public Licence 2.0 + * along with Antares_Simulator. If not, see . + */ + +#include + +#include +#include + +int main(int argc, const char** argv) +{ + + return 0; +}