我想使用相同的CMakeLists.txt
文件在Windows和Linux上安装一个库。我的cmake文件是:
cmake_minimum_required(VERSION 2.6)
project(library)
include_directories(include)
file(GLOB SOURCES "src/*.c")
file(GLOB HEADERS "include/*.h")
add_library(${PROJECT_NAME} STATIC ${SOURCES})
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "" PUBLIC_HEADER "${HEADERS}")
install(TARGETS ${PROJECT_NAME}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
PUBLIC_HEADER DESTINATION include)
在Linux中,此安装:
library.a
在usr/local/lib
module.h
在usr/local/include
但是,这在Windows上不起作用。我的问题是: