[zz]ÔÚ linux ÏÂʹÓà CMake ¹¹½¨Ó¦ÓóÌÐò
ÔÎĵØÖ·£ºhttp://www.ibm.com/developerworks/cn/linux/l-cn-cmake/index.html
±¾ÎĽéÉÜÁËÒ»¸ö¿çƽ̨µÄ×Ô¶¯»¯¹¹½¨ÏµÍ³ CMake ÔÚ linux ÉϵÄʹÓ÷½·¨¡£ CMake ÊÇÒ»¸ö±È automake ¸ü¼ÓÈÝÒ×ʹÓõŤ¾ß£¬Äܹ»Ê¹³ÌÐòÔ±´Ó¸´ÔӵıàÒëÁ¬½Ó¹ý³ÌÖнâÍѳöÀ´¡£ÎÄÖÐͨ¹ýһЩÀý×Ó½éÉÜʹÓà CMake ´¦Àí¶àÔ´ÎļþĿ¼µÄ·½·¨¡¢²éÕÒ²¢Ê¹ÓÃÆäËû¿ª·¢°üµÄ·½·¨ÒÔ¼°Éú³É debug °æºÍ release °æ³ÌÐòµÄ·½·¨¡£
CMake ¼ò½é
CMake ÊÇÒ»¸ö¿çƽ̨µÄ×Ô¶¯»¯½¨¹¹ÏµÍ³,ËüʹÓÃÒ»¸öÃûΪ CMakeLists.txt µÄÎļþÀ´ÃèÊö¹¹½¨¹ý³Ì,¿ÉÒÔ²úÉú±ê×¼µÄ¹¹½¨Îļþ,Èç Unix µÄ Makefile »òWindows Visual C++ µÄ projects/workspaces ¡£Îļþ CMakeLists.txt ÐèÒªÊÖ¹¤±àд,Ò²¿ÉÒÔͨ¹ý±àд½Å±¾½øÐаë×Ô¶¯µÄÉú³É¡£CMake ÌṩÁË±È autoconfig ¸ü¼ò½àµÄÓï·¨¡£ÔÚ linux ƽ̨ÏÂʹÓà CMake Éú³É Makefile ²¢±àÒëµÄÁ÷³ÌÈçÏÂ:
±àд CmakeLists.txt¡£
Ö´ÐÐÃüÁî “cmake PATH” »òÕß “ccmake PATH” Éú³É Makefile ( PATH ÊÇ CMakeLists.txt ËùÔÚµÄĿ¼ )¡£
ʹÓà make ÃüÁî½øÐбàÒë¡£
µÚÒ»¸ö¹¤³Ì
ÏÖ¼ÙÉèÎÒÃǵÄÏîÄ¿ÖÐÖ»ÓÐÒ»¸öÔ´Îļþ main.cpp
Çåµ¥ 1 Ô´Îļþ main.cpp
1 #include<iostream>
2
3 int main()
4 {
5 std::cout<<"Hello word!"<<std::endl;
6 return 0;
7 }
ΪÁ˹¹½¨¸ÃÏîÄ¿,ÎÒÃÇÐèÒª±àдÎļþ CMakeLists.txt ²¢½«ÆäÓë main.cpp ·ÅÔÚ Í¬Ò»¸öĿ¼ÏÂ:
Çåµ¥ 2 CMakeLists.txt
1 PROJECT(main)
2 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
3 AUX_SOURCE_DIRECTORY(. DIR_SRCS)
4 ADD_EXECUTABLE(main ${DIR_SRCS})
CMakeLists.txt µÄÓï·¨±È½Ï¼òµ¥,ÓÉÃüÁî¡¢×¢ÊͺͿոñ×é³É,ÆäÖÐÃüÁîÊDz»Çø·Ö´óСдµÄ,·ûºÅ"#"ºóÃæµÄÄÚÈݱ»ÈÏΪÊÇ×¢ÊÍ¡£ÃüÁîÓÉÃüÁîÃû³Æ¡¢Ð¡À¨ºÅºÍ²ÎÊý×é³É,²ÎÊýÖ®¼äʹÓÿոñ½øÐмä¸ô¡£ÀýÈç¶ÔÓÚÇåµ¥2µÄ CMakeLists.txt Îļþ:µÚÒ»ÐÐÊÇÒ»ÌõÃüÁî,Ãû³ÆÊÇ PROJECT ,²ÎÊýÊÇ main ,¸ÃÃüÁî±íʾÏîÄ¿µÄÃû³ÆÊÇ main ¡£µÚ¶þÐеÄÃüÁîÏÞ¶¨ÁË CMake µÄ°æ±¾¡£µÚÈýÐÐʹÓÃÃüÁî AUX_SOURCE_DIRECTORY ½«µ±Ç°Ä¿Â¼ÖеÄÔ´ÎļþÃû³Æ¸³Öµ¸ø±äÁ¿ DIR_SRCS ¡£ CMake ÊÖ²áÖжÔÃüÁî AUX_SOURCE_DIRECTORY µÄÃèÊöÈçÏÂ:
aux_source_directory(<dir> <variable>)
¸ÃÃüÁî»á°Ñ²ÎÊý <dir> ÖÐËùÓеÄÔ´ÎļþÃû³Æ¸³Öµ¸ø²ÎÊý <variable> ¡£ µÚËÄÐÐʹÓÃÃüÁî ADD_EXECUTABLE Ö¸Ê
Ïà¹ØÎĵµ£º
Ò»£ºÇ°ÑÔ
×î½üÔÚÑо¿androidµÄsensor driver£¬Ö÷ÒªÊÇE-compass£¬ÆäÖÐÓõ½ÁËLinux input×Óϵͳ.ÔÚÍøÉÏÒ²¿´Á˺ܶàÕâ·½ÃæµÄ×ÊÁÏ£¬¸Ð¾õ»¹ÊÇÕâƪ·ÖÎöµÄ±È½ÏϸÖÂ͸³¹£¬Òò´ËתÔØÒ»ÏÂÒÔ±ã×Ô¼ºÑ§Ï°£¬Í¬Ê±ºÍ´ó¼Ò·ÖÏí£¡
£¨Õâƪ²©¿ÍÖ÷ÒªÊÇÒÔ¼üÅÌÇý¶¯ÎªÀýµÄ£¬²»¹ý½²½âµÄÊÇLinux Input Subsystem£¬¿ÉÒÔ×ÐϸµÄÑо¿Ò»Ï£¡£©
¼üÅÌÇý¶¯½«¼ì ......
Linux diffÓëpatchµÄÉîÈë·ÖÎö
http://blog.csdn.net/vrix/archive/2009/08/25/4483906.aspx
diffµÄÊä³ö¸ñʽ·ÖΪ´«Í³¸ñʽºÍͳһ¸ñʽ
1)diffµÄ´«Í³¸ñʽÊä³ö.
############################################
cat before.txt
Êä³ö:
This is a line to be deleted
This is a line that will be changed
This is a line ......
Chapter 1: Thread
¢Ù thread functions
1. pthread_self();
2. thread existing
you can get the value of rval_ptr just by pthread_join(pthread_t tht, void ** rval_ptr)
cancel a thread as the thread exits with PTHREAD_CANCELED in pthread_exit, this functio ......
¡¡±¾ÎÄÖÜÏêµÄ½éÉÜÁËLinuxÄÚºËÖеÄͬ²½»úÖÆ£ºÔ×Ó²Ù×÷¡¢ÐźÅÁ¿¡¢¶ÁдÐźÅÁ¿ºÍ×ÔÐýËøµÄAPI£¬Ê¹ÓÃÐèÇó¼°Ò»Ð©µäÐÍʾÀý
¡¡¡¡Ò»¡¢ÒýÑÔ
¡¡¡¡ÔÚÏÖ´ú²Ù×÷ϵͳÀͬһʱ¼ä¿ÉÄÜÓжà¸öÄÚºËÖ´ÐÐÁ÷ÔÚÖ´ÐУ¬Òò´ËÄÚºËÆäʵÏó¶à½ø³Ì¶àÏ̱߳à³ÌÏàͬҲÐèҪһЩͬ²½»úÖÆÀ´Í¬²½¸÷Ö´Ðе¥Ôª¶Ô¹²ÏíÊý¾ÝµÄ·ÃÎÊ¡£ÓÈÆäÊÇÔڶദÀíÆ÷ϵͳÉÏ£¬¸üÐèÒªÒ» ......