├── .gitmodules ├── README.md ├── Examples ├── Tutorial_01 │ ├── CMakeLists.txt │ └── Tutorial_01.cpp ├── Tutorial_02_Shared │ ├── CMakeLists.txt │ ├── Tutorial_02_Shared.cpp │ └── Tutorial_02_Shared.h ├── Tutorial_02_Static │ ├── CMakeLists.txt │ ├── Tutorial_02_Static.cpp │ └── Tutorial_02_Static.h └── Tutorial_02 │ ├── CMakeLists.txt │ └── Tutorial_02.cpp ├── .gitattributes ├── CMakeLists.txt └── .gitignore /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "cmaid"] 2 | path = cmaid 3 | url = https://github.com/jpark730/cmaid.git 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | cmaid 2 | ======= 3 | A lazy CMake wrapper to minimize the work required to create and maintain cross-platform C++ projects. 4 | -------------------------------------------------------------------------------- /Examples/Tutorial_01/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | SET( DEFINE 2 | TUTORIAL_01 3 | ) 4 | SET( INCLUDE 5 | ) 6 | SET( LINK 7 | ) 8 | 9 | create_project(CONSOLE DEFINE INCLUDE LINK) 10 | -------------------------------------------------------------------------------- /Examples/Tutorial_02_Shared/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | SET( DEFINE 2 | TUTORIAL_02_SHARED 3 | ) 4 | SET( INCLUDE 5 | ) 6 | SET( LINK 7 | ) 8 | 9 | create_project(SHARED DEFINE INCLUDE LINK) 10 | -------------------------------------------------------------------------------- /Examples/Tutorial_02_Static/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | SET( DEFINE 2 | TUTORIAL_02_STATIC 3 | ) 4 | SET( INCLUDE 5 | ) 6 | SET( LINK 7 | ) 8 | 9 | create_project(STATIC DEFINE INCLUDE LINK) 10 | -------------------------------------------------------------------------------- /Examples/Tutorial_02_Shared/Tutorial_02_Shared.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "Tutorial_02_Shared.h" 3 | 4 | void Tutorial_02_Shared_Struct::PrintName() 5 | { 6 | printf("My name is: %s\n", this->Name); 7 | } 8 | -------------------------------------------------------------------------------- /Examples/Tutorial_02_Static/Tutorial_02_Static.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "Tutorial_02_Static.h" 3 | 4 | void Tutorial_02_Static_Struct::PrintName() 5 | { 6 | printf("My name is: %s\n", this->Name); 7 | } 8 | -------------------------------------------------------------------------------- /Examples/Tutorial_02_Static/Tutorial_02_Static.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class Tutorial_02_Static_Struct 4 | { 5 | private: 6 | const char* Name = "Tutorial 02 Static Struct"; 7 | public: 8 | void PrintName(); 9 | }; 10 | -------------------------------------------------------------------------------- /Examples/Tutorial_02_Shared/Tutorial_02_Shared.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class Tutorial_02_Shared_API Tutorial_02_Shared_Struct 4 | { 5 | private: 6 | const char* Name = "Tutorial 02 Shared Struct"; 7 | public: 8 | void PrintName(); 9 | }; 10 | -------------------------------------------------------------------------------- /Examples/Tutorial_02/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | SET( DEFINE 2 | ) 3 | SET( INCLUDE 4 | Tutorial_02_Static 5 | Tutorial_02_Shared 6 | ) 7 | SET( LINK 8 | Tutorial_02_Static 9 | Tutorial_02_Shared 10 | ) 11 | 12 | create_project(CONSOLE DEFINE INCLUDE LINK) 13 | -------------------------------------------------------------------------------- /Examples/Tutorial_01/Tutorial_01.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | // Tutorial 1: TUTORIAL_01 is defined in the CMakeLists.txt of the Tutorial_01 project 4 | int main() 5 | { 6 | #ifdef TUTORIAL_01 7 | printf("TUTORIAL_01 is defined!\n"); 8 | #else 9 | printf("TUTORIAL_01 is not defined!\n"); 10 | #endif 11 | printf("Press any key to exit...\n"); 12 | getchar(); 13 | return 0; 14 | } 15 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Shell scripts 2 | .sh text eol=cr 3 | .command text eol=cr 4 | 5 | # Standard to msysgit 6 | *.doc diff=astextplain 7 | *.DOC diff=astextplain 8 | *.docx diff=astextplain 9 | *.DOCX diff=astextplain 10 | *.dot diff=astextplain 11 | *.DOT diff=astextplain 12 | *.pdf diff=astextplain 13 | *.PDF diff=astextplain 14 | *.rtf diff=astextplain 15 | *.RTF diff=astextplain 16 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Debug : w/ debug symbols, w/o optimization 2 | # Release : w/o debug symbols, w/ optimization 3 | # RelWithDebInfo : w/ debug symbols, w/ optimization 4 | # MinSizeRel : w/o debug symbols, w/ optimization, stripped binaries 5 | cmake_minimum_required( VERSION 3.0 ) 6 | include( "${CMAKE_SOURCE_DIR}/cmaid/loader.cmake" ) 7 | project( DIRECTORY_NAME ) 8 | 9 | SET( GLOBAL_DEFINE 10 | #_CRT_SECURE_NO_WARNINGS 11 | ) 12 | 13 | create_build( GLOBAL_DEFINE ) 14 | -------------------------------------------------------------------------------- /Examples/Tutorial_02/Tutorial_02.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "Tutorial_02_Static.h" 3 | #include "Tutorial_02_Shared.h" 4 | 5 | // Tutorial 2: Static and shared libraries. 6 | int main() 7 | { 8 | #ifdef TUTORIAL_02_STATIC 9 | Tutorial_02_Static_Struct StaticStruct; 10 | StaticStruct.PrintName(); 11 | #endif 12 | 13 | #ifdef TUTORIAL_02_SHARED 14 | Tutorial_02_Shared_Struct SharedStruct; 15 | SharedStruct.PrintName(); 16 | #endif 17 | printf("Press any key to exit...\n"); 18 | getchar(); 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # Ignore all files by default, but scan all directories 5 | * 6 | !*/ 7 | 8 | # C/C++ source files 9 | !*.c 10 | !*.cc 11 | !*.cpp 12 | !*.c++ 13 | !*.cxx 14 | !*.cpp.template 15 | !*.h 16 | !*.h.template 17 | !*.pch.h 18 | !*.ipp 19 | !*.hpp 20 | !*.inl 21 | !*.inc 22 | !*.m 23 | !*.mm 24 | !*.def 25 | !*.exp 26 | !*.manifest 27 | 28 | !*.in 29 | !*_c 30 | !*_cpp 31 | !*_h 32 | !*_hpp 33 | 34 | # Other Source Files 35 | !*.rc 36 | !*.r 37 | !*.l 38 | !*.y 39 | 40 | # C/C++ Binaries 41 | !*.lib 42 | 43 | # Text files 44 | !*.txt 45 | !*_txt 46 | !*.md 47 | 48 | # Script files 49 | !*.bat 50 | !*.sh 51 | !*.pl 52 | !*.py 53 | !*.js 54 | !*.command 55 | 56 | # Other configuration and markup files 57 | !*.ini 58 | !*.json 59 | !*.tps 60 | !*.xml 61 | !*.xaml 62 | !*.uproject 63 | !*.uplugin 64 | !*.html 65 | !*.html.template 66 | !*.css 67 | !*.udn 68 | !*.config 69 | !*.version 70 | !.git* 71 | 72 | # Ignore Folders 73 | Purify/ 74 | Build/ 75 | CMake/ 76 | Binaries/ 77 | 78 | # Ignore MacOS disc cache 79 | .DS_Store 80 | 81 | # Include CMake Files 82 | !*.cmake 83 | --------------------------------------------------------------------------------