actsim-cluster-agent/CMakeLists.txt

102 lines
No EOL
2.8 KiB
CMake

#
# This file is part of the ACT library
#
# Copyright (c) 2023 Fabian Posch
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program 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
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
#
cmake_minimum_required(VERSION 3.15)
project(
actsim-cluster-agent
VERSION 0.0.1
DESCRIPTION "A cluster agent for the actsim simulator."
)
# Set the program version
add_compile_definitions(PROG_VERSION="0.0.1")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
add_compile_options(-Wall
-Wextra
-Wconversion-null
-Wmissing-declarations
-Woverlength-strings)
add_compile_options(
-Wpointer-arith
-Wunused-local-typedefs
-Wunused-result
-Wvarargs
-Wvla
-Wwrite-strings
-Wformat-security
-Wundef)
add_compile_options(-O2 -fPIC)
include_directories(./)
# Include shared act libraries
# We need this mostly for file elaboration ahead of cluster deployment
#add_library(ActLib SHARED IMPORTED)
#set_target_properties(ActLib PROPERTIES IMPORTED_LOCATION $ENV{ACT_HOME}/lib/libact.a)
#add_library(ActCommon SHARED IMPORTED)
#set_target_properties(ActCommon PROPERTIES IMPORTED_LOCATION $ENV{ACT_HOME}/lib/libvlsilib.a)
# Include the cluster librar
add_library(act-cluster-lib SHARED IMPORTED)
set_target_properties(act-cluster-lib PROPERTIES IMPORTED_LOCATION $ENV{ACT_HOME}/lib/libact_cluster.so)
# ATTENTION
# The main executable is defined in the CMakeLists.txt in the ./src folder.
# Set the output directory of static libraries (we don't need that)
#set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib)
# Set the output directory of executables
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)
set(CMAKE_INSTALL_PREFIX $ENV{ACT_HOME} CACHE PATH "installation path" FORCE)
add_subdirectory(src)
# Link the needed libraries into it
target_link_libraries(
${PROJECT_NAME}
act-cluster-lib
actsim-agent-lib
)
# Add the Postgresql library
target_link_libraries(
${PROJECT_NAME}
-lpqxx -lpq
)
# specify install targets
install(
TARGETS actsim-cluster-agent
DESTINATION bin
)
# We don't provide a library
#install(
# TARGETS dflowchp
# DESTINATION lib
#)