Edit C Engineering with Clion

Source: Internet
Author: User

Recently studying the Linux C Code Editor, do not really like Si (Windows look at the code is OK, editing, synchronization Trouble),

Try to use Clion, but the makefile engineering support is not good, how to compile still do not understand,

Reading, editing is also good, smart tips, grammar check, function jump, check references are very useful.


But to use these features of clion, you need to add the H file in the project to CMakeList.txt,
Refer to the following script (add the print results to CMakeList.txt).
#!/usr/bin/env python#-*-coding:utf-8-*-ImportFnmatchImportOSImportSYSdeffind_file (Path, file_exp): forR, D, FinchOs.walk (path): forNinchFnmatch.filter (F, file_exp):yieldOs.path.join (r, N)if __name__=='__main__':    ifLen (SYS.ARGV)! = 2:        Print('Usage:python get_h_cmakelist.py Path_to_your_project') Exit (-1) Project_path= Sys.argv[1] H_dir= []     forFileinchFind_file (Project_path,'*.h'): File_dir=os.path.dirname (file)ifFile_dir not inchh_dir:h_dir.append (File_dir)Print('include_directories ({0})'. Format ('\r\n\t'. Join (H_dir)))

The results are similar

Include_directories (E:\ids\suricata-3.1.  2\LIBHTP\HTP    E:\ids\suricata-3.1.  2\libhtp\test    E:\ids\suricata-3.1.  2\libhtp\test\gtest    E:\ids\suricata-3.1.  2\src)

Edit C Engineering with Clion

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.