免责声明:我是新手。
我有以下 CMakeLists.txt 文件:
cmake_minimum_required( VERSION 2.8.10.2 )
project( widget )
# gleaned from the original makefile
add_definitions( -DPJ_IS_BIG_ENDIAN=0 )
add_definitions( -DPJ_IS_LITTLE_ENDIAN=1 )
add_definitions( -DPJ_AUTOCONF=1 )
SET ( SRC_PATH ${CMAKE_CURRENT_SOURCE_DIR}/src/pj )
SET ( sources ${SRC_PATH}/addr_resolv_sock.c
${SRC_PATH}/file_access_unistd.c
${SRC_PATH}/file_io_ansi.c
${SRC_PATH}/guid_simple.c
${SRC_PATH}/log_writer_stdout.c
${SRC_PATH}/os_core_unix.c
${SRC_PATH}/os_error_unix.c
${SRC_PATH}/os_time_unix.c
${SRC_PATH}/os_timestamp_common.c
${SRC_PATH}/os_timestamp_posix.c
${SRC_PATH}/pool_policy_malloc.c
${SRC_PATH}/sock_bsd.c
${SRC_PATH}/sock_select.c
)
SET( outpath ${CMAKE_CURRENT_LIST_DIR} "/lib/" )
message(" outpath = " ${outpath} )
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/include )
add_library( pj ${sources} )
ADD_CUSTOM_COMMAND( TARGET pj POST_BUILD
COMMAND ${CMAKE_COMMAND} -E echo "what now?"
COMMAND ${CMAKE_COMMAND} -E copy libpj.a "$outpath"
)
并且由于某种原因,$outpath
复制命令中的值被忽略了。如果我输入一个硬编码的字符串,例如“bubba”,它就可以工作。如果我设置$outpath
为“bubba”,它就不起作用。
我已经尝试了所有已知的变化$outpath
-- ${outpath}
, "$outpath"
, "${outpath}"
... 但没有一个工作。
这必须是显而易见的(对你来说),但我看不到。
所有帮助表示赞赏!
:bp: