add ENABLE_TEST OPTION
This commit is contained in:
		
							parent
							
								
									8863c2ff2a
								
							
						
					
					
						commit
						a8abebd466
					
				
							
								
								
									
										2
									
								
								.vscode/tasks.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.vscode/tasks.json
									
									
									
									
										vendored
									
									
								
							@ -9,7 +9,7 @@
 | 
				
			|||||||
            "command": "bash",
 | 
					            "command": "bash",
 | 
				
			||||||
            "args": [
 | 
					            "args": [
 | 
				
			||||||
                "-c",
 | 
					                "-c",
 | 
				
			||||||
                "cd ${workspaceFolder}/build && cmake .. -DCMAKE_BUILD_TYPE=Debug && make -j4",
 | 
					                "cd ${workspaceFolder} && mkdir -p build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Debug && make -j4",
 | 
				
			||||||
            ],
 | 
					            ],
 | 
				
			||||||
            "options": {
 | 
					            "options": {
 | 
				
			||||||
                "cwd": "/bin"
 | 
					                "cwd": "/bin"
 | 
				
			||||||
 | 
				
			|||||||
@ -5,6 +5,8 @@ SET(CMAKE_BUILD_TYPE "Debug")
 | 
				
			|||||||
SET(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g2 -ggdb")
 | 
					SET(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g2 -ggdb")
 | 
				
			||||||
SET(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall")
 | 
					SET(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					option(ENABLE_TEST "gtest build" OFF)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# include(CTest)
 | 
					# include(CTest)
 | 
				
			||||||
# enable_testing()
 | 
					# enable_testing()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -19,7 +21,12 @@ link_directories(
 | 
				
			|||||||
    /usr/local/lib/
 | 
					    /usr/local/lib/
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if(ENABLE_TEST)
 | 
				
			||||||
    add_subdirectory(gtest)
 | 
					    add_subdirectory(gtest)
 | 
				
			||||||
 | 
					endif(ENABLE_TEST)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
add_executable(orderly src/main.cpp)
 | 
					add_executable(orderly src/main.cpp)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
 | 
					set(CPACK_PROJECT_NAME ${PROJECT_NAME})
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user