:-'Generic Commit'
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(ipdemo VERSION 1.0.0 LANGUAGES CXX)
|
||||
set(PROJECT_EXE_NAME ipdemo)
|
||||
project(${PROJECT_EXE_NAME} VERSION 1.0.0 LANGUAGES CXX)
|
||||
|
||||
# Force static linking globally
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
|
||||
@ -54,12 +55,12 @@ add_custom_target(run_prebuild_script ALL
|
||||
)
|
||||
|
||||
# Add executable
|
||||
add_executable(ipdemo ${SOURCES})
|
||||
add_dependencies(ipdemo run_prebuild_script)
|
||||
add_executable(${PROJECT_EXE_NAME} ${SOURCES})
|
||||
add_dependencies(${PROJECT_EXE_NAME} run_prebuild_script)
|
||||
|
||||
# Set include directories
|
||||
# build dir goes first so that we can use the generated version.hpp
|
||||
target_include_directories(ipdemo PRIVATE
|
||||
target_include_directories(${PROJECT_EXE_NAME} PRIVATE
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/src/autogen>
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
@ -90,19 +91,19 @@ FetchContent_Declare(
|
||||
FetchContent_MakeAvailable(nlohmann_json)
|
||||
|
||||
# Link libraries
|
||||
target_link_libraries(ipdemo PRIVATE
|
||||
target_link_libraries(${PROJECT_EXE_NAME} PRIVATE
|
||||
libassert::assert
|
||||
cpptrace::cpptrace
|
||||
nlohmann_json::nlohmann_json
|
||||
)
|
||||
|
||||
# Set static linking flags
|
||||
set_target_properties(ipdemo PROPERTIES
|
||||
set_target_properties(${PROJECT_EXE_NAME} PROPERTIES
|
||||
LINK_FLAGS "-static"
|
||||
)
|
||||
|
||||
# Install targets
|
||||
install(TARGETS ipdemo
|
||||
install(TARGETS ${PROJECT_EXE_NAME}
|
||||
RUNTIME DESTINATION $ENV{HOME}/.local/bin
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user