mirror of
				https://github.com/Minres/conan-recipes.git
				synced 2025-10-31 14:11:53 +00:00 
			
		
		
		
	SystemC packaging working
This commit is contained in:
		
							
								
								
									
										17
									
								
								SystemC/test_package/CMakeLists.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								SystemC/test_package/CMakeLists.txt
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,17 @@ | ||||
| project(PackageTest CXX) | ||||
| cmake_minimum_required(VERSION 2.8.12) | ||||
|  | ||||
| include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) | ||||
| conan_basic_setup() | ||||
|  | ||||
| set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||||
| set(CMAKE_CXX_EXTENSIONS OFF) | ||||
|  | ||||
| add_executable(example example.cpp) | ||||
| target_link_libraries(example ${CONAN_LIBS}) | ||||
|  | ||||
| # CTest is a testing tool that can be used to test your project. | ||||
| # enable_testing() | ||||
| # add_test(NAME example | ||||
| #          WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin | ||||
| #          COMMAND example) | ||||
							
								
								
									
										24
									
								
								SystemC/test_package/conanfile.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								SystemC/test_package/conanfile.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,24 @@ | ||||
| from conans import ConanFile, CMake | ||||
| import os | ||||
|  | ||||
| class SystemcTestConan(ConanFile): | ||||
|     settings = "os", "compiler", "build_type", "arch" | ||||
|     generators = "cmake" | ||||
|  | ||||
|     def build(self): | ||||
|         cxxstd = self.options["SystemC"].stdcxx | ||||
|         cmake = CMake(self) | ||||
|         # Current dir is "test_package/build/<build_id>" and CMakeLists.txt is in "test_package" | ||||
|         cmake.configure(source_dir=self.conanfile_directory, build_dir="./") | ||||
|         #cmake.build() | ||||
|         self.run('cmake %s %s -DCMAKE_CXX_STANDARD=%s' % (self.conanfile_directory, cmake.command_line, cxxstd)) | ||||
|         self.run("cmake --build . %s" % cmake.build_config) | ||||
|  | ||||
|     def imports(self): | ||||
|         self.copy("*.dll", dst="bin", src="bin") | ||||
|         self.copy("*.dylib*", dst="bin", src="lib") | ||||
|         self.copy('*.so*', dst='bin', src='lib') | ||||
|  | ||||
|     def test(self): | ||||
|         os.chdir("bin") | ||||
|         self.run(".%sexample" % os.sep) | ||||
							
								
								
									
										7
									
								
								SystemC/test_package/example.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								SystemC/test_package/example.cpp
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,7 @@ | ||||
| #include <iostream> | ||||
| #include "systemc" | ||||
|  | ||||
| int sc_main(int argc, char* argv[]) { | ||||
|     printf("Success!\n"); | ||||
|     return 0; | ||||
| } | ||||
		Reference in New Issue
	
	Block a user