Add install to cmake
This commit is contained in:
parent
885cace8e8
commit
2a134030ec
|
@ -30,8 +30,10 @@ if(WIN32 AND MSVC)
|
||||||
# turn off various warnings
|
# turn off various warnings
|
||||||
set(WARNING_FLAGS "${WARNING_FLAGS} /wd4996")
|
set(WARNING_FLAGS "${WARNING_FLAGS} /wd4996")
|
||||||
# C4090: 'function' : different 'const' qualifiers
|
# C4090: 'function' : different 'const' qualifiers
|
||||||
|
# C4244: '=' : conversion from '__int64' to 'uint', possible loss of data
|
||||||
|
# C4267: 'function' : conversion from 'size_t' to 'uint', possible loss of data
|
||||||
# foreach(warning 4244 4251 4267 4275 4290 4786 4305)
|
# foreach(warning 4244 4251 4267 4275 4290 4786 4305)
|
||||||
foreach(warning 4090)
|
foreach(warning 4090 4244 4267)
|
||||||
set(WARNING_FLAGS "${WARNING_FLAGS} /wd${warning}")
|
set(WARNING_FLAGS "${WARNING_FLAGS} /wd${warning}")
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
|
@ -41,7 +43,7 @@ if(WIN32 AND MSVC)
|
||||||
# endif (${MSVC_VERSION} EQUAL 1600)
|
# endif (${MSVC_VERSION} EQUAL 1600)
|
||||||
set( NOMINMAX 1 )
|
set( NOMINMAX 1 )
|
||||||
else()
|
else()
|
||||||
|
# add any gcc flags
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS} ${MSVC_FLAGS} -D_REENTRANT" )
|
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS} ${MSVC_FLAGS} -D_REENTRANT" )
|
||||||
|
@ -104,6 +106,11 @@ else ()
|
||||||
endif ()
|
endif ()
|
||||||
add_library ( ${name} ${LIB_TYPE} ${CFILES} ${HFILES} ${LIBHFILES} )
|
add_library ( ${name} ${LIB_TYPE} ${CFILES} ${HFILES} ${LIBHFILES} )
|
||||||
list ( APPEND add_LIBS ${name} )
|
list ( APPEND add_LIBS ${name} )
|
||||||
|
install(TARGETS ${name}
|
||||||
|
RUNTIME DESTINATION bin
|
||||||
|
ARCHIVE DESTINATION lib
|
||||||
|
LIBRARY DESTINATION lib
|
||||||
|
)
|
||||||
|
|
||||||
##########################################################
|
##########################################################
|
||||||
### main executable
|
### main executable
|
||||||
|
@ -114,13 +121,13 @@ target_link_libraries( ${name} ${add_LIBS} )
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
set_target_properties( ${name} PROPERTIES DEBUG_POSTFIX d )
|
set_target_properties( ${name} PROPERTIES DEBUG_POSTFIX d )
|
||||||
endif ()
|
endif ()
|
||||||
|
install (TARGETS ${name} DESTINATION bin)
|
||||||
|
|
||||||
set(name tab2space)
|
set(name tab2space)
|
||||||
add_executable( ${name} ${BINDIR}/tab2space.c )
|
add_executable( ${name} ${BINDIR}/tab2space.c )
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
set_target_properties( ${name} PROPERTIES DEBUG_POSTFIX d )
|
set_target_properties( ${name} PROPERTIES DEBUG_POSTFIX d )
|
||||||
endif ()
|
endif ()
|
||||||
|
# no INSTALL of this 'lcoal' tool
|
||||||
# TODO - deal with INSTALL
|
|
||||||
|
|
||||||
# eof
|
# eof
|
||||||
|
|
Loading…
Reference in a new issue