CMake installieren: Installation von Konfigurations-Dateien

Möchte ich CMake, make install Regeln für mich, die auch automatisch installieren, die Konfiguration und andere Dinge. Ich schaute auf diese Frage, aber hinzufügen:

add_executable(solshare_stats.conf solshare_stats.conf)

meine CMakeLists.txt Datei nur gab mir Warnungen und Fehler:

CMake Error: CMake can not determine linker language for target:solshare_stats.conf
CMake Error: Cannot determine link language for target "solshare_stats.conf".
...
make[2]: *** No rule to make target `CMakeFiles/solshare_stats.conf.dir/build'.  Stop.
make[1]: *** [CMakeFiles/solshare_stats.conf.dir/all] Error 2
make: *** [all] Error 2

Wie füge ich die Konfiguration, init und/oder logfiles zu CMake installieren Regeln?

Hier ist meine komplette CMakeLists.txt Datei:

project(solshare_stats)
cmake_minimum_required(VERSION 2.8)
aux_source_directory(. SRC_LIST)
add_executable(${PROJECT_NAME} ${SRC_LIST} )
add_executable(solshare_stats.conf solshare_stats.conf)
target_link_libraries(solshare_stats mysqlcppconn)
target_link_libraries(solshare_stats wiringPi)
if(UNIX)
    if(CMAKE_COMPILER_IS_GNUCXX)
        SET(CMAKE_EXE_LINKER_FLAGS "-s")
        SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -Wall -std=c++0x")
    endif()
    install(TARGETS solshare_stats DESTINATION /usr/bin COMPONENT binaries)
    install(TARGETS solshare_stats.conf DESTINATION /etc/solshare_stats COMPONENT config)
endif()

InformationsquelleAutor Cheiron | 2013-06-29

Schreibe einen Kommentar