git-svn-id: svn://db.shs.com.ru/pip@192 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -161,13 +161,11 @@ endif ()
|
|||||||
|
|
||||||
|
|
||||||
# Add library
|
# Add library
|
||||||
if (${APPLE})
|
if (APPLE)
|
||||||
add_definitions(-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE)
|
add_definitions(-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE)
|
||||||
endif (${APPLE})
|
endif ()
|
||||||
if (${WIN32})
|
if (WIN32)
|
||||||
list(APPEND LIBS ws2_32 iphlpapi psapi)
|
list(APPEND LIBS ws2_32 iphlpapi psapi)
|
||||||
#execute_process(COMMAND "make_rc_win.bat" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} OUTPUT_QUIET)
|
|
||||||
#list(APPEND CPPS "pip_resource_win.o")
|
|
||||||
list(APPEND CPPS "pip_resource_win.rc")
|
list(APPEND CPPS "pip_resource_win.rc")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DPSAPI_VERSION=1")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DPSAPI_VERSION=1")
|
||||||
add_library(pip SHARED ${CPPS} ${HDRS})
|
add_library(pip SHARED ${CPPS} ${HDRS})
|
||||||
@@ -175,10 +173,8 @@ if (${WIN32})
|
|||||||
include(GenerateExportHeader)
|
include(GenerateExportHeader)
|
||||||
generate_export_header(pip)
|
generate_export_header(pip)
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /O2 /Ob2 /Ot")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /O2 /Ob2 /Ot")
|
||||||
#set(${CMAKE_C_FLAGS} "/O2 /Ob2 /Ot")
|
|
||||||
else ()
|
else ()
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")
|
||||||
#set(${CMAKE_CXX_FLAGS} "-O2")
|
|
||||||
endif ()
|
endif ()
|
||||||
else ()
|
else ()
|
||||||
set(${CMAKE_CXX_FLAGS} "${CMAKE_CXX_FLAGS} -O2")
|
set(${CMAKE_CXX_FLAGS} "${CMAKE_CXX_FLAGS} -O2")
|
||||||
@@ -192,30 +188,27 @@ else ()
|
|||||||
list(APPEND LIBS rt)
|
list(APPEND LIBS rt)
|
||||||
endif()
|
endif()
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
|
||||||
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3")
|
|
||||||
add_library(pip SHARED ${CPPS})
|
add_library(pip SHARED ${CPPS})
|
||||||
endif ()
|
endif ()
|
||||||
endif ()
|
endif ()
|
||||||
target_link_libraries(pip ${LIBS})
|
target_link_libraries(pip ${LIBS})
|
||||||
#install(TARGETS pip DESTINATION bin)
|
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS}")
|
|
||||||
|
|
||||||
# Test program
|
# Test program
|
||||||
#find_package(Qt4 REQUIRED)
|
#find_package(Qt4 REQUIRED)
|
||||||
#include_directories(${QT_INCLUDES})
|
#include_directories(${QT_INCLUDES})
|
||||||
add_executable(pip_test "main.cpp" "ccm_kbd.cpp")
|
add_executable(pip_test "main.cpp" "ccm_kbd.cpp")
|
||||||
target_link_libraries(pip_test pip)# ${QT_QTCORE_LIBRARY})
|
target_link_libraries(pip_test pip)# ${QT_QTCORE_LIBRARY})
|
||||||
#target_link_libraries(pip_test pip)
|
|
||||||
|
|
||||||
|
|
||||||
# Install
|
# Install
|
||||||
# Check if system or local install will be used (to system install use "-DLIB=" argument of cmake)
|
# Check if system or local install will be used (to system install use "-DLIB=" argument of cmake)
|
||||||
if (LIB)
|
if (LIB)
|
||||||
if (${WIN32})
|
if (WIN32)
|
||||||
|
if (MINGW)
|
||||||
find_package(MinGW REQUIRED)
|
find_package(MinGW REQUIRED)
|
||||||
set(CMAKE_INSTALL_PREFIX ${MINGW_DIR})
|
set(CMAKE_INSTALL_PREFIX ${MINGW_DIR})
|
||||||
install(FILES ${HDRS} DESTINATION ${MINGW_INCLUDE}/pip)
|
install(FILES ${HDRS} DESTINATION ${MINGW_INCLUDE}/pip)
|
||||||
install(TARGETS pip DESTINATION ${MINGW_LIB})
|
install(TARGETS pip DESTINATION ${MINGW_LIB})
|
||||||
|
endif ()
|
||||||
else ()
|
else ()
|
||||||
set(CMAKE_INSTALL_PREFIX /usr)
|
set(CMAKE_INSTALL_PREFIX /usr)
|
||||||
install(FILES ${HDRS} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/pip)
|
install(FILES ${HDRS} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/pip)
|
||||||
@@ -227,7 +220,7 @@ if (LIB)
|
|||||||
#list(APPEND HDRS "pip.h.gch")
|
#list(APPEND HDRS "pip.h.gch")
|
||||||
install(FILES "FindPIP.cmake" DESTINATION ${CMAKE_ROOT}/Modules)
|
install(FILES "FindPIP.cmake" DESTINATION ${CMAKE_ROOT}/Modules)
|
||||||
else ()
|
else ()
|
||||||
install(TARGETS pip DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
|
install(TARGETS pip DESTINATION bin)
|
||||||
message(STATUS "Install to local \"bin\"")
|
message(STATUS "Install to local \"bin\"")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
|||||||
12
clean.bat
12
clean.bat
@@ -20,3 +20,15 @@ rmdir /q /s CMakeFiles
|
|||||||
del /q /f CMakeCache.txt Makefile cmake_install.cmake install_manifest.txt *~ *cxx moc_* *.o *.exe *.a *.dll *.lib core
|
del /q /f CMakeCache.txt Makefile cmake_install.cmake install_manifest.txt *~ *cxx moc_* *.o *.exe *.a *.dll *.lib core
|
||||||
cd ..
|
cd ..
|
||||||
cd ..
|
cd ..
|
||||||
|
cd utils\system_daemon
|
||||||
|
del /q /f /s CMakeFiles
|
||||||
|
rmdir /q /s CMakeFiles
|
||||||
|
del /q /f CMakeCache.txt Makefile cmake_install.cmake install_manifest.txt *~ *cxx moc_* *.o *.exe *.a *.dll *.lib core
|
||||||
|
cd ..
|
||||||
|
cd ..
|
||||||
|
cd utils\udp_file_transfer
|
||||||
|
del /q /f /s CMakeFiles
|
||||||
|
rmdir /q /s CMakeFiles
|
||||||
|
del /q /f CMakeCache.txt Makefile cmake_install.cmake install_manifest.txt *~ *cxx moc_* *.o *.exe *.a *.dll *.lib core
|
||||||
|
cd ..
|
||||||
|
cd ..
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
cmake_mgw -DLIB=1 && make install %*
|
cmake -G "MinGW Makefiles" -DLIB=1 && make install %*
|
||||||
|
|||||||
1
make_lib_full.bat
Normal file
1
make_lib_full.bat
Normal file
@@ -0,0 +1 @@
|
|||||||
|
cmake -G "MinGW Makefiles" -DLIB=1 -DUSB=1 -DCRYPT=1 . && make install %*
|
||||||
@@ -1 +0,0 @@
|
|||||||
cmake_mgw -DLIB=1 -DUSB=1 && make install
|
|
||||||
Reference in New Issue
Block a user