--- GPTifier/CMakeLists.txt 2025-06-16 16:03:47.000000000 +0800 +++ GPTifier/CMakeLists.txt 2025-06-19 01:20:47.000000000 +0800 @@ -10,7 +10,6 @@ set(CMAKE_CXX_STANDARD 17) set(CMAKE_BUILD_TYPE RelWithDebInfo) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) -set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/.local/bin") string(TIMESTAMP BUILD_DATE) @@ -27,7 +26,6 @@ endif() include_directories( - external src src/commands src/networking @@ -78,15 +76,7 @@ message(STATUS "Checking for nlohmann/json.hpp") if(USE_SYSTEM_NLOHMANN_JSON) - # i.e. specified by user as: - # `cmake -DUSE_SYSTEM_NLOHMANN_JSON=ON -DNLOHMANN_JSON_HPP=/path/to/json.hpp ` - set(NLOHMANN_JSON_HPP "" CACHE FILEPATH "Path to nlohmann/json.hpp") - if(EXISTS ${NLOHMANN_JSON_HPP}) - message(STATUS "Copying ${NLOHMANN_JSON_HPP} -> ${CMAKE_SOURCE_DIR}/external") - file(COPY ${NLOHMANN_JSON_HPP} DESTINATION "${CMAKE_SOURCE_DIR}/external") - else() - message(FATAL_ERROR "The file '${NLOHMANN_JSON_HPP}' does not exist!") - endif() + # Assume cppflags are passed to CMake. else() set(NLOHMANN_JSON_HPP_DL "${CMAKE_SOURCE_DIR}/external/json.hpp") if(EXISTS ${NLOHMANN_JSON_HPP_DL}) @@ -106,15 +96,7 @@ message(STATUS "Checking for toml++ header file") if(USE_SYSTEM_TOMLPLUSPLUS) - # i.e. specified by user as: - # `cmake -DUSE_SYSTEM_TOMLPLUSPLUS=ON -DTOMLPLUSPLUS_HPP=/path/to/toml.hpp ` - set(TOMLPLUSPLUS_HPP "" CACHE FILEPATH "Path to toml.hpp") - if(EXISTS ${TOMLPLUSPLUS_HPP}) - message(STATUS "Copying ${TOMLPLUSPLUS_HPP} -> ${CMAKE_SOURCE_DIR}/external") - file(COPY ${TOMLPLUSPLUS_HPP} DESTINATION "${CMAKE_SOURCE_DIR}/external") - else() - message(FATAL_ERROR "The file '${TOMLPLUSPLUS_HPP}' does not exist!") - endif() + # Assume cppflags are passed to CMake. else() set(TOMLPLUSPLUS_HPP_DL "${CMAKE_SOURCE_DIR}/external/toml.hpp") if(EXISTS ${TOMLPLUSPLUS_HPP_DL}) @@ -133,4 +115,4 @@ # ----------------------------------------------------------------------------------------------------------- add_executable(gpt ${SRC_FILES}) target_link_libraries(gpt curl pthread fmt::fmt) -install(TARGETS gpt DESTINATION ${CMAKE_INSTALL_PREFIX}) +install(TARGETS gpt DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)