Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions cmake/FindCPPCHECK.cmake
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
find_program(CPPCHECK_EXECUTABLE cppcheck )
mark_as_advanced( CPPCHECK_EXECUTABLE )

if (NOT CPPCHECK_EXECUTABLE)
if (CPPCHECK_FIND_REQUIRED)
message(FATAL_ERROR "ERROR: Could not find cppcheck")
endif ()
endif ()
20 changes: 13 additions & 7 deletions src/lib/jp2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,16 @@ include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/mct
${CMAKE_CURRENT_SOURCE_DIR}/t2
)
# Defines the source code for the library
set(GROK_SRCS

# Defines the source code for executables
set(GROK_EXECUTABLES_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/util/test_sparse_array.cpp
${CMAKE_CURRENT_SOURCE_DIR}/util/bench_dwt.cpp
${CMAKE_CURRENT_SOURCE_DIR}/t1/t1_part1/t1_generate_luts.cpp
)

# Defines the source code for the library
set(GROK_LIBRARY_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/util/BufferedStream.cpp
${CMAKE_CURRENT_SOURCE_DIR}/util/BufferedStream.h
${CMAKE_CURRENT_SOURCE_DIR}/util/IBufferedStream.h
Expand Down Expand Up @@ -196,17 +202,17 @@ if(WIN32)
else()
add_definitions(-DGRK_STATIC)
endif()
add_library(${GROK_LIBRARY_NAME} ${GROK_SRCS})
add_library(${GROK_LIBRARY_NAME} ${GROK_LIBRARY_SRCS})
set(INSTALL_LIBS ${GROK_LIBRARY_NAME})
else()
if(BUILD_SHARED_LIBS AND BUILD_STATIC_LIBS)
# Builds both static and dynamic libs, and install static version
add_library(${GROK_LIBRARY_NAME} SHARED ${GROK_SRCS})
add_library(${GROK_LIBRARY_NAME}_static STATIC ${GROK_SRCS})
add_library(${GROK_LIBRARY_NAME} SHARED ${GROK_LIBRARY_SRCS})
add_library(${GROK_LIBRARY_NAME}_static STATIC ${GROK_LIBRARY_SRCS})
set_target_properties(${GROK_LIBRARY_NAME}_static PROPERTIES OUTPUT_NAME ${GROK_LIBRARY_NAME})
set(INSTALL_LIBS ${GROK_LIBRARY_NAME} ${GROK_LIBRARY_NAME}_static)
else()
add_library(${GROK_LIBRARY_NAME} ${GROK_SRCS})
add_library(${GROK_LIBRARY_NAME} ${GROK_LIBRARY_SRCS})
set(INSTALL_LIBS ${GROK_LIBRARY_NAME})
endif()
endif()
Expand Down Expand Up @@ -257,7 +263,7 @@ endif()
# warning regex to catch them.
if(GROK_CPPCHECK)
find_package(CPPCHECK REQUIRED)
foreach(f ${GROK_SRCS})
foreach(f ${GROK_EXECUTABLES_SRCS} ${GROK_LIBRARY_SRCS})
# cppcheck complains about too many configuration, pretend to be WIN32:
add_custom_command(TARGET ${GROK_LIBRARY_NAME}
COMMAND ${CPPCHECK_EXECUTABLE} -DWIN32 ${f})
Expand Down
4 changes: 0 additions & 4 deletions src/lib/jp2/util/test_sparse_array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@

#include "grok_includes.h"

namespace grk {

int main()
{
uint32_t i, j, w, h;
Expand Down Expand Up @@ -217,5 +215,3 @@ int main()

return 0;
}

}