Skip to content

Commit eff6b3c

Browse files
committed
Fix cmake build
1 parent 2cad7df commit eff6b3c

File tree

2 files changed

+58
-58
lines changed

2 files changed

+58
-58
lines changed

CMakeLists.txt

Lines changed: 58 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -18,77 +18,77 @@ endif()
1818
set(COMMON_FLAGS "-Wall -Wextra -O3 -fomit-frame-pointer -fPIC -DNDEBUG -pedantic -march=native")
1919
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMMON_FLAGS} -fno-rtti")
2020
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMMON_FLAGS}")
21-
21+
set(SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src")
2222

2323
if(MSVC)
2424
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
2525
endif()
2626

2727
# Source files
2828
set(LIB_COMMON_SOURCES
29-
Global.cpp
30-
Event.cpp
31-
entropy/EntropyUtils.cpp
32-
entropy/HuffmanCommon.cpp
33-
entropy/CMPredictor.cpp
34-
entropy/TPAQPredictor.cpp
35-
transform/AliasCodec.cpp
36-
transform/BWT.cpp
37-
transform/BWTS.cpp
38-
transform/DivSufSort.cpp
39-
transform/SBRT.cpp
40-
transform/BWTBlockCodec.cpp
41-
transform/LZCodec.cpp
42-
transform/FSDCodec.cpp
43-
transform/ROLZCodec.cpp
44-
transform/RLT.cpp
45-
transform/SRT.cpp
46-
transform/TextCodec.cpp
47-
transform/UTFCodec.cpp
48-
transform/EXECodec.cpp
49-
transform/ZRLT.cpp
29+
${SRC_DIR}/Global.cpp
30+
${SRC_DIR}/Event.cpp
31+
${SRC_DIR}/entropy/EntropyUtils.cpp
32+
${SRC_DIR}/entropy/HuffmanCommon.cpp
33+
${SRC_DIR}/entropy/CMPredictor.cpp
34+
${SRC_DIR}/entropy/TPAQPredictor.cpp
35+
${SRC_DIR}/transform/AliasCodec.cpp
36+
${SRC_DIR}/transform/BWT.cpp
37+
${SRC_DIR}/transform/BWTS.cpp
38+
${SRC_DIR}/transform/DivSufSort.cpp
39+
${SRC_DIR}/transform/SBRT.cpp
40+
${SRC_DIR}/transform/BWTBlockCodec.cpp
41+
${SRC_DIR}/transform/LZCodec.cpp
42+
${SRC_DIR}/transform/FSDCodec.cpp
43+
${SRC_DIR}/transform/ROLZCodec.cpp
44+
${SRC_DIR}/transform/RLT.cpp
45+
${SRC_DIR}/transform/SRT.cpp
46+
${SRC_DIR}/transform/TextCodec.cpp
47+
${SRC_DIR}/transform/UTFCodec.cpp
48+
${SRC_DIR}/transform/EXECodec.cpp
49+
${SRC_DIR}/transform/ZRLT.cpp
5050
)
5151

5252
set(LIB_COMP_SOURCES
53-
api/Compressor.cpp
54-
bitstream/DebugOutputBitStream.cpp
55-
bitstream/DefaultOutputBitStream.cpp
56-
io/CompressedOutputStream.cpp
57-
entropy/ANSRangeEncoder.cpp
58-
entropy/BinaryEntropyEncoder.cpp
59-
entropy/ExpGolombEncoder.cpp
60-
entropy/FPAQEncoder.cpp
61-
entropy/HuffmanEncoder.cpp
62-
entropy/RangeEncoder.cpp
53+
${SRC_DIR}/api/Compressor.cpp
54+
${SRC_DIR}/bitstream/DebugOutputBitStream.cpp
55+
${SRC_DIR}/bitstream/DefaultOutputBitStream.cpp
56+
${SRC_DIR}/io/CompressedOutputStream.cpp
57+
${SRC_DIR}/entropy/ANSRangeEncoder.cpp
58+
${SRC_DIR}/entropy/BinaryEntropyEncoder.cpp
59+
${SRC_DIR}/entropy/ExpGolombEncoder.cpp
60+
${SRC_DIR}/entropy/FPAQEncoder.cpp
61+
${SRC_DIR}/entropy/HuffmanEncoder.cpp
62+
${SRC_DIR}/entropy/RangeEncoder.cpp
6363
)
6464

6565
set(LIB_DECOMP_SOURCES
66-
api/Decompressor.cpp
67-
bitstream/DebugInputBitStream.cpp
68-
bitstream/DefaultInputBitStream.cpp
69-
io/CompressedInputStream.cpp
70-
entropy/ANSRangeDecoder.cpp
71-
entropy/BinaryEntropyDecoder.cpp
72-
entropy/ExpGolombDecoder.cpp
73-
entropy/FPAQDecoder.cpp
74-
entropy/HuffmanDecoder.cpp
75-
entropy/RangeDecoder.cpp
66+
${SRC_DIR}/api/Decompressor.cpp
67+
${SRC_DIR}/bitstream/DebugInputBitStream.cpp
68+
${SRC_DIR}/bitstream/DefaultInputBitStream.cpp
69+
${SRC_DIR}/io/CompressedInputStream.cpp
70+
${SRC_DIR}/entropy/ANSRangeDecoder.cpp
71+
${SRC_DIR}/entropy/BinaryEntropyDecoder.cpp
72+
${SRC_DIR}/entropy/ExpGolombDecoder.cpp
73+
${SRC_DIR}/entropy/FPAQDecoder.cpp
74+
${SRC_DIR}/entropy/HuffmanDecoder.cpp
75+
${SRC_DIR}/entropy/RangeDecoder.cpp
7676
)
7777

7878
set(TEST_SOURCES
79-
test/TestEntropyCodec.cpp
80-
test/TestBWT.cpp
81-
test/TestCompressedStream.cpp
82-
test/TestDefaultBitStream.cpp
83-
test/TestTransforms.cpp
84-
test/TestAPI.cpp
79+
${SRC_DIR}/test/TestEntropyCodec.cpp
80+
${SRC_DIR}/test/TestBWT.cpp
81+
${SRC_DIR}/test/TestCompressedStream.cpp
82+
${SRC_DIR}/test/TestDefaultBitStream.cpp
83+
${SRC_DIR}/test/TestTransforms.cpp
84+
${SRC_DIR}/test/TestAPI.cpp
8585
)
8686

8787
set(APP_SOURCES
88-
app/Kanzi.cpp
89-
app/InfoPrinter.cpp
90-
app/BlockCompressor.cpp
91-
app/BlockDecompressor.cpp
88+
${SRC_DIR}/app/Kanzi.cpp
89+
${SRC_DIR}/app/InfoPrinter.cpp
90+
${SRC_DIR}/app/BlockCompressor.cpp
91+
${SRC_DIR}/app/BlockDecompressor.cpp
9292
)
9393

9494
# Libraries
@@ -104,23 +104,23 @@ set_target_properties(libkanzi_shared PROPERTIES OUTPUT_NAME "kanzi")
104104
#add_library(libkanzi_decomp_shared SHARED ${LIB_DECOMP_SOURCES})
105105

106106
# Executable target for C++
107-
add_executable(testBWT test/TestBWT.cpp)
107+
add_executable(testBWT ${SRC_DIR}/test/TestBWT.cpp)
108108
target_link_libraries(testBWT libkanzi)
109109

110-
add_executable(testTransforms test/TestTransforms.cpp)
110+
add_executable(testTransforms ${SRC_DIR}/test/TestTransforms.cpp)
111111
target_link_libraries(testTransforms libkanzi)
112112

113-
add_executable(testEntropyCodec test/TestEntropyCodec.cpp)
113+
add_executable(testEntropyCodec ${SRC_DIR}/test/TestEntropyCodec.cpp)
114114
target_link_libraries(testEntropyCodec libkanzi)
115115

116-
add_executable(testDefaultBitStream test/TestDefaultBitStream.cpp)
116+
add_executable(testDefaultBitStream ${SRC_DIR}/test/TestDefaultBitStream.cpp)
117117
target_link_libraries(testDefaultBitStream libkanzi)
118118

119-
add_executable(testCompressedStream test/TestCompressedStream.cpp)
119+
add_executable(testCompressedStream ${SRC_DIR}/test/TestCompressedStream.cpp)
120120
target_link_libraries(testCompressedStream libkanzi)
121121

122122
# Executable target for C API test (TestAPI.c)
123-
add_executable(testAPI test/TestAPI.c)
123+
add_executable(testAPI ${SRC_DIR}/test/TestAPI.c)
124124
target_link_libraries(testAPI libkanzi)
125125
# IMPORTANT: Force use of C++ Linker because we link against C++ lib 'archon_static'
126126
set_target_properties(testAPI PROPERTIES LINKER_LANGUAGE CXX)

0 commit comments

Comments
 (0)