File tree Expand file tree Collapse file tree 3 files changed +148
-0
lines changed Expand file tree Collapse file tree 3 files changed +148
-0
lines changed Original file line number Diff line number Diff line change 1+ # Ensure minimum CMake version.
2+ cmake_minimum_required (VERSION 3.5 FATAL_ERROR)
3+
4+ # Name the project.
5+ project (crunch-project)
6+
7+ # Add the source library files.
8+ add_subdirectory (crnlib)
9+
10+ # Add the command-line tool.
11+ add_subdirectory (crunch)
12+
13+ # Add the emscripten library.
14+ # add_subdirectory(emscripten)
15+
16+ # Add the examples.
17+ # add_subdirectory(example1)
18+ # add_subdirectory(example2)
19+ # add_subdirectory(example3)
20+
21+ install (
22+ FILES
23+ ${CMAKE_SOURCE_DIR} /inc/crn_decomp.h
24+ ${CMAKE_SOURCE_DIR} /inc/crnlib.h
25+ ${CMAKE_SOURCE_DIR} /inc/dds_defs.h
26+ DESTINATION
27+ include /crunch
28+ )
Original file line number Diff line number Diff line change 1+ set (SRCFILES
2+ crnlib.cpp
3+ crn_arealist.cpp
4+ crn_assert.cpp
5+ crn_checksum.cpp
6+ crn_colorized_console.cpp
7+ crn_command_line_params.cpp
8+ crn_comp.cpp
9+ crn_console.cpp
10+ crn_core.cpp
11+ crn_data_stream.cpp
12+ crn_dds_comp.cpp
13+ crn_decomp.cpp
14+ crn_dxt.cpp
15+ crn_dxt1.cpp
16+ crn_dxt5a.cpp
17+ crn_dxt_endpoint_refiner.cpp
18+ crn_dxt_fast.cpp
19+ crn_dxt_hc.cpp
20+ crn_dxt_hc_common.cpp
21+ crn_dxt_image.cpp
22+ crn_dynamic_string.cpp
23+ crn_etc.cpp
24+ crn_file_utils.cpp
25+ crn_find_files.cpp
26+ crn_hash.cpp
27+ crn_hash_map.cpp
28+ crn_huffman_codes.cpp
29+ crn_image_utils.cpp
30+ crn_jpgd.cpp
31+ crn_jpge.cpp
32+ crn_ktx_texture.cpp
33+ crn_lzma_codec.cpp
34+ crn_math.cpp
35+ crn_mem.cpp
36+ crn_miniz.cpp
37+ crn_mipmapped_texture.cpp
38+ crn_pixel_format.cpp
39+ crn_platform.cpp
40+ crn_prefix_coding.cpp
41+ crn_qdxt1.cpp
42+ crn_qdxt5.cpp
43+ crn_rand.cpp
44+ crn_resampler.cpp
45+ crn_resample_filters.cpp
46+ crn_rg_etc1.cpp
47+ crn_ryg_dxt.cpp
48+ crn_sparse_bit_array.cpp
49+ crn_stb_image.cpp
50+ crn_strutils.cpp
51+ crn_symbol_codec.cpp
52+ crn_texture_comp.cpp
53+ crn_texture_conversion.cpp
54+ crn_texture_file_types.cpp
55+ crn_threaded_resampler.cpp
56+ crn_timer.cpp
57+ crn_utils.cpp
58+ crn_value.cpp
59+ crn_vector.cpp
60+ crn_zeng.cpp
61+ lzma_7zBuf.cpp
62+ lzma_7zBuf2.cpp
63+ lzma_7zCrc.cpp
64+ lzma_7zFile.cpp
65+ lzma_7zStream.cpp
66+ lzma_Alloc.cpp
67+ lzma_Bcj2.cpp
68+ lzma_Bra.cpp
69+ lzma_Bra86.cpp
70+ lzma_BraIA64.cpp
71+ lzma_LzFind.cpp
72+ lzma_LzmaDec.cpp
73+ lzma_LzmaEnc.cpp
74+ lzma_LzmaLib.cpp
75+ )
76+
77+ IF (WIN32 )
78+ set (SRCFILES ${SRCFILES}
79+ crn_threading_win32.cpp
80+ lzma_LzFindMt.cpp
81+ lzma_Threads.cpp
82+ )
83+ ELSE ()
84+ set (SRCFILES ${SRCFILES} crn_threading_pthreads.cpp)
85+ ENDIF (WIN32 )
86+
87+ IF (NOT WIN32 )
88+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC" )
89+ ENDIF (NOT WIN32 )
90+
91+ add_library (crunch STATIC ${SRCFILES} )
92+
93+ IF (NOT WIN32 )
94+ target_link_libraries (crunch pthread)
95+ ENDIF ()
96+
97+ target_include_directories (crunch
98+ INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
99+ )
100+
101+ install (TARGETS crunch DESTINATION lib)
Original file line number Diff line number Diff line change 1+ add_executable (crunch_exe
2+ corpus_gen.cpp
3+ corpus_test.cpp
4+ crunch.cpp
5+ )
6+
7+ target_include_directories (crunch_exe
8+ PUBLIC ${CMAKE_SOURCE_DIR} /inc
9+ )
10+
11+ target_link_libraries (crunch_exe
12+ PUBLIC crunch
13+ )
14+
15+ set_target_properties (crunch_exe
16+ PROPERTIES
17+ OUTPUT_NAME crunch)
18+
19+ install (TARGETS crunch_exe DESTINATION bin)
You can’t perform that action at this time.
0 commit comments